How to Build a Customer Contact Center in the Cloud Fast and Easy?

27 Apr, 2020 | 7 minutes read

Contact centers, in many cases, are the first point of contact for many organizations. Customer service organization aims to deliver an exceptional level of services to all customers supporting them 24/7. At the low end, call centers simply route incoming calls to any available agent. More sophisticated systems support more sophisticated routing and interaction, including the ability to create customized call trees and other Integrated Voice Response (IVR) systems. Traditionally, IVR systems have been difficult to install and expensive to license, with capacity-based pricing the norm. Many years ago, Amazon retail was facing the same problem, so they built up a solution today known as Amazon Connect.

Amazon Connect is a contact center that would give personal, dynamic, and natural experiences to your customers. It is an omnichannel cloud contact center that provides a seamless experience across voice and chat for your customers and agents.

In this blog post, we are going to show how to create one Amazon Connect contact center in minutes and then design a contact flow (similar to IVRs).

Setting Up Amazon Instance

The first thing that you should do is create an Amazon Connect instance. You can find a detailed step-by-step explanation in the official AWS documentation:

https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-instances.html

Following the wizard for instance configuration, you can set up your call center phone(s) number. I’ve chosen the Toll-Free number option.

Once you have set this up, you are ready to take your first call. I call the number on my Viber Out (it is free due to a Toll-free number although my location is North Macedonia, Europe) and go through the default options. I choose to speak to an agent, and the softphone offers to let me (playing the role of the agent) take the call:

Contact flow

Explore the dashboard. In the dashboard, you can find out that the number associated with your call center is related to a contact flow. A contact flow defines the customer experience after they make contact. This is the custom flow that we are going to create:

Contact flow

When a customer calls our call center, we will play a welcome message with 3 options:

  1. If the customer wants to make changes in receiving a paper bill
  2. If the customer wants to check account balance
  3. If the customer wants to talk to an agent

We will start from the bottom to build this solution. First, we are going to create a Lambda function that will handle the status of the paper bill, then we are going to create one Lex bot and connect one of the intents to our Lambda function. Lastly, we are going to register and use the Lex bot in our custom Contact flow.

Lambda function

I’m going to create a Node.js 12.x Lambda function with the following sample code:

exports.handler = async (event) => {
   var paperBill = event.currentIntent.slots.receivePaperBill;
   var responseOption = “Something went wrong”;
   if(paperBill == ‘One’)
   {
        responseOption = “You will receive your paper bills in future.”;   }
   else
   {
       responseOption = “You will not receive any paper bills in future.”;   }
    let lambda_response = {    
   “sessionAttributes”: {
      “paperBill”:  event.currentIntent.slots.receivePaperBill
    },  
    “dialogAction”: {    
        “type”: “Close”,
        “fulfillmentState”: “Fulfilled”,
        “message”: {      
           “contentType”: “PlainText”,
           “content”: responseOption
        },   
     }
    }
    return lambda_response;
};

Lambda_response has the proper format that Lex can interpret. You can test your Lambda function using the following test event (Lex will send the same structured event to the Lambda function in an integrated scenario):

{
“messageVersion”: “1.0”,
“invocationSource”: “DialogCodeHook”,
“userId”: “259-45236-458563-4521”,
“sessionAttributes”: {},
“bot”: {
“name”: “CC_WelcomeOptions”,
“alias”: “$LATEST”,
“version”: “$LATEST”
},
“outputDialogMode”: “Text”,
“currentIntent”: {
“name”: “PaperBill”,
“slots”: {
“receivePaperBill”: “One”
},
“confirmationStatus”: “None”
}
}

As a response, you should see the following message:

{
  “sessionAttributes”: {
    “paperBill”: “One”
  },
  “dialogAction”: {
    “type”: “Close”,
    “fulfillmentState”: “Fulfilled”,
    “message”: {
      “contentType”: “PlainText”,
      “content”: “You will receive your paper bills in future.”
    }
  }
}

If everything is working on the Lambda site, you are ready to set up the Lex bot.

Amazon Lex

Amazon Lex is a service for building conversational interfaces into any application using voice and text. Amazon Lex provides the advanced deep learning functionalities of automatic speech recognition (ASR) for converting speech to text, and natural language understanding (NLU) to recognize the intent of the text, to enable you to build applications with highly engaging user experiences and lifelike conversational interactions. You can find more info about Lex here: https://aws.amazon.com/lex/

Here is the bot blueprint that we are going to create:

Slot type:

  • ReceivePaperBill
    • One – yes, continue sending a paper bill
    • Two – no, stop sending a paper bill

Intent1: PaperBill

  • Utterances
    • One
    • Change paper bill reception
  • Slots
    – receivePaperBill of custom type ReceivePaperBill and the prompt text “If you want to receive paper bill press one. If you do not want to receive a paper bill press two.”

    NOTE: The name of the slot must be the same name that you’ve already used in Lambda function code event.currentIntent.slots.receivePaperBill
  • Under the Fulfillment section select AWS Lambda function and choose your Lambda function from the dropdown menu. You’re done with the first intent.

Intent2: AccountBalance

  • Utterances
    • Two
    • Check my account balance
  • Slots
    – AccountNumber of build-in type AMAZON.NUMBER and the prompt text “Using your touch-tone keypad, please enter your account number”
  • Under the Response section add the message “The balance for your account is $2,586.34.”

Of course, you can connect to the Lambda function that will read the balance from the database, following the scenario for the intent PaperBill.

Intent3: TalkToAgent

  • Utterances
    • Three
    • Speak to an agent
  • Under the response section add the message “An agent will be with you shortly.”

Now you are ready to Build and test your Lex bot. In the Test bot section insert one utterance and you should be prompted with the text for the related utterance. You can Publish your Lex bot.

Amazon Connect – Contact flow

Go back to your Amazon Connect in the AWS console and select the active instance that you’ve created. Under Contact flows from the menu, register your Lex bot in the section Amazon Lex.

Now, navigate to the Administration panel of your Amazon Connect. This panel is available in your browser and accessible on the link that you’ve created in the Amazon Connect configuration step. You can find it under the Overview section of the menu.

Or contact us to discuss the possibilities of enhancing your call center.