Implement Outbound Calls using Amazon Connect


While working with Cognito and integrating Multi-Factor Authentication (MFA), we encountered an issue: Cognito does not support delivering MFA codes via phone call. Currently, it only supports MFA via SMS messages and Authenticator Apps. This limitation posed a challenge when attempting to integrate a call feature alongside SMS and Authenticator app functionalities within a single service.

However, with AWS services available, we sought to provide a solution to address this challenge. Our article aims to present an approach to implement the calling feature without the need to set up and rely on third-party services, which can become cumbersome to maintain and manage over time.

I. Setting Up Outbound Voice Flows with Amazon Connect

Most developers can sign up for an AWS Free Tier account on the AWS website, accessing the Management Console to manage resources. While many services are free, AWS Connect may not be included. To access AWS Connect, create a support ticket for permission from AWS Support.

Note: As you can see Service limits can support you in overcoming restrictions when expanding your use of AWS services as an AWS account developer.

Set up your Amazon Connect instance and select the option to `Store users in Amazon Connect`. Additionally, define a custom URL to access the AWS dashboard of Amazon Connect.

In AWS Connect, when proceeding to step 2, you will need to add an administrator to grant them the capability to adjust connect flows within the instance.

To illustrate which AWS Connect identifiers to use for configuring the outbound call service, we can refer to the following command:

[--name <value>]
[--description <value>]
[--references <value>]
[--related-contact-id <value>]
--destination-phone-number <value>
--contact-flow-id <value>
--instance-id <value>
[--client-token <value>]
[--source-phone-number <value>]
[--queue-id <value>]
[--attributes <value>]
[--answer-machine-detection-config <value>]
[--campaign-id <value>]
[--traffic-type <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--endpoint-url <value>]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]

Refer to the link to find that `instance-id` constitutes one part of the Amazon Resource Name (ARN) for the instance.

The next step is to ensure that you have created administrator access. Alternatively, if you choose the option `No administrator,' click on Login for emergency access to access the AWS Connect dashboard.

For example:

This string of characters, `fda6f30e-6cbf-4d78-87ca-94164ae2baa4`, is our contact flow ID. You can find it in the screenshot above. Let us break down each block in AWS Connect, including Set Voice, Message Delivery, Play Prompt, and Disconnect.

» Set Voice

This block allows you to configure attributes related to the voice interaction within a contact flow, such as setting the voice, language, and speech rate for prompts and messages played during a call.

» Message Delivery

Note: Leverage AWS Connect that support SSML (Speech Synthesis Markup Language), which is a markup language used to control aspects of synthesized speech output such as pronunciation, pitch, volume, and speed.

» Play prompt

Note: `$.Attributes.VoiceMFA` is one approach to retrieve data from a Lambda function and use it in AWS Connect. However, there are numerous alternative methods available for achieving this integration.

» Disconnect

Let us proceed with setting up the destination phone number for your contact center instance. We will use the Claim Phone Number feature provided by AWS Connect.

After successfully setting up the AWS Connect instance and obtaining essential configurations for setting up outbound calls either via AWS CLI or Lambda, our next step involves working with Lambda functions for this implementation.

II. Trigger AWS Lambda Functions with Amazon Connect


Vuong Nguyen
Vuong Nguyen The individual is sociable and enjoys making friends, often sharing knowledge across various fields. |1 second ago
Vuong Nguyen The individual is sociable and enjoys making friends, often sharing knowledge across various fields. 1 second ago
You need to login to do this manipulation!