AWS Contact Center

Amazon Connect Contact Flow Resume After Transfer

In this article, I’ll show you a few interesting things you can now do in Amazon Connect using the Transfer to phone number block in a contact flow. The block was upgraded with new capabilities on February 19th, 2019. The new features include the ability to resume a contact flow after a 3rd party transfer is completed, to specify a specific caller ID, and to send DTMF tones along with the transfer. To demonstrate the new capabilities, I’ll create a contact flow for an online retailer that lets customers call in and get information about the orders they placed, and then get follow up information from the shipping carrier. I’ll cover the following three scenarios to demonstrate this:

  • Scenario 1: Look up a customer’s order by ID in a database, and transfer them to the
    correct carrier for more information about their shipment
  • Scenario 2: After the call with the carrier ends, ask the customer whether their problem
    is solved, if not, route them to an agent
  • Scenario 3: When the call is transferred to the carrier, automatically interact with the carrier’s IVR system to send DTMF tones with the tracking number to provide the tracking number to the carrier’s automated system

Getting Started

If you want to try this out in your own Amazon Connect instance, you’ll need the following:

  • An active AWS account
  • An Amazon Connect instance in which you have claimed a phone number
  • Access to the following AWS services:
    • AWS Lambda
    • Amazon DynamoDB

Setting up the Solution

Scenario 1: Simple order look up and transfer to a carrier

In my solution, I created a simple order look up system that uses an AWS Lambda function to look up order information from an Amazon DynamoDB table. My customers can call the phone number assigned to my Amazon Connect instance, and are prompted to enter their order number when the call is answered.

I created a simple Amazon Connect contact flow that takes the order number the customer enters, and invokes the Lambda function for the simple order system to look up that order number in my order database in Amazon DynamoDB. Using the data retrieved from the DynamoDB table, I create a message in a text-to-speech block that tells the customer whether their package has shipped, the estimated delivery date, and which carrier it shipped with. The customer is then presented with an option to be transferred to the that carrier to get more information. If they choose Yes by pressing 1, they are transferred and the contact flow ends.

First, I will build the Amazon Connect contact flow:

You can see in the Amazon Connect contact flow how a caller is asked for their order number in the Store customer input block, which is then used by the Lambda function to look up the order number in our DynamoDB table:

Once the values are retrieved, I can now use all of the returned values in my contact flow, and speak the values of the attributes back to the customer using a Play prompt block, with text-to-speech powered by Amazon Polly:

Welcome back $.External.firstName $.External.lastName! Your order was shipped $.External.shippedDate with $.External.carrier, and is expected to arrive $.External.estimatedArrival. The tracking number is $.External.trackingNumber

If the order number is not found in the database, I simply take the error branch of the Invoke AWS Lambda function block. When this happens, I use a Play prompt block and to tell the customer that the “Order number not found”, and give them an option to try again. Finally, I give the customer an option to ask for more information from the carrier:

Would you like to get more information about this package from $.External.carrier? Press 1 for yes, or 2 to end this call.

If they press 1 for Yes, I automatically transfer the call to the correct carrier based on the
value I looked up in DynamoDB earlier.

Scenario 2: Resuming the contact flow after transfer.

In this scenario, I return the customer to the Amazon Connect contact flow, in this case to for a post-call survey. I use the survey to make sure that the carrier resolved their issue, and if not, connect the customer to an agent for additional assistance.

From the previous scenario, I now have a simple order look up system and a contact flow that can transfer the customer to a carrier. But what if the carrier doesn’t solve the problem for the customer? To make sure my customer’s issue is successfully resolved without them having to call in again, I can configure the Transfer to Phone Number block to resume the contact flow from which the customer was transferred. When the
conversation with the shipping carrier is completed, the customer is returned to Amazon Connect and the contact flow resumes after the Transfer to phone number block.

When I select Yes to Resume contact flow after disconnect, new options are added to the block that let you branch based on:

  • Success – the call was successfully transferred to the 3rd party and will continue
    down this path when the 3rd party disconnects
  • Call Failed – the call was not successfully transferred to the 3rd party (eg: The
    number is disconnected)
  • Timeout – the call tried to connect for the number of seconds you specify and didn’t
    connect

Using these new options, I can specify actions to take when those scenarios happen while the customer is still on the line. In this case, if the carrier didn’t resolve the issue for the customer, or the call did not complete successfully, I offer to let them speak to an agent.

You can see in the updated contact flow how I check whether the carrier solved the problem in the Get customer input block. If the issue is resolved, I ask them to fill out a post-call survey in the Store customer input block. If the carrier did not resolve the issue, I use a Transfer to queue block, which places the caller in a queue for an agent.

Scenario 3: Automatically interact with the carrier’s IVR system and send DTMF tones with the tracking number

Continuing to extend my solution, I want to transfer the customer to the carrier, but not make them enter their order number again. Since I know the tracking number, I can build an integration on top of the carrier’s order look up system, and then send DTMF tones on the customer’s behalf. When the customer is connected to the carrier, their tracking number has already been entered and the tracking information is retrieved and ready to provide to the customer.

To do this, I added DTMF tones in our Transfer to phone number block. Using additional DTMF characters that are recognized by the carrier’s IVR order lookup system, such as using commas for pause, I can provide the correct values to the automated system. In my example, I used an AWS Lambda function to create the correct sequence of numbers and commas to interact with the carrier’s system, and saved that string as an attribute named “CarrierNumberWithTracking”. The attribute looks something like this when formatted: “18001234567,,,1,,,1,,,12345”.

This example assumes that the automated system requests that you press 1 twice to get to the menu where you enter the tracking number (12345). The customer doesn’t hear any of the DTMF tones or pauses, and is magically connected to the carrier with the tracking number already provided as though the customer had entered it.

Try It Out

Feel free to give try out the demo I built for this article by calling: 1-203-689-7523. You can try order numbers 1111, 2222, or 3333. In my example, I don’t connect the call to carriers (since I don’t have real tracking numbers), and instead just play a prompt to simulate how it would be connected. This whole demo took me less than an hour to build, and hopefully highlights some of the simple and powerful experiences you can create with Amazon Connect. I found that I could easily automate one of the most common questions a business might have so that agents can focus on the tougher problems. I hope these scenarios inspire you to build more cool automated scenarios for your business!