AWS Contact Center
Using SMS to accept alphanumeric entry for voice calls with Amazon Connect
Organizations are increasingly using speech recognition to create powerful conversational interfaces in the contact center, enabling self-service, user identification, and caller authentication based on users’ spoken natural language. These capabilities create delightful experiences for the user and improve containment rates and customer satisfaction scores.
Oftentimes, in order to authenticate callers, organizations typically must collect alphanumeric strings (for example, “What is your customer ID?” or “Can you tell me the order ID you’re calling about?”). Occasionally, these IDs are a mix of numbers and letters. This style of input is often challenging for natural language solutions to accurately detect over low fidelity telephone networks, and customers may prefer an alternative such as SMS to avoid misinterpreted inputs.
In this blog, we will show you how to utilize SMS during an active Amazon Connect voice interaction to collect information accurately, increasing IVR containment rates and customer satisfaction. This solution uses Amazon Connect, Amazon Pinpoint, Amazon DynamoDB, and AWS Lambda.
Solution overview and architecture
In this example, we use Amazon Connect contact flows, which provide self-service capabilities. When a user calls in via phone, they’re prompted to provide a customer ID. We will demonstrate how Amazon Connect contact flows can invoke AWS Lambda to request an outbound SMS through Amazon Pinpoint to the user’s mobile number. When the user replies to the SMS message, Amazon Pinpoint will publish the response to an Amazon Simple Notification Service (Amazon SNS) topic, which will trigger a Lambda function. The Amazon Connect contact flow will notify the user when the message is sent, and will periodically query DynamoDB using Lambda until the user’s response is populated.
In this solution, we will create an Amazon Pinpoint two-way SMS application to support bidirectional SMS capabilities. We will also deploy an AWS CloudFormation template to create an Amazon SNS topic to receive inbound SMS from Amazon Pinpoint. The template also creates a DynamoDB table to store inbound SMS responses, and a helper Lambda function to subscribe to the SNS topic and populate the DynamoDB table with the inbound response. We will then import a sample contact flow to deploy the solution in Amazon Connect.
The flow of this architecture is as follows:
- A customer calls into a cloud contact center powered by Amazon Connect
- Call is delivered to Amazon Connect, a contact flow plays a message advising the user that they will receive a text message request to provide their account ID
- Amazon Connect contact flow invokes a Lambda helper function
- The helper function invokes Amazon Pinpoint to validate if the calling number is a valid mobile phone number
- If the calling number is a valid mobile phone number, the helper Lambda function then uses a Amazon Pinpoint API to send an SMS to the customer asking them to provide their account ID
- The helper Lambda stores a request ID for the request to match it when the customer response arrives
- Amazon Pinpoint sends an SMS request to the customer
- Customer responds with their account ID
- Amazon Pinpoint publishes response to Amazon SNS
- The helper Lambda is notified
- Helper Lambda stores the received account ID in the DynamoDB table
- Amazon Connect enters pause loop awaiting account ID
- Amazon Connect reads account ID from DynamoDB via Lambda helper function, Amazon Connect confirms account ID to caller
Note: This process is followed because of the asynchronous nature of this interaction. The Contact Flow cannot wait during Lambda execution for the return SMS, so it loops and waits for an update. Amazon Pinpoint uses Amazon SNS to notify Lambda that there’s a new inbound message to process, and Amazon Connect uses Lambda to poll the DynamoDB table for the update state.
To deploy this solution, we will perform the following steps:
- Claim SMS-Enabled toll free number in Amazon Pinpoint
- Deploy CloudFormation Stack
- Configure Amazon Pinpoint phone numbers
- Configure Amazon Connect
For this walkthrough, you should have the following prerequisites:
- An AWS account where you can deploy this solution
- Access to the following AWS services:
- Amazon Connect
- Amazon Pinpoint
- Amazon SNS
- AWS Identity and Access Management, with access to create policies and roles
- AWS CloudFormation to run the CloudFormation template
Claim SMS-Enabled toll free number in Amazon Pinpoint
The first step is to claim an SMS-Enabled toll free number in Amazon Pinpoint:
- Sign in to AWS Management Console and navigate to the Amazon Pinpoint console
- Select Phone numbers in the SMS and voice category
- Select Request Phone Number
- Select Toll-free or 10DLC and enable SMS under capabilities.
- Select Transactional for default message type
- Choose NextNOTE: If you do not currently have an SMS-enabled phone number in Amazon Pinpoint, you must follow special registration or request procedures to obtain an SMS-enabled number. For toll-free, you must register the toll free number before you can send SMS. For 10 Digit Long Codes, you must request a limit increase to allow for claiming 10DLC numbers.
- Choose Request, and momentarily you will see the Toll-free Number assigned. Make note of this toll-free number, you will need it to deploy the CloudFormation stack in a later step.
Deploy CloudFormation stack
To test this solution, deploy it using AWS CloudFormation. This will deploy and configure the necessary services, and insert a contact flow into your Amazon Connect instance.
To begin, log into the AWS Management Console and select the AWS Region where your Amazon Connect instance is hosted.
- Choose the Launch Stack button to create a new stack:
- Update the default parameters of the stack to match your environment. You’ll need:
- A valid Amazon Connect Instance ID. You can obtain your instance ID from the Amazon Connect console.
- The toll-free number that you created in the previous section.
- In the information box, select the presented acknowledgements. This gives AWS CloudFormation permission to create the IAM permissions required for this solution on your behalf.
Configure Amazon Pinpoint phone number
- Navigate to the Amazon Pinpoint console.
- Select Phone Numbers under the SMS and voice heading
- Select the toll-free number you previously created
- Expand the Two-way SMS header and select Enable two-way SMS
- Select Choose an existing SNS topic, and select the SNS topic that includes your-stack-name-SMSInboundMsgStreamingTopic from the list
- Choose Save
Configure Amazon Connect
- Log into your Amazon Connect instance administration console
- Navigate to Phone Numbers in the Channels category
- Assign a number to the Contact Flow named ‘SmsBlogContactFlow’
To test this solution:
- Call the phone number you assigned to the Contact Flow from a mobile phone
- While the Contact Flow greeting plays, you will receive an SMS to your mobile phone
- Reply to the SMS with an alphanumeric identifier. You will receive a confirmation SMS with the input you replied with.
- Press any key when prompted by the Contact Flow. The Contact Flow will play the received alphanumeric code back for confirmation.
To avoid incurring future charges:
- Remove the phone number from the SmsBlogContactFlow
- Delete the CloudFormation stack that you created
- Remove the Amazon Pinpoint number that you claimed
Complex inputs such as email addresses and alphanumerichave traditionally been challenging to to accurately detect over low fidelity telephone networks. In this blog, we learned how to use Amazon Lex, Amazon Pinpoint, and Amazon SNS to enable Amazon Connect Contact Flows to send and receive SMS messages to collect complex input accurately in a way that is easy to use for customers. This will allow you to produce powerful self-service functions, increasing call deflection rates for your contact center and simplifying the customer experience for your customers. Contact us to learn more.
Join us for AWS Contact Center Day, a free virtual event where you’ll learn about the future of customer service, how machine learning can optimize customer and agent experiences—and more. Register now »
|Greg Thomas is a Solutions Architect for Amazon Connect at AWS. He is part of the Scaling Solutions Architect team and helps organizations remove roadblocks to operating customer engagement workloads at scale. In his spare time, you can find him at football games, reading, and spending time with wife and children.|
|Naveen Narayan is a Senior Specialist Solutions Architect at AWS. He helps customer achieve their desired business outcomes in the Contact Center space leveraging Amazon Connect.|