I achieved the following use case :
1) I am able to programmatically make an outbound call for the 'Contact flow (inbound)' contact flow type using the following code
let params = {
"InstanceId" : '12345l-abcd-1234-abcde-123456789bcde',
"ContactFlowId" : '987654-lkjhgf-9875-abcde-poiuyt0987645',
"SourcePhoneNumber" : '+1123456789',
"DestinationPhoneNumber" : customerPhoneNumber,
"Attributes" : {
'name' : customerName,
'dayOfWeek' : dayOfWeek
}
}
connect.startOutboundVoiceContact(
params, function (error, response){
if(error) {
console.log(error)
callback("Error", null);
} else
{
console.log('Initiated an outbound call with Contact Id ' + JSON.stringify(response.ContactId));
callback(null, 'Success');
}
}
);
It is successfully working. But one issue is 'It will directly call the customer from the AWS Connect which will not include the agent'
2) Using the Amazon CCP (Call Control Panel), I am able to make an outbound call to the customer and It is working successfully.
TODO / AIM :
Instead of 'contact inbound flow type', If I try to use the 'Agent Transfer flow type' with the same code,
It is failed with the following error
message: 'ContactFlow type is invalid',
code: 'InvalidParameterException',
time: 2019-10-17T14:28:02.568Z,
requestId: 'e7359538-a0b2-47c5-a61f-6c7e1b4bf7a6',
statusCode: 400,
retryable: false,
retryDelay: 63.66530948519367 }
So how do I automatically connect the agent to the customer in the call?