we are using Amazon Connect and we are running into an issue. On the service-desk, we have a "standby shift", this means the user that is in that queue/shift is the only on-call. However, if he/she misses said call. They are stuck in the "Missed" state within the Connect CCP. I already tried the custom CCP method, however this does not fit our requirements yet.
Our second option is making a lambda that gets executed on a missed call (Right before the disconnect of a user) to remove the "Missed" state and set it on "Available". This is what I tried to do so:
var AWS = require('aws-sdk');
exports.handler = async (event) => {
var connect = new AWS.Connect();
let agentARN = event['Details']['Parameters']['agent'];
var params = {
AgentStatusId: 'Available',
InstanceId: 'arn:aws:connect:eu-central-1:ID:ARN',
UserId: agentARN
};
let errors;
connect.putUserStatus(params, function(err, data) {
if (err) errors = err.stack; // an error occurred
else errors = data; // successful response
});
const response = {
statusCode: 200,
body: errors
};
return response;
};
Any ideas?