BenBruce
BenBruce

Reputation: 1

Amazon Connect - Outbound Number Check Contact Flow- Lambda Function

I'm looking for some help regarding outbound calling. Using the article https://aws.amazon.com/blogs/contact-center/identify-and-move-unwelcomed-calls-on-your-amazon-connect-instance/ I have created a function that will block/play message to customers if the number exists in a SQL table for inbound calls. My main goal however is outbound calling - blocking UK-CTPS or US-DoNotCall database. I want to check the number dialed against the DB before the call is connected - then proceed if number does not exist, or terminate the call if number does exist. There appears to be little documentation regarding outbound calling flows. I can set up the flow to check the number after the call has connected, but need it to work prior to the call, obviously.

Upvotes: 0

Views: 830

Answers (1)

Aossey
Aossey

Reputation: 935

When an outbound contact is initiated in Amazon Connect, the dial request is processed immediately and then connected to a contact flow after the call is setup. This means that there is no opportunity to defeat the dialing request after the dialing client has sent the request. If you need to process logic to deny the dialing request, it would need to be done in the client prior to the request being sent to then Amazon Connect APIs.

There are 2 APIs that allow contacts to be created/initiated; the one that is used by web-based interfaces (like the Amazon Connect Contact Control Panel) which agents use, and the Outbound API that is part of the AWS SDK (which is meant for automated dialing applications). If your use case is preventing agents from dialing numbers on Do Not Call lists, then you can use the Streams API to create a custom dialing interface for the agents and only allow the dialing request to be sent after you check your Do Not Call blacklist.

You could use Amazon API Gateway to expose an HTTP interface to your Lambda code using the Lambda Proxy (see documentation here). When an agent clicks the dial button in your custom interface, you can call the API Gateway method to check the number against your DNC list. If the number is not found in the DNC list, then you would process the dialing request with the agent.connect() function of the Streams API (example below).

agent.connect(Endpoint.byPhoneNumber("5558675309"), {
   success: function() { ... },
   failure: function() { ... }
});

Upvotes: 0

Related Questions