In this module you will integrate your Amazon Lex bot with Amazon Connect, a service that allows you to create software-defined call centers in minutes.
Upon completion, you will be able to interact with your bot using a telephone (yes, think PSTN). To achieve this you will create a contact center, configure a simple call flow, and assign a phone number to the flow.
Each of the following sections provide an implementation overview and detailed, step-by-step instructions. The overview should provide enough context for you to complete the implementation if you're already familiar with the AWS Management Console or if you want to explore the services yourself without following a walkthrough.
Go to the Amazon Connect Console to create a new virtual contact center instance in the us-east-1 (Virgina) region.
Step-by-step instructions (expand for details)
-
From the AWS Management Console, choose Services then select Amazon Connect under Contact Center and then Get started
-
In Step 1: Identity management, select Store users within Amazon Connect and provide a domain name (e.g.
{FirstName}
to complete the Access URL and click Next stepThe domain name used in your contact center URL needs to be globally unique and cannot be changed. Alternatively, Amazon Connect can use an existing AWS Directory Services directory.
-
In Step 2: Administrator, Skip this and continue with Next step
-
In Step 3: Telephony options, select I want to handle incoming calls with Amazon Connect and I want to make outbound calls with Amazon Connect
-
In Step 4: Data storage, accept the defaults
-
In Step 5: Review and create, review your settings and then select Create Instance
Once your Amazon Connect instance has been created, click Get started to select a phone number.
Step-by-step instructions (expand for details)
-
Select Get started to open the Amazon Connect Contact Center Manager (CCM) welcome screen
-
Select Let's go to claim a phone number
-
Select United States +1, Direct Dial, and choose a phone number from the numbers provided
-
Dial the phone number you selected in step 3 from another phone (e.g. your mobile phone) and choose 1 from the voice menu to connect with an agent; you can then use the Amazon Connect Contact Control Panel to accept the call
It may take a few minutes before the claimed phone number is active.
-
Choose Continue to get to the Amazon Connect Contact Center Manager App (CCM); poke around a bit to see what's available
If you accepted a call, it should show up under the Contact search option.
With a Connect instance and a phone number, you can now create the Contact Flow that allows callers to interact with our bot in Module 1.
Step-by-step instructions (expand for details)
-
In the Amazon Connect Console, select your instance, then choose Contact Flows to allow Amazon Connect to interact with the
InternationalPlan
bot -
In the Amazon Connect Contact Center Manager, use the navigation pane on the left hand side to select Routing and then Contact flows
If you closed your browser window you can always re-open the Amazon Connect Contact Center Manager from the Amazon Connect console. Just selct your Amazon connect instance and click on the Login as administrator button in the Overview section of the console.
-
In the top right corner select Create contact flow to open the contact flow editor
-
Name your contact flow
CustomerServiceChatbot
-
Expand the Interact group of blocks and drag and drop the Get customer input block onto the grid
-
Expand the Terminate / Transfer group of blocks and drag and drop the Disconnect / Hang up block onto the grid
-
Wire up the three building blocks as shown in the image below
-
Double click on the Get customer input block to access its configuration
-
Click on the down arrow (
) next to the Save button at the top right and select Save & Publish
-
Wait for the contact flow to be published successfully
Now you need to associate your new contact flow with your phone number
Step-by-step instructions (expand for details)
-
Select Routing and Phone Numbers on the left hand Amazon Connect navigation pane
-
Click on the number to edit the contact flow
-
Search and select the
CustomerServiceChatbot
contact flow in the Contact flow/IVR field -
Select Save to confirm the contact flow association
Dial your Amazon Connect contact center phone number to confirm functionality of contact flow and Amazon Lex integration. Tell the virtual service agent "I'm going to China."; use 1234 when asked for your pin code.
In this last step we are enhancing the customer input configuration of the contact flow to make the caller's phone number available to the bot.
Step-by-step instructions (expand for details)
-
Re-open the CCM app; within the Amazon Connect console select Overview and Login as administrator
-
On the left hand navigation select Routing - Contact flows
-
Click the
CustomerServiceChatbot
flow to open the flow -
Click the Get customer input block to access its configuration
-
Scroll to the bottom and under Session attributes click Add an attribute
-
Select Use attribute
-
In the Type drop-down, select System, enter
IncomingNumber
in the Destination Key field and select Customer Number from the Attribute drop down -
Click Add another attribute
-
Enter
Source
as Destination Key andAmazonConnect
as Value -
Select Save
-
Click on the down arrow (
) next to the save button and select Save & Publish
-
Confirm publishing of the workflow in selecting the Save & publish button
Call your Amazon Connect phone number to interact with your bot over the phone. Ask the virtual service agent "What international plans do you have?". When asked for your pin code enter the last four digits of the phone number you are calling from.