Cloud Contact Center Implementation Guide

Leverage Amazon Connect Contact Center usage based pricing model to save a bundle. No more long term contracts, no per agent / seat pricing.

Introduction To Amazon Connect Contact Center

Small and medium businesses can save a bundle (sometimes, up to 80%) by moving their customer support to Amazon Connect Contact Center. 

It’s not just about saving money. It’s also to be able to support customers without having to hire a whole lot of people. 

COVID will be over one day – this is the time to retain your customers. You worked hard on getting these customers in the first place.

How do you save on communications operational costs?

The best way to do so is to set up a centralized customer contact center. Traditionally this has been an expensive proposition for most small and medium-sized businesses.

No more.

Amazon Connect contact center has changed the game entirely (as usual, for Amazon). They have made the SAME technology that powers their own retail business, available to everyone.

Our customer contact center teams have been using Amazon Connect for a while now and we have been helping small and medium-sized enterprises see the same benefits as well.

What is this Amazon Connect?

Think of it as a multi channel, cloud based, customer support software. You have no software to install, no hardware headaches to manage, no phone companies to deal with. For most small and medium-sized businesses, we can even get you up and running within 1 week!

All your customer service folks would need are a computer and a headset – that’s it. They can work from your office, home, anywhere in the world.

What do I use Amazon Connect for?

As of now, out of the box, Amazon connect helps you connect with and support customers via web chat, Apple business and over the phone.

However, we help you talk to customers using text messaging, Whatsapp and other communications channels as well (something that Amazon does not support out of the box).

So, you can support customers via web chat, phone calls, text messages, whatsapp and whatever other channels you want to support.

Is Amazon Connect only for incoming inquiries?

Nope. Amazon Connect does not limit you to just receiving calls. You can make as many outbound calls as you want as well.

Their pricing is very competitive and usually lower than anyone else in the business. 

On top of that, unlike other phone companies, they only charge you when you make or receive calls.

Yes, Web chat is only for inbound inquiries 🙂

What happens to our current company number?

If you want, you can keep your phone number and only make outbound calls from Amazon Connect. 

You can buy as many outbound numbers as you want (from Amazon). They are dirt cheap. Once you have used it, you can also cancel these numbers if you want.

We usually recommend porting your office number(s) to Amazon Connect to save even more money. This way, all your inbound calls will also be answered by Amazon connect.

Porting takes about 7-10 days and is totally seamless. Your customers won’t know anything.

How about our phone greeting, phone tree etc?

It is incredibly easy for us to set up your phone greeting and your phone tree using Amazon Connect. There are two options – using Amazon’s text to speech option (it’s world class – really) OR by using your custom recorded greeting (these are just audio files that we will ask from you). 

With text to speech, you just tell us what you want your greeting to say. Amazon does a very natural sounding sound for the text you provide.

You can create your dial by name directory, dial by business function or however else you choose to set up your phone tree.

For each phone tree option, you can even have custom voice prompts. 

Same concept applies here – either TTS (text to speech) or your own custom recordings (e.g. mp3 sound files).

Does Amazon connect help me record calls for training purposes?

Yup! With just a few clicks, all calls can be recorded. You can choose to record only the customer, your customer service representative or BOTH. We always prefer to record both.

These call recordings can even be transcribed by the power of Amazon Web Services (Amazon Transcribe, actually) and be sent via email if you’d like.

How about sensitive information? Are they stored in the cloud?

Amazon redacts sensitive information as well. We can help you set that up.

Essentially, you can tell Amazon what you want saved and what you want redacted (sensitive information).

If you are a healthcare customer, please keep in mind that the redacted call recordings are not 100% HIPAA compliant.

Can Amazon Connect help me make my customers happy?

No, only you and your employees can do that 🙂

However, Amazon Connect can certainly help you understand the sentiment of the caller when they are on the phone with your staff. 

Amazon connect has something called Contact Lens that helps you measure and understand the sentiment of the caller and your agent over the duration of the call.

How about supporting multiple languages?

Yup – Amazon is world class in that (as you already know). Behind the scenes, Amazon Connect uses something called Amazon Polly and it supports all kinds of languages. English, Chinese (Simplified), Chinese (Traditional), French, German, Italian, Japanese, Korean, Portuguese (Brazilian), Spanish – no sweat!

Don’t see your language? Amazon keeps adding language support regularly.

What else can Amazon Connect do for me?

Below are several things that Amazon can help you achieve. Feel free to go through these guides. There are more ideas in our resource center for Amazon Connect as well.

Can Amazon Connect contact center connect to my CRM?

Of course! That’s one of the amazing things about Amazon connect. Once you start using Amazon connect – you can connect it to your CRM, your EMR, your help desk ticketing system. Anything you want.

How does Amazon Connect help me reduce costs even further?

You can repurpose your support staff for more complex interactions. 

Nisos Health and Amazon can help you service more of your customers or staff with self-service options.

When you allow self service options, you free up your customer service agents to handle more complex customer requests.

You also free up customer service agents to make more outbound phone calls (for various purposes).

You help them connect with more customers and generate more business for your business. 

That’s the power that Amazon Connect cloud software brings to you.

What can Nisos Health do for me?

We will get you and your team set up to leverage the power of Amazon Customer Engagement solutions.

We will configure up to four roles/profiles and onboard up to 25 contact center agents.

We will build up to four interactive voice response (IVR) contact flows. These contact flows may or may not include Amazon Lex natural language capability depending on what we discover during our initial calls.

We will train you on the out of the box Contact Center Panel (CCP), reporting and will set up skills-based routing for up to three skills of your agents.

We will integrate with up to two API calls for data dips from external systems.

We will do CTI (computer telephony integration) configuration for automatic number identification (ANI)-based screen pop with either Salesforce or Microsoft Dynamics (your choice).

How to move your agents to Amazon Connect cloud contact center

Amazon Connect Contact Center is a pretty amazing product to begin with. As is typical with Amazon you get reliability, robustness and the cloud’s scalability as soon as you sign up.

All your front desk / receptionist / call center agents need are:

  1. A computer
  2. Good internet connectivity
  3. A headset

That’s it – they can work from anywhere and still provide excellent customer service.

For many small businesses, the needs are pretty simple. Here’s all you really need to do.

  1. Sign up for Amazon Connect Contact Center
  2. Choose a URL that you will remember (you will distribute this to your agents)
  3. Set up your phone line (one) and set up inbound/outbound calls (telephony options)
  4. Choose the default settings for data storage, Review and then Create Instance
  5. Set up your business hours
  6. Create an administrator
  7. Allow one or more of your customer service reps to handle inbound and outbound calls. When callers call your main phone number, they will be put in a queue so that your CSRs can respond to the call if they are not on another call / away OR they can respond as soon as they become available.
  8. Set up your greeting and the first contact flow
  9. Add your staff. You can add your staff one by one or if you have a large number of staff, you can add them all by uploading a spreadsheet. It’s very simple.
  10. Port your main phone number to AWS and begin servicing customers

That’s it.

How to move your contact center IVR to the cloud

These days we have to meet customers where they are. We have to serve patients in their languages, otherwise they will find providers that service them in their own language. We’ve always managed practices with multiple locations hence have had to support multiple languages. As an example, one of the practices we first started managing had locations in South Bronx, Jamaica, Jackson Heights. Arguably, we needed to support Spanish, Bengali, Hindi and English right off the bat. For Jackson Heights, we also seemed to have a significant Mandarin speaking population. This gave birth to quite an interesting IVR mix.

Here’s an example from one of the medical practices we manage:

  • When a caller calls the main number, they are first given a language option. Press 1 for English, 2 for Spanish, 3 for Bengali, 4 for Hindi.
  • Once the caller chooses a language, the same options are presented in different languages.
  • After the choice of language, the callers are asked to choose a business function. Press 1 for appointments, 2 for pharmacy, 3 for surgeries, 4 for billing.

Traditionally, the way to handle this was to record the greetings by recording artists (time consuming and expensive) in multiple languages and also to copy the same contact flow across multiple languages / versions.

With Amazon Connect contact center, this problem is solved very easily, we can support multilingual voice experiences very easily. There’s more detail in this blog “Build multilingual voice experiences in Amazon Connect “.

The steps to achieve this are as follows:

  1. Create a DynamoDB table that stores the message group and the messages you want played. E.g. “Situational” or “Static” message groups and then, you can have “”MsgId”: “EmergencyMessage” and “MsgText”: {“en-US”: “<speak>Due to storms in the north east, services in several states have been affected. We are working to restore at the earliest.</speak>”,”es-US”: “<speak>Debido a las tormentas en el noreste, los servicios en varios estados se han visto afectados. Estamos trabajando para restaurar lo antes posible.</speak>”}. You can add as many languages as you want, here.
  2. Create a lambda function that will fetch these detailed messages on demand from the DynamoDB table.
  3. Populate the DynamoDB table with these messages.
  4. Update your inbound IVR contact flow where the caller chooses the language they prefer. Set the language to be whatever the caller chose .. e.g. en-US, es-US etc.. That’s it. Try it out. Amazon’s Polly’s pronunciation is SUPER AWESOME!

How to set up outbound caller ID / CNAM in Amazon Connect

For this, we ended up using TrueCNAM as it was the fastest and the easiest to do. Head over to https://www.truecnam.com/. Create an account, upload your phone numbers (yes, all of them), add your caller name (short and long) and submit them. There’s a verification process and you are done.

It takes a bit of time for this to propagate and just like with the rest of the CNAM services, there’s never a 100% guarantee that this will ever be honored.

How to set up caller ID reputation for your outbound numbers

Hopefully you are doing lots of outbound calling – that’s one reason to use Amazon Connect Contact center. We recommend that you do NOT dial more than 180 or so calls per number per day. Carriers do not look kindly at more than 180-200 calls per day per number. In any case, you always want to monitor the caller ID reputation of your numbers.

Why?

Because these days, phone companies are being quite diligent about marking / suggesting calls as “SCAM LIKELY”. iPhone users even have a function on their phone that sends Unknown callers straight to voicemail. We recommend that you check twice a day. For this, you can sign up with everyoneapi.com or you can use trueCNAM.com again. Either way, you will get the SPAMScore of your own numbers. As soon as you see your phone number showing up higher in spam scores, you need to “release” the number in Amazon Connect Contact center and get another number to do outbound calling.

How to reduce SPAM calls to your Amazon Connect contact center

Your contact center is invariably going to get spam calls / robocalls. Here’s how to reduce SPAM calls to your Amazon Connect contact center. This is a whole lot easier if you use a healthcare CRM and an automated communication solution like ours.

Modify the contact flow that your company number is associated with to include a dead simple AWS lambda call. Based on the result of the Lambda call, you will simply drop the call or add the caller ID to your own robo caller list (deny list) or let the call through.

Get an account on everyoneapi or trueCNAM.

EveryoneAPI gives you caller data (phone intelligence). It’s pretty affordable and does give a decent amount of intelligence about phone numbers. For the purposes of this article, let’s concentrate on the variable called nuisance_scrore  (this is something that EveryoneAPI returns when you use their API.It’s a score from 0-100 and the higher the number, the more chance there is that it is a robocall / scam likely. 

Either way – TrueCNAM or EveryoneAPI… follow these steps

  1. Set up your lambda function
  2. Call everyoneAPI or trueCNAM and get the spam score
  3. Connect your lambda function to your Amazon connect instance
  4. All you have to do is to make sure that your connect instance can use the lambda function. 
  5. Then, head over to the contact flow, add an “Invoke AWS Lambda function” node to your contact flow, call the function you created above
  6. Based on the result of the Lambda call, you can decide to simply drop the call or add the caller ID to your own robo caller list (deny list) OR let the call through.

How to append caller identity to calls

We recommend that you tie in your EMR or practice management system to Amazon Connect Contact Center via AWS Lambda. However, if you do not, and you still want to see some level of caller data, you can do so by using services like EveryoneAPI. Sometimes, despite the fact that you have tied in your EMR to Amazon Connect, you will have new patients calling in to make appointments and you will not have their contact information in your datastores. Even in this case, it is great to have some level of patient information.

Finally, it is ALWAYS recommended to have this level of information available and handy for patient identity verification sake. Imagine a patient claiming to be “Daniel Radcliffe” when the phone clearly belongs to “John Johnson”. While you cannot (of course) tell the patient that “Sorry sir, but I don’t think you are Daniel Radclife”, you can be on high alert to ensure that the patient’s ID cards match (to ensure protecting yourself from patient identity fraud).

So, how do you do this?

This one is going to be VERY similar to what you did with stopping robocalls.

Here’s what you are going to do to append caller data. Use EveryoneAPI to identify callers.

Set up a lambda function to call EveryoneAPI and get caller details

Modify the contact flow that your company number is associated with to include a dead simple AWS lambda call. Based on the result of the Lambda call, you can append caller information and help your contact center. It gives you a LOT of information – granted it is not always correct, but it is a heck lot better than flying blind. Connect your lambda function to your Amazon connect instance. All you have to do is to make sure that your connect instance can use the lambda function. This lambda function of yours is probably going to return some key and value pair like this:

{
"first": "xxxxxx",
"last": "xxxxx",
"address": "319 xxxxx St Apt xxx",
"estimatedIncome": "B",
"lengthOfResidence": "4",
"maritalStatus": "S",
"gender": "M",
"city": "Brooklyn",
"state": "NY",
"zip": "11211",
"country": "US",
"timezone": "EDT",
"linetype": "mobile",
"linetype_enhanced": "mobile",
"nuisance_score":
}

You can use all these values in your contact flow, and subsequently you have all this data in the softphone. Add some simple code to your customized CCP that agents use. You just need the aws-connect.min.js and your customized static HTML. That’s it – go ahead and try it out!

And, you are going to create a screen popup.. So, when a call comes into your call center, all you have to do is to call the lambda function in your contact flow, use the variables that you set with the SetContactAttribute for the contact that’s calling and display those.

That’s it. 

Keep the following methods in mind and customize as per your agents need.

  • contact.onIncoming(function(contact) {//add code });
  • contact.onRefresh(function(contact) {//add code});
  • contact.onAccepted(function(contact) {//add code});
  • contact.onEnded(function() {//add code});
  • contact.onConnected(function() {//add code})

Extensions vs direct inward dial numbers

When you use Amazon Connect, you are going to need to be logged in to the browser or are going to need to forward your calls to a desk phone number (costlier, because in this case Amazon Connect calls your desk phone so you are paying for that call as well).

If you set up Amazon Connect Contact center software IVR to allow dial by extension to reach your agents and the agents are not logged in, it’s not that useful.

Same concept with direct inward dial numbers – you need to be using the browser/softphone. If your agents are not logged in, it’s not that useful.

However, both these cases do help satisfy customer expectations. Let’s say a customer calls and wants to talk to someone in sales – this allows you to dial by “queue” and place the call in the “sale” queue. Or if the customer wants to talk to someone they had talked to before, called “Robert”, they can “dial by name” and find Robert, talk to them. Or, if the customer knows the extension of the party they are calling, they can “dial by extension” and reach the person they are dialing. Or, if a customer calls the DID (direct inward dial) number of the person they want to talk to, that call can go directly to the agent / person they are calling / want to talk to in Amazon Connect Call center software itself. 

Keep in mind that Amazon Connect does NOT let you send SMS / text messages from the Amazon Connect number itself. So, if that’s something you want, then you would have to use a solution like Amazon Chime. If you use Amazon Chime, you get a mobile app, chat, video calls, can make calls, SMS from the same phone number, voicemail etc. Anyone calling your number directly will reach you directly (will not go through the IVR). However if someone tries to dial you by “extension” or by “name” that can still be achieved by simply forwarding the call to your DID number from Amazon Connect to your Amazon Chime number.

How to allow dial by employee extension or name in Amazon Connect

You are invariably going to need a company directory. Keep in mind that your company set up is going to be:

  1. Some folks are going to make a LOT of outbound calls. These people will need disposable numbers to make outbound calls. These people will need either direct inward dial numbers or extensions set up to receive calls.
  2. Some folks are going to answer a lot of inbound calls. These people are going to need calls routed to them from the company inbound numbers – IVR. These folks are also going to have personal, direct calls that are meant to be directed to them. These people will need either direct inward dial numbers or extensions set up to receive calls.

So, all you have to do is 

  1. Create a DynamoDB table. This will store the mapping of employee extension, name, employee ID, fall-back queue (in case the agent the user is trying to reach is not logged in), employee’s cell phone number. You can also add another column to determine if this person has voicemail set up or not (to route the call to voicemail).
  2. Update the contact flow that handles all incoming calls and present the caller with an option to “dial by extension” or “Dial by name”. Here, store the extension number as an input from the caller. OR, if the caller chooses “dial by name”, store the name as an input from the caller.
  3. Create a Lambda function that accepts the input, extracts the value passed in the event data by Amazon Connect. After that, it does a lookup in DynamoDB to retrieve the employee ID and fallback queue, to which the call can be transferred if the employee is not logged in. If the caller is looking up by employee name, do keep in mind that the caller is inputting numbers in their keypad, so you are going to have to map the numbers back to letters/characters and have that same logic mapped to do the search/map back when you do the lookup in DynamoDB for the agent name. This is not as straightforward as it is in the case of agent extension.
  4. Use / attach this Lambda function in the contact flow attached to your IVR.

How to configure voicemails for employees in Amazon Connect

This is a very well documented solution that Amazon Connect architects have already created. You can find it here. With this solution, you can enable SMS and/or email delivery of voicemail messages. Your employees can get voicemails via SMS messages with embedded playback links, email messages with attachments, or both. The solution will also do voicemail transcription based on Amazon Transcribe. Plus, if you allow it, you get a visual interface for administration of voicemail users and settings. A typical 60-second voicemail costs $0.035, with no other fees or charges for using the solution. 

How to auto dial your patients from Amazon Connect

This is a whole lot easier if you use a healthcare CRM and an automated communication solution like ours. There are several kinds of autodialing that hospital call centers perform. We will look into each mode.

Autodialing patient numbers

This is the simplest case where hospital call centers are automating the manual task of punching in the phone numbers. That’s about it. The automation simply takes care of dialing the phone number and if the dialed phone number is a valid number, the call gets connected and everything proceeds as usual. This is covered in some detail here Automating outbound calling to customers using Amazon Connect | Amazon Web Services. We have used this ourselves for automated appointment reminders, follow-up calls for patient no-shows, calls to schedule appointments with no show patients or patients that cancelled their appointments or patients that have fallen out of care, a first-time contact initiated from an online one-click call button or “contact us form”, or our community outreach cold calls as well.

This allows you to leave a voicemail if the person does not pick up the call. If the person does pick up the call, then Amazon Connect can automatically relay a very customized appointment reminder to them. E.g. “Hi John,. Your appointment is on Monday August 30th at 10:30 a. If you need to reschedule the appointment, please press 1. We look forward to seeing you on Monday August 30th at 10:30 a. Thank you and have a great day!”

Amazon Connect makes it incredibly easy to create a contact flow that helps you achieve this.

Head over to the Contact Flows section and create a new Contact Flow. All you need is to set a working queue (which you have already done when you set up the IVR). Then, you add a “Get Customer Input”. Here, you are basically relaying the information you get from $.Attributes (you will pass that from another program).

Use SSML for this instead of using text to speech. E.g.

<speak>Hi $.Attributes.Name. Your appointment is on $.Attributes.DateTimeText. We look forward to seeing you on $.Attributes.DateTimeText. Thank you and have a great day!</speak>

Here, you are passing $.Attributes.Name and $.Attributes.DateTimeText from the script you write. Here’s a simple, sample script to use. You are going to get these things from your AWS instance

  • ContactFlowId=’xxx ‘, (you will find that in the URL of the contact flow itself
  • InstanceId=’xxxx, (you will find that in the URL of the contact flow itself
  • QueueId=’xxxx’,  (you will find that in the URL of the queue itself,
import boto3
import sys
 import getopt
 def main(argv):
     phoneNumber = ''
     name = ''
     dateTimeText = ''
     try:
         opts, args = getopt.getopt(argv, "hp:m:d:", ["phone=", "name=", "dateTimeText="])
     except getopt.GetoptError:
         print('call.py -p <phone_number_in_E.164_format> -m <callee_name> -d <date_time_in_text>')
         sys.exit(2)
     for opt, arg in opts:
         if opt == '-h':
             print('call.py -p <phone_number_in_E.164_format> -m <callee_name> -d <date_time_in_text>')
             sys.exit()
         elif opt in ("-p", "--phone"):
             phoneNumber = arg
         elif opt in ("-m", "--name"):
             name = arg
         elif opt in ("-d", "--dateTimeText"):
             dateTimeText = arg
     boto3.setup_default_session(profile_name='default')
     client = boto3.client('connect')
     response = client.start_outbound_voice_contact(
         DestinationPhoneNumber=phoneNumber,
         ContactFlowId='xxxx,
         InstanceId='xxxx',
         QueueId='xxxx',
         Attributes={
             'Name': name,
 'DateTimeText' : dateTimeText
         }
     )
 if __name__ == "__main__":
     main(sys.argv[1:]) 

That’s it. After this you can call the python script from the command line. 

The script calls AWS Contact flow that you just created, speaks the inputs to the person your agent called. Most importantly, if the called person wants to reschedule the appointment, they can press 1 and be placed in a queue to speak to your call center agent.

You can take this to a much more sophisticated level.

Let’s say that your agents are not using a CRM (which they really should – even if it is a no-frills PRM like ours). Instead, your agents are using a spreadsheet to dial numbers.

Here’s how you can drive more efficiency from your call center.

Enhance the script above to something like this

boto3.setup_default_session(profile_name='default')
client = boto3.client('connect')
with open('data.txt', newline='') as csv_file:
data = csv.reader(csv_file,delimiter=',')
for row in data:
 response = client.start_outbound_voice_contact(
  ContactFlowId='xxxx,
  InstanceId='xxxx',
  QueueId='xxxx',
  DestinationPhoneNumber=row[2],
  Attributes={
   'Name': row[0],
   'DateTimeText' : row[1]
  })

Ensure that your data.txt file has the following format (the +1 is super important)

  • Gregory, Monday August 31st at 8:30 AM,+11231231234
  • Donnie, Monday August 31st at 9 AM,+1231231235
  • Johnny, Monday August 31st at 9:30 AM,+1231231236
  • Mohammed, Monday August 31st at 10 AM,+1231231237
  • Asif, Monday August 31st at 10:30 AM,+1231231238

That’s it.. You will help your agents immensely by doing this. You could even create a google sheet function to dial automatically from your google sheet by simply clicking on a button on each google sheet row.

( Code from this post

Autodialing patient numbers, push 1 to talk to agents.

This is also very simple to do. All you need to do is to modify your script a little bit.

Use SSML for this instead of using text to speech. E.g.

<speak>Hi $.Attributes.Name. Your appointment is on $.Attributes.DateTimeText. If you need to reschedule the appointment, please press 1. We look forward to seeing you on $.Attributes.DateTimeText. Thank you and have a great day!</speak>

Then, in your contact flow, you will have to implement an interruptible flow and then use a “Customer input”. In that, we suggest that you accept ANY customer input instead of just 1 (because patients tend to enter any number, as per our experience) and based on that input, route them to a queue or a specific agent they should speak with.

Dynamically setting outbound numbers in Amazon Connect

We dial outbound a LOT. Amazon Connect Contact Center users do outbound calls a LOT. Meanwhile, patients tend to pick up calls from local numbers more than inbound calls from toll free numbers and from out of state numbers. The solution that most call centers use to work around this is to use local phone numbers in the areas they are dialing. 

So, if you are dialing in all 50 states of the USA, let’s assume that you are going to buy 50 numbers ($50 per month) or are going to “whitelist” 50 numbers with Amazon Web Services customer services department by opening a ticket. By whitelisting a number with carriers (through AWS customer support) you stand a chance that your number shows up on the called person’s phone as the caller ID. There’s no 100% guarantee, but it’s a bit better of a chance than showing up as UNKNOWN.

You will also need to follow the NANPA North American Numbering Plan Administrator: NANPA guidelines to look up area codes and where they belong. Keep in mind that each state has its own guidelines so your approval of Phone number “whitelisting” by carriers will be governed by that. 

This guide from AWS walks you through how to go about “Dynamically setting outbound numbers for contact centers with Amazon Connect | Amazon Web Services “. We have adopted this to our own approach wherein we take it one step further and also limit a few more things to avoid being marked as SCAM LIKELY by carriers and also to limit the total number of outbound calls per day per number to around 180/200.

The general idea to follow is this:

  1. Whitelist your phone numbers if they are not in Amazon Connect already.
  2. If you want to purchase phone numbers in Amazon Connect, go ahead (dirt cheap). This way you can rotate as many phone numbers as you want. We always advise overprovisioning phone numbers based on the number of agents you have (especially if you are limiting autodialing to only 200 per number per day).
  3. Create a DynamoDB that will hold all the phone numbers you have provisioned and the area code pools they belong in. You also need to store daily calls made from each phone number as (our recommendation) you should not be dialing more than 180-200 outbound calls per number per day. Finally, you should also store the reputation score of each number in this table.
  4. Create a lambda function that will be called by your Amazon Connect contact flow on each outbound call. This lambda function will look up the area code of the phone number being dialed and will look up the appropriate phone number pool to dial from. Then, it will look at the reputation score and the number of calls it has made for the day (i.e. is it allowed to make a call or not). If this number is allowed to make an outbound call, it will assign this number to the outbound caller ID associated with this contact flow queue.
  5. The call proceeds and the caller sees (hopefully, in most cases) the local area phone number that Amazon Lambda picked.

Answering Machine Detection (AMD) on Amazon Connect

Unfortunately, AWS does not have answering machine detection capabilities yet. However, we are working on a solution to leverage the AMD capabilities of an Asterix server (which we use for faxing via Amazon Chime anyway) for this purpose. This section will be updated later.This is a beta feature and will be beta for a while. Meanwhile, there’s one solution proposed here 0x4447/0x4447_product_answering_machine: ☎️ An automated answering machine build on top of Amazon Connect that you can consider. We have not tested this out.

How to send SMS from Amazon Connect

Keep in mind that Amazon Connect is not going to let you send SMS / text messages from the same phone number that you purchased on Amazon Connect. For this, you need to purchase a number from Amazon Pinpoint or Amazon Chime. 

Having 2 way conversations with patients / customers in Amazon Connect

If you purchase a number from Amazon Chime, you still are “sort of” using it for customer engagement purposes and not quite as a “deskphone” or “my phone number” purposes. 

If you truly are thinking about this as “my phone number” and “I want to send text messages myself”, then we suggest that you simply use Amazon Chime to send text messages instead.

You don’t have a web interface out of the box (CCP2) that allows you to do this. Amazon Connect’s CCP2 allows you to chat (web chat) and dial (phone). However, the great thing about Amazon’s CCP is that it is very customizable. So, you can very easily extend the CCP to include more tabs. 

To be able to send SMS from Amazon Connect you can do the following

  1. Use Amazon Pinpoint to purchase a phone number
  2. Extend Amazon Connect CCP2 to include a web interface to send/receive SMS
  3. Create a Lambda function to be able to send SMS using Amazon Pinpoint on demand. 
  4. Expose this Lambda function via API gateway to your CCP2 tab.
  5. Use javascript code to send SMS from that customized tab of Amazon CCP2 by calling the API Gateway.
  6. You probably would want to enable 2 way SMS on that number and that’s what you should do on Amazon Pinpoint as well. When you do that, you would choose an AWS SNS topic that the incoming SMS would be published on. Choose or create the SNS topic where the incoming SMS would go to.  
  7. Decide how you are going to get the latest messages you receive from SNS that are sent to you from various message senders (you have multiple choices of subscriptions in Amazon SNS – HTTP, SMS, Amazon SQS, Lambda etc).

How to send SMS from Amazon Connect IVR automatically

Since you have already had 2 way conversations with patients using Amazon Connect CCP (in the example above), this one is a lot easier. Many times, in hospital call center IVRs, you are given an option to “send an SMS / text message” or “Text me an appointment form” or “Sorry for the delay, we will call you right back” etc. This moves the conversation from a “single tasking phone call” mode to “multi tasking” chat mode.

Multitasking is a lot easier for agents to do. Chat is also a lot cheaper. Text messaging is also a lot cheaper than voice calls. Overall, the more you can guide folks over from voice calls to chat, the easier it is to scale your hospital’s call center. Sending SMS to customers is a whole lot easier if you use a healthcare CRM and an automated communication solution like ours.

If you want to go it alone, here’s how to send SMS to customers from Amazon Connect Contact Center. You can use Amazon Connect Contact Center along with a few other services of AWS to create a pretty advanced, intelligent contact center. 

Here are the few steps you need to follow:

  1. You will set up a number where your customers can text you. As usual, you will use Amazon Pinpoint to register your text enabled phone number.
  2. You will set up automated help text messages for your customers / patients. This is super easy to do in Amazon Pinpoint console itself. You are going to need to set up a “Default Help Message” e.g. “Text APPT for appointments, BILL for billing questions, MEDS for pharmacy help. For anything else, call us at 1-888-5xx-9242.” . And also the “Default STOP message”. E.g. “Thank you. We won’t send you text messages any further”.
  3. Set up the keywords you want as well. E.g. you can set up keywords that callers text you – APPT, BILL, MEDS etc. So now, if your customers text you, they will get automated responses for keywords they type.
  4. Change your IVR and introduce your new SMS number to callers on the IVR itself. This will let your customers know that they can now text you at this number.
  5. Create a Lambda function to send an SMS using. Plain and simple – copy the code from AWS blog. Then, add your pinpoint project ID here. SenderID won’t always work as expected unless you have registered your pinpoint number with a CNAM database.
  6. Invoke the Lambda function in your contact flow 
  7. Create an SNS subscription to get SMS that customers sent. You can choose Email since that’s the easiest one (keep in mind that AWS is going to send you some JSON so it is kind of hard to read). You will have to add your email address here. Then, AWS will send you a confirmation request to that email address. Go ahead and confirm that subscription and you are off to the races. OR, as you have already set up 2 way conversations with patients in the example above, you can simply continue using that solution as well. After that, every time a customer sends an SMS, you will get an email or an SMS.

How to send SMS to customers and allow them to request a callback

It’s far more efficient to send SMS blast to customers and allow them to request a callback. This is a whole lot easier if you use a healthcare CRM and an automated communication solution like ours.

As an example, for appointment reminders, instead of calling patients one by one and reminding them, it is always easier to either send a personalized SMS blast or a personalized voice recording. Sometimes, patients want an option to reschedule their appointment. Usually, they call the main number, wait on hold, connect with an agent and reschedule the appointment.

We believe that this is not the most ideal customer experience. In addition to this, it also eats up your calling minutes while the customer is on hold, thereby increasing your expenses.

Instead, we send SMS blasts to patients and ask them to text a keyword (e.g. “CALL”) to get a callback from us. This immediately triggers a call to the patient to let them know that we received their SMS. In this voice recording we also let them know that one of our agents will call them back as soon as they are done with the current call. If the agent is currently on another call, they receive this customer’s number in their callback queue. 

Here’s how you get this done. 

  1. Add a keyword to amazon pinpoint to listen for customer intent (CALL)
  2. Send personalized SMS blast to customers using Amazon Pinpoint
  3. Set up an SNS subscription and an SQS queue
  4. Add a callback queue and callback contact flow to your amazon connect instance
  5. Trigger a lambda function to call the customer automatically
  6. Put them all together for optimal customer experience and access

How to use Amazon Contact Lens

For ages, we have been manually capturing call dispositions. With Amazon Connect Contact Center, we can continue doing so. On top of this, we can also use Amazon Contact Lens to automatically capture call dispositions based on what we “discussed” during the call 🙂 Yup! Finally, some respite for call center agents.

Call dispositions, the traditional way

To do this the traditional way, it is very simple.

  1. Use DynamoDB and create a simple table that stores contact ID, the call timestamp, the agent /employee ID, the call disposition, the call notes, the call recording/media URL
  2. Extend the Amazon Connect CCP2 to include a nice little dropdown that shows the available options for call dispositions that work for your hospital call center.
  3. Make sure that your agents dispose of each call by choosing a disposition.

Automatic call dispositions using Amazon Contact Lens

With Amazon Contact Lens, you can alleviate some of the tedious work of disposing calls. Amazon Connect will let you automatically categorize contacts based on words uttered during the call. Read more using this guide here. To do this:

  1. Make sure you have enabled use of Amazon Connect Contact Lens.
  2. Make sure you are using Amazon Connect Contact Lens in your Contact Flow.
  3. To set up this feature, add rules that contain the words or phrases that you want to highlight. To do so, login to Amazon Connect and add Rules. 
  4. You can add rules like “New Appointment”, “Reschedule Appointment”, “Cancel Appointment”, “Left Voicemail” etc etc.. Next to When, use the dropdown list to choose “post-call analysis”. Then, “Add condition” and choose “semantic” analysis. This way, at the end of the call, this analysis will be shown as the option to choose from in the Disposition dropdown.
  5. The agent can still override the suggestion disposition, but at least, 90% of the work is done for them 🙂

That’s the power of Amazon Connect and AI.

How to create automatic call summaries

We all know the largest part of after call work is in summarizing the call. Everyone in a call center hates it but we all have to do it. With Amazon Contact Lens, you can alleviate some of the tedious work of disposing calls and writing up call summaries. To do this:

  1. Make sure you have enabled use of Amazon Connect Contact Lens.
  2. Make sure you are using Amazon Connect Contact Lens in your Contact Flow.
  3. Use the Contact Lens API ListRealtimeContactAnalysisSegments to summarize the entire discussion or dump the entire conversation itself into the note.
  4. The agent can still override the suggested summarization, but at least, 90% of the work is done for them 🙂

That’s the power of Amazon Connect and AI.

How to automatically capture call quality / do quality audit with Amazon Contact Lens

Most of us in the hospital call center business know the pains of QA work (call quality audit work). All of us know that it takes a team of QA professionals to get this done and that too, we take a random selection of calls and screen them to see how our agents have been performing. This is error prone but that has been the ONLY solution for us.

Most of us became QA leads because of the excellent customer service we provided in our careers as agents. We didn’t quite become QA leads because we were great at listening to call recordings and spotting issues. In other words, we went from being great at our jobs to doing REALLY Boring jobs.

But with Amazon Contact Lens, most of our work is taken care of (the tedious parts anyway). Now, we can spend our time on the stuff – we like. COACHING!

With Amazon Connect Contact Lens, you set up automated quality control of calls like this:

  1. Enable Amazon Contact Lens in your Contact Flows.
  2. Create Rules for words or phrases you want to monitor. E.g. you might have specific rules that an agent has to follow that you need enforced.
  3. Automatically categorize contacts based on uttered keywords and phrases against the Rules you created.
  4. Pull reports on a regular basis to audit the calls as usual – only difference being that you no longer have to do random sampling and will only listen to audio recordings of calls that have been tagged by Contact Lens as “issues”.
  5. Speak to your agents about the issues you and Amazon Contact Lens have identified, coach them, guide them, move on.

How to alert call center managers about angry patients

Many times we have angry patients. Sometimes we have abusive patients. Either way, a supervisor or call center floor manager needs to step in. Sometimes when we are making a collection call, the called patient asks for a discount. That’s another time the supervisor with higher discounting authorization needs to step in as well.

In any case, you can set up Amazon Contact Lens to alert supervisors about these situations. Call center managers don’t have to be glued to their laptops or computers to get these alerts either. 

To do this, you follow these steps:

  1. Enable contact Lens in Amazon Connect Contact Center.
  2. In your contact flow, enable Real Time Analytics. (not always the best transcription option). Real time analytics option will always come with post call analytics as well, so there’s no need to worry about losing the post call transcription option.
  3. Next, create rules that you want to monitor for. Make sure you understand how rules work and whether you need exact matches, AND OR , whether the agent should utter certain words or whether the customer / patient should utter certain words. There are a few examples here “Alert supervisors in real-time based on keywords and phrases – Amazon Connect
  4. Once you do this, your call center manager (or designated person) can start getting alerts and can actually listen in on conversations to take further action (or whatever is the protocol for your hospital’s call center).

How to perform call sentiment analysis

As a call center manager you will be doing call sentiment analysis over periods of time to analyze the performance of your agents, the experience of your callers and to get ideas on how to improve. Amazon Contact Lens can help you tremendously with this.

To do this, you would need to use this API of Amazon Contact Lens. Example Contact Lens output files – Amazon Connect. Effectively, here’s what to do.

  1. First, understand the schema that Amazon Contact Lens produces. Understand how and where the redacted information segments start and end. Understand how and where the loudness, sentiment scores, sentiment analysis, interruptions etc are marked.
  2. Have a simple web application pull data from your Contact Lens file storage S3 bucket.
  3. You can search by “ParticipantRole” :”AGENT” or “ParticipantRole” :”CUSTOMER” or search by “LoudnessScore” or “Sentiment” or “MatchedCategories”  that might be of interest to you e.g.  “Swearing”, or  “Interruptions” or “NonTalkTime” etc
  4. Slice and Dice the data that you find to perform sentiment analysis of past calls at your hospital’s contact center.

How to create Holiday Calendars in Amazon Connect

Amazon Connect comes with basic operating hours out of the box. It works well, but more often than not, it is not enough. As hospital call center managers, we need to manage holiday calendars that are more complex than the default working hours that Amazon Connect gives us.

Some hospitals also have teams set up that revolve around doctors/providers. This means that these teams operate only on the days that those providers are available at those locations. This kind of variability in the operating hours quickly escalates to a nightmare if not managed appropriately. 

However, there’s a very easy solution to this as well. Here’s how you would create and manage holiday calendars in Amazon Connect contact center for your hospital.

  1. Create a DynamoDB table that can be modified to add as many holidays as needed.
  2. Create a Lambda function that performs a data dip into a DynamoDB table. This is the Lambda function that your Amazon Connect contact flow would call.
  3. Update your inbound Amazon Connect contact flow for checking holidays each time an inbound call is coming in.
  4. If it is not a holiday, proceed with the call flow, otherwise proceed with other automation you might have set up within your contact flow.

That’s it. As simple as that.

How to handle emergency shutdowns in Amazon Connect

As we saw, creating hospital holiday calendars was not really a big deal. But another situation does prop up from time to time – emergency call center shut downs. Sometimes, this extends beyond a single center and cuts across to multiple locations. We have had emergency shutdowns a few times already. For this, we scramble and try to change Amazon Connect. Instead of that, sitting in front of the computer, there has to be an easy way to do so. Call center managers can set it up from their mobiles. 

Your hospital decides what the emergency protocols are. It could very well be that you want the contact flow to be exactly the same as a holiday contact flow. Or, you might want to route all the calls to another contact center location.

Whatever your protocols are, that needs to be decided upon and needs to be baked into your alternate contact flow. Here’s how the entire process works.

  1. Create a DynamoDB table that can store emergencies, type of emergency, who is authorized to activate emergencies.
  2. Create an Amazon Pinpoint project and claim a phone number that can send SMS. You don’t have to set up a 2 way SMS on this one.
  3. Create a Lambda function that performs a data dip into a DynamoDB table. This is the Lambda function that your Amazon Connect contact flow would call.
  4. Set up another Lambda function that will create a random PIN on demand.
  5. Set up another Lambda function that will update the emergency table on demand.
  6. Set up a separate phone number that is used to activate these emergencies. This would not be a published number. Attach it to a contact flow. In this contact flow, Amazon Connect checks the ANI (calling number) of the administrator caller using a Check contact attribute block. If the ANI is in the list of Check Contact Attribute Block, an AWS Lambda function is invoked to generate a random PIN number. 
  7. Store this PIN generated by the Lambda function in the contact Flow. Then, from this lambda function, pass this PIN to Amazon Pinpoint to be sent as an SMS to the administrator / call center manager. The administrator has a few seconds to enter the PIN using their phone. 
  8. You are waiting for “Customer input” in the Amazon Connect contact flow block. If the PIN entered by the administrator matches the PIN sent by Amazon Pinpoint, the admin is considered validated, and the call proceeds to the next flow.
  9. In the next part of the contact flow, the lambda function to update the emergency DynamoDB table is updated.
  10. Meanwhile, update your inbound Amazon Connect contact flow for checking for emergencies each time an inbound call is coming in.
  11. If it is not an emergency, proceed with the call flow, otherwise proceed with other automation you might have set up within your contact flow.

A bit more complicated than the holidays one, but it allows you to handle emergencies (even team meetings btw).

How to monitor call quality of Amazon Connect

Most call centers “hide” call quality metrics of each agent from their own agents and this information is made available only to the QA folks. However, we feel that each agent should have this should be made available to each agent. Sometimes few agents have call quality issues while others don’t – they will be able to see which agents are having issues. We feel that a lot of “help!” issues of agents raised to call center managers and IT managers can be addressed by having this “call quality” page available to agents themselves. When an administrator (aka call center manager) sees this same thing, they can choose a particular agent from the dropdown and see the same thing (Because they themselves make very few calls).

As we all know, call quality has a significant impact on the customer experience. With COVID, we all have had to move our call center agents to work from home and a lot of us have experienced calls of varied quality. Follow this blog to learn how to enable call quality – Easily monitor call quality with Amazon Connect.Basically, the entire solution is available to be deployed right off the bat here. https://serverlessrepo.aws.amazon.com/applications/us-west-2/287087860234/AmazonConnectMonitoringSolution. It is deployed on Amazon Elasticsearch and Kibana. If you’d like, you can also modify the solution to use Amazon Quicksight and use its Anomaly detection features – out of the box, this solution provides anomaly detection provided by Kibana.

How to move agents between queues in Amazon Connect

As hospital call center managers we have to juggle call queues all the time. We have daily SLAs to meet and sometimes call spikes threaten our perfect SLA scores. What to do? 

Well, Amazon Connect allows us to handle this situation quite easily. In general, the way Amazon connect works is that we create our agents as users and associate them with routing profiles. In these routing profiles, we associate queues.

In NisosHealthEngage, the way we handle this is that our call center manager gets an alert based on the queue wait times. Once they see queue wait times approaching levels close to or exceeding agreed upon SLAs, they can immediately look at the load of the other queues in their call center and move some agents from one or more of the queues to the overburdened queue(s). For this, all you have to do is to update the routing profile of the agent(s) by calling this api AssociateRoutingProfileQueues – Amazon Connect Service with the queue you want to beef up.

That’s all there is to it. Once the call spike has died down and the crisis is averted, you can remove this temporary association of the agent by calling the DisassociateRoutingProfileQueues – Amazon Connect Service API  and put them back to their original queue assignment. You could even look at this example for inspiration Managing queues with a new API in Amazon Connect | Amazon Web Services

How to save on telephony costs by offering a callback option

Amazon Connect contact center software saves you up to 80% on traditional call center software by having you pay for usage only. However, if you are facing a call spike and your callers are on hold, that hold time still counts as “usage” time. This means that you are still paying for that phone call. 

Plus, who likes being on hold anyway? Now, there’s a better option. You can offer callers an option to be called back as soon as an agent becomes available without them losing their position in the queue. Not only that makes the caller / patient experience infinitely better, it also saves you a lot on telephony costs. Effectively, here’s what you do:

  1. The patient calls your IVR. You have already modified your IVR to determine the wait time (approximate) of the caller based on the number of callers ahead of the current caller. You can get this information in the contact flow from the queue metrics.
  2. Based on the information above, you tell the caller that they won’t lose their place in the queue and can be called back as soon as the agent is available. Then you give the caller an estimated time of the callback. This time would be the same as the wait time you had announced in the step above.
  3. As the patient / caller agrees to this, you speak the patient’s phone number to call them back on and ask them to confirm. You also give them an option to be called back at another number if that’s what they’d prefer. 
  4. Then, in your contact flow, you place the call in a callback queue. As soon as the agent is done with their call, the next call in the callback queue is made available to them to answer. Amazon Connect handles this automatically for you. The incoming call priorities are always maintained by Amazon connect, so even if a new call comes in, they are placed in the queue and will be answered in the order they were received.
  5. The patient / caller gets a callback and if they pick up the call, they press a number to proceed with the call. If they do so, the call gets connected to the agent and continues.
  6. This way, the patient is happy and you have saved a bunch on paying for the inbound call minutes as well.

How to move callers from voice to chat and save on telephony costs

This will allow the caller an option to chat with agents because agents can multitask better on chat rather than on phone calls. We usually try to push the caller to move to chat more than being on call (based on hold time) because calls are more expensive.

There are several ways to introduce the chat channel. 

First, we always recommend adding a “start a chat” button on your website or mobile app by adding chat icons to your “Make an appointment” or “contact us” pages. 

Second, announce to callers / patients ( while they are in a voice queue) in the IVR that chat may be a faster option and let them know where on your website to find this option. You can also offer to send an SMS with the chat link here.

Finally, when voice queues exceed desired service levels (SLAs), you can proactively prompt customers to move to chat by sending them a direct link to your chat channel.

In any case, your agents can service a lot more callers / patients (benefits of multitasking ) in the same time that they would take to service a single caller / patient over the phone.

Use this blog Redirecting voice contacts to chat on Amazon Connect | Amazon Web Services to learn more about how to do this.

The general idea is :

  1. Create a Lambda function that can call Amazon Pinpoint and send an SMS with the Amazon connect chat link
  2. Create an Amazon Pinpoint project and get an SMS number (you don’t have to enable 2 way SMS on this). Set up default keywords if needed and help text / keywords if needed to ensure it sends the Amazon Connect chat link on demand.
  3. Ensure that your agent queues have chat channels enabled.
  4. Update your IVR with the options mentioned above and as / when the caller chooses (or the SLAs are exceeded), send that SMS with the Amazon connect chat link. Keep in mind that you can only send an SMS to a caller that’s using a mobile phone, so your IVR should always confirm with the caller which phone number they want to receive the SMS at (even though you can validate whether the caller is calling from a mobile or landline using Amazon Pinpoint’s Phone Number Validate – Amazon Pinpoint API).
  5. Ensure that you’re passing an agent’s username and/or name from the contact flow to the Lambda function as this would be needed in the chat URL SMS that’s sent out. 
  6. Send the SMS and have your agents service patients via chat.

That’s about all you have to do. Now, your agents can service the caller and even transfer the chats to another queue, quick connect or another agent if they want to (based on what they need during the chat session with the caller).

How to provide self service IVR with Amazon Connect Contact Center

Inbound call centers can provide self service options in their IVR itself. This allows patients to never even have to speak to an agent to get their queries answered. Not only does this reduce the inbound call volume, but this improves patient satisfaction and patient experience tremendously.

Amazon Connect Contact Center allows you to connect to your EMR and practice management in a HIPAA secure environment via many services, including Amazon Lambda. Most EMRs (if not all) provide API connectivity to patients, providers, appointments, transactions, charges etc. They provide secure access with OAuth. You can access all these via Amazon Lambda.

Meanwhile, you can provide interactive services to your IVR via Amazon Lex. So, these services put together with your IVR, you allow full self service in your IVR and wow your patients.

You will find an example on Amazon Connect website Add an Amazon Lex bot – Amazon Connect that shows you how to create a first “press or say” sample. In this, you will find a sample of “hardcoded” account lookup. Take a look at this one in addition as well Schedule Appointment – Amazon Lex. Combining the knowledge of these two, gives you an idea of wha you truly can achieve with Amazon Lex, Amazon Lambda and Amazon Connect to service your patients or customers.

Effectively, here’s what you are going to do:

  1. Create an Amazon Lex bot and create as many intents as you like – e.g. Create Appointment, Lookup Appointment, Reschedule Appointment, Cancel Appointment, Get Directions, Change Insurances, Change Address etc etc.. 
  2. Tie in those intents to use the Lambda function as a code hook for the validation and fulfillment activities against your EMR or CRM or whatever it is that you want. Again, remember that you can and will be doing this HIPAA securely.
  3. Once this works well, tie in the Amazon Lex Bot with your Amazon Connect IVR itself. Update your Contact flow to invoke the Amazon Lex bot and let customers self service themselves.
  4. Update the contact flow so that if the patient / caller cannot find a resolution to their call, they can get in touch with a customer service agent. This is the crucial part where you should be forwarding the ENTIRE context and history of the caller / patient’s session to the agent along with all the data (2 way) that has been shared with the caller. This way the caller does not have to repeat themselves and the agent provides the caller with a seamless experience.

That’s how you provide the best patient experience possible.

How to provide visual IVR with Amazon Connect Contact Center

Inbound call centers are always looking for ways to improve the calls they handle. They want to lower the inbound call volume.

Wait. What?

Yes, they want to lower the inbound call volumes of calls that could have easily been self serviced. They want to handle the complex calls that truly need a human’s help. 

Inbound call centers are looking for more accurate routing. They are looking to have more intelligent routing and would love it if they have the context of the call so that the caller does not have to repeat themselves or repeat the reason why they are calling. 

That’s customer service. The above mentioned self service method is great BUT it has a problem – it is all driven by the phone… and keying in digits via your mobile phone or desk phone. This is error prone and always a tad confusing. This also leaves very little room for errors and it is hard to correct errors that one has made.

It is possible to do better than this. It is possible to do better by your patients and other callers.

And that’s possible with visual IVRs with the help of Amazon Connect (plus a few other Amazon services). This usually also reduces average call handling time by a minimum of 45-60 seconds.

Why? Because the caller does not have to explain themselves to the agent, plus they have already entered most of the complex / detailed information on the web page already. This means that the agent doesn’t have to key in data and pull up the information as the system has already pulled up most of the information for them before the call even starts.

So, the basic idea of a visual IVR is that it replicates your current IVR with slight modifications:

  1. You get to keep your current IVR to service your patients / callers. You introduce this option of self service in the IVR and allow the caller/patient to get an SMS or email to continue this self service via the visual IVR web link.
  2. Your callers can enter a lot more information and correct / delete incorrect data entry on simple mobile web pages – something that they cannot do on IVRs very easily. 
  3. Based on the data entered by your callers, your IVR (Amazon Connect) can do data dips in a HIPAA secure fashion into your EMR or CRM or any other system you might want it to, pull up information to service your patient/caller. 
  4. This in itself might be enough for your callers/patients. If it is not, they can still enter more data and ask more questions to your visual IVR. If they still do not find the answer, they can connect with an agent.
  5. However, they do not have to repeat a single thing to the agent. The agent has a complete history of everything the caller/patient has done during this entire session, everything about the patient / caller that is in your system(s) and can simply take the baton from there.

Talk about patient experience huh?

Here’s how to get this done:

  1. Repeat exactly what you have done before (above steps).
  2. However, as a next step, look at these examples of integrating the SAME thing, in a web application (not very difficult, really) – Integrating with a Web site – Amazon Lex.
  3. Once you have your chat bot integrated into a web application, what you have effectively achieved is that you have allowed patients and callers to self service themselves. On top of that you have introduced this into the call center IVR itself. On top of this, you have taken away the pain of entering information via the mobile phone (error prone and a tad painful). You have given the patient / caller an option to receive the same options via a text message to be able to experience the same options in a richer, visual IVR manner.
  4. The patient is super happy to self service themselves using a small, web application that is super responsive. They get their queries resolved and are happy.
  5. Alternatively, you have also ensured that if the patient’s query is NOT resolved, they can click on a button to call the agent right there, on the web page and the entire call session and the conversation data is passed to the agent CCP window for them to review as they get on the call with the patient to help them out.

That takes customer / patient experience to new heights!

How to predict caller intent and increase call center productivity 

Now that you have understood how to service patients by connecting Amazon Lex, Amazon Lambda and Amazon Connect, you can do something more as well. When a patient calls in, you can also deduce the intent of the patient’s call. Usually patients with existing appointments call to either find out more about their appointment or to make changes to their appointments.

When the patient calls, your IVR system that’s running on Amazon Connect can very easily look up the patient that’s calling. Not only can it identify the patient that’s calling, it can also identify more information about the patient / caller.

Based on the caller’s upcoming appointments, we can determine the intent of the caller and offer them options to confirm their appointment, learn about their appointment, reschedule their appointment etc or speak to an agent to cancel their appointment. 

What’s more? We can also check the status of their patient intake (how much they have completed) and have them finish the rest of patient intake. We could offer them incentives, or wish them holiday greetings.. there are no limits to what you can achieve in personalizing your patient’s experience.

Think about it? If your IVR is already predicting what the caller might be calling about and offering solutions to the caller / patient, it’s reducing the time the caller spends on choosing various options in your IVR, thereby reducing the minutes you pay for .. more you save. And better customer service/ patient experience!

How to service WhatsApp patients via Amazon Connect

Whatsapp, as we all know, is ubiquitous. Almost everyone uses it. This is even more so the case outside of the USA. We find that (for many reasons that are beyond the scope of this article) patients and customers seem to prefer Whatsapp over text messaging (outside of the USA). So, does this mean that you cannot service Whatsapp connected patients and customers? Not at all – you still can!

Both via Amazon Connect voice and via Amazon Connect Chat.

Amazon Connect Voice

This is well documented in this blog here – Using WhatsApp and Amazon Lex to escalate to voice via Amazon Connect | Amazon Web Services. For Whatsapp, you need to use an authorized service provider like Twilio.

The solution you need is really quite simple.

  1. Create an Amazon Lex bot that responds to your patient’s queries.
  2. Set up this Amazon Lex chatbot integration with WhatsApp (let’s say that you got it from Twilio). For this, you need to set up the Twilio API integration on Amazon Lex (you are going to need the URL of the Amazon Lex channel configuration). So, your Twilio Whatsapp will talk to your Amazon Lex. 
  3. Modify the Amazon Lex fulfillment behavior so that when a certain utterance occurs (e.g. “agent” or “customer service” or “talk to an agent” etc), the conversation will be transferred to the agent via a call)
  4. Create the Lambda function to initiate the outbound API call to Amazon Connect.
  5. Set up the contact flow on Amazon Connect so that agents can answer that call. In this call, pass the conversation from whatsapp / Amazon Lex bot as contact attributes to the CCP2 so that the agent has context of what transpired before the call was transferred.

That’s it.

Amazon Connect Web Chat

Now, let’s look at handling the same situation via Amazon Connect web chat. We found a nice little proof of concept here. https://github.com/tamdilip/whatsapp-amazonconnect-chat . Note that we have not tried it out ourselves and this is not yet available in NisosHealthEngage yet either. Your mileage may vary.

The general concept here is that it uses websockets to keep a conversation going between Twilio’s Whatsapp APIs and Amazon Connect Chat APIs, so this way, the need for Amazon Lex chatbots are eliminated and your patient/customer can chat directly with your agents via Whatsapp, while your agents can respond via Amazon Connect Web Chat.

How to do patient intake in Amazon Connect

Patient intake doesn’t get enough attention whereas it should. Think about how much time your technicians spend “working up” patients and doing medication reconciliation for each patient visit. If you could save 10-15 mins per patient work up, how many more patients could you see per day? Or, how much faster could you get done in a day? How much could you reduce your patient wait times by?

We recommend that you get patient intake done before the patient comes in for the visit. You can get this done very easily by using a combination of Amazon Connect, Amazon Transcribe and Amazon Comprehend Medical.

You can integrate these services and use them in conjunction with services like AWS Lambda, Amazon S3 , Amazon Pinpoint, Amazon DynamoDB, and Amazon SQS to create a serverless healthcare solution, completely on top of AWS. There’s a wonderful blog here that can be modified to implement this solution (Enabling efficient patient care using Amazon AI services | Amazon Web Services)

Here’s what needs to be done:

  1. Use Amazon Pinpoint to run a campaign that sends an SMS to each patient with an upcoming appointment asking them if they’re ready for their intake call. If they’re ready, they can respond with a SMS “CALL” OR “YES”
  2. Use Amazon Pinpoint and Amazon SNS to capture this response and trigger off an Amazon Lambda call. This Amazon Lambda calls Amazon Connect and calls the patient to start the patient intake.
  3. When the patient picks up / answers the call, Amazon lambda still authenticates the patient by asking them to verify at least 2 pieces of PHI. For this, Amazon Lambda does data dips into your EMR. If the patient has successfully authenticated, the patient proceeds with the patient intake.
  4. Now, the fun part begins. Let’s say that the patient has not provided a chief complaint yet. The patient intake process asks the patient for the chief complaint. The patient records an audio clip describing their ailment on the phone that is recorded and uploaded to an AWS S3 bucket by Amazon Lambda function called from Amazon Connect contact flow.
  5. This triggers another AWS Lambda function that initiates a transcription job converting the patient’s audio clip into a transcript. This transcript contains the patient’s chief complaint.
  6. This job is monitored by AWS CloudWatch, which triggers another Lambda function once the transcription job is completed.
  7. The second Lambda function is in charge of passing the raw text of the patient’s chief complaint transcript through Amazon Comprehend Medical (ACM).
  8. Amazon Comprehend Medical typically helps extract medical entities, symptoms, dosage forms and their frequencies and presents them in an HTML format. For the first step, you’ve collected the chief complaint and maybe even the history of present illness over the phone.
  9. These entities are then being stored in a DynamoDB table that can be then used for entering data into your EMR.
  10. Next, let’s say you ask the patient about their medical history, social history, surgical history etc and followed the same steps to enter data the same way into your EMR.
  11. Next, the painful medication reconciliation part. Amazon comprehend medical does a fantastic job of tying in with the RxNorm database so you could have patients rattle off the medications they’re taking and the dosages. Amazon comprehend medical will transcribe all those into medications, dosage forms and frequencies. You can safely record these into your EMR.
  12. This is how you save a solid 10-15 Mins per patient per visit per day 😉

Amazon Connect Call Center Reporting

Hospital call centers have various (real time and historical) reporting needs that are very helpful for call center managers. We recommend using Amazon Connect Contact center software to our healthcare customers because of its ease of setup, scaling capabilities and the ability to integrate into and leverage the huge AWS ecosystem.

In this particular post, let’s look into creating real time call center analytics / reports using various AWS capabilities.

We are assuming that you have already started using Amazon Connect Contact Center software.

First, make sure you have turned on Data streaming

Hospital Call Center Real Time Reporting - data streaming
Hospital Call Center Real Time Reporting – data streaming

If you do not have an Amazon kinesis stream setup (I am assuming that you do not), create a new AWS Kinesis stream.

Let’s start with the contact trace records first (CTR). Create a kinesis stream for it. 

Hospital Call Center Real Time Reporting - create Kinesis stream
Hospital Call Center Real Time Reporting – create Kinesis stream

Now, go back to your Amazon Connect Call Center console and associate this data stream to handle your call center CTR records.

It’s a good idea to start with 1 or more shards. For our call processing needs, we chose 4 shards. 

Hospital Call Center Real Time Reporting - use Kinesis stream
Hospital Call Center Real Time Reporting – use Kinesis stream

Your next step would be to create an application to process this data. You can see that there is a “producer” and a “consumer” section in the Amazon kinesis stream that you just created. Now, your Amazon Connect hospital call center call records will be the “producers” of data as you will tie in this newly created Kinesis stream to the Amazon Connect hospital call center console pretty soon. 

On this screen, you will be associating Consumers to the Amazon Kinesis stream that you created just now. This “consumer” will consume all the data that your Amazon Connect hospital call center Contact Trace Records (CTRs) generate.

Keep in mind that here, you do have the choice to bypass processing with an Amazon Kinesis Delivery stream to analyze your hospital call center data. You can choose to associate an Amazon Kinesis Data Analytics application directly to analyze your hospital call center data instead (there are some pros and cons discussed in another post).

Let’s say that you did choose to use an Amazon Kinesis Data Analytics application instead of Amazon Kinesis Firehose Data. Here, you will find an option to choose SQL or Amazon Fink. 

I doubt that your IT team has already developed the skills to manage reading data using Amazon Fink. If they do not know Amazon Fink, they most certainly know SQL. Go ahead and choose that.

Hospital Call Center Real Time Reporting - create Kinesis Data Analytics
Hospital Call Center Real Time Reporting – create Kinesis Data Analytics

We advise clients to ALWAYS use tags as it allows to filter data and associate costs back to various departments for chargeback purposes. Even if you are not asked to help with cost allocation at the time of creating this setup, it is always best to take care of tags now than later on. 

Hospital Call Center Real Time Reporting - create Kinesis Data Analytics tags
Hospital Call Center Real Time Reporting – create Kinesis Data Analytics tags

On the next screen, all you have to do is to associate the data stream you had created, with this analytics application.

Hospital Call Center Real Time Reporting - connect to Kinesis Data Analytics
Hospital Call Center Real Time Reporting – connect to Kinesis Data Analytics

Should you want to do any preprocessing with AWS Lambda, this is where you would choose the Lambda function. However, in this post, we are assuming that you have not created any Lambda functions to preprocess the call centre CTR records. 

One GREAT thing about using Amazon Kinesis Data Analytics for your hospital call center is that it allows you to do SCHEMA DISCOVERY. This in itself is a big time saver – do not underestimate that.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics schema discovery
Hospital Call Center Real Time Reporting – Kinesis Data Analytics schema discovery

However, for Amazon Kinesis Data analytics to discover the schema, you need to wait for a bit while your call center agents make/receive calls. This generates enough call center CTRs for Kinesis Data analytics to do a proper schema discovery.

This will start the discovery process with the beginning of NOW and show you a single column schema first.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics edit schema
Hospital Call Center Real Time Reporting – Kinesis Data Analytics edit schema

If you really want to, you can go ahead with a one column schema, however, it is going to be painful to do data discovery later on. We suggest that you click on the EDIT SCHEMA button and create a schema of your own.

For this, first look at the raw data, choose JSON as the format. 

Hospital Call Center Real Time Reporting - Kinesis Data Analytics edit schema as JSON

Next, copy the output and head over to some json linter tool (e.g. jsonlint.com) to clean/format it a bit. Now, you have enough data to create your own columns.

{
     "AWSAccountId": "90290668xxxx",
     "AWSContactTraceRecordFormatVersion": "2017-03-10",
     "Agent": {
         "ARN": "arn:aws:connect:us-east-1:90290668xxxx:instance/xxxea4c7-514d-43d1-bdb9-173e51b1e729/agent/xxx8523a-7207-45e5-a76f-935694a2faf4",
         "AfterContactWorkDuration": 0,
         "AfterContactWorkEndTimestamp": null,
         "AfterContactWorkStartTimestamp": null,
         "AgentInteractionDuration": 0,
         "ConnectedToAgentTimestamp": null,
         "CustomerHoldDuration": 0,
         "HierarchyGroups": null,
         "LongestHoldDuration": 0,
         "NumberOfHolds": 0,
         "RoutingProfile": {
             "ARN": "arn:aws:connect:us-east-1:90290668xxxx:instance/xxxea4c7-514d-43d1-bdb9-173e51b1e729/routing-profile/xxxe2ae3-6507-4e53-b5b3-c083ccbadd2a",
             "Name": "xxx Calling Routing Profile"
         },
         "Username": "nh-tanvi"
     },
     "AgentConnectionAttempts": 0,
     "Attributes": {},
     "Channel": "VOICE",
     "ConnectedToSystemTimestamp": null,
     "ContactDetails": {},
     "ContactId": "xxx52ed7-585d-4434-9405-e3ddf07b9528",
     "CustomerEndpoint": {
         "Address": "+1xxx5432200",
         "Type": "TELEPHONE_NUMBER"
     },
     "DisconnectReason": "CUSTOMER_DISCONNECT",
     "DisconnectTimestamp": "2021-02-16T19:02:27Z",
     "InitialContactId": null,
     "InitiationMethod": "OUTBOUND",
     "InitiationTimestamp": "2021-02-16T19:02:15Z",
     "InstanceARN": "arn:aws:connect:us-east-1:90290668xxxx:instance/xxxea4c7-514d-43d1-bdb9-173e51b1e729",
     "LastUpdateTimestamp": "2021-02-16T19:03:34Z",
     "MediaStreams": [{
         "Type": "AUDIO"
     }],
     "NextContactId": null,
     "PreviousContactId": null,
     "Queue": {
         "ARN": "arn:aws:connect:us-east-1:90290668xxxx:instance/xxxea4c7-514d-43d1-bdb9-173e51b1e729/queue/xxx57bef-0a79-4e33-ac23-80aa3eb02e9e",
         "DequeueTimestamp": null,
         "Duration": 0,
         "EnqueueTimestamp": null,
         "Name": "NISOS Calling Q"
     },
     "Recording": null,
     "Recordings": null,
     "References": [],
     "SystemEndpoint": {
         "Address": "+1xxx9002523",
         "Type": "TELEPHONE_NUMBER"
     },
     "TransferCompletedTimestamp": null,
     "TransferredToEndpoint": null
 }
Hospital Call Center Real Time Reporting - Kinesis Data Analytics verify schema results
Hospital Call Center Real Time Reporting – Kinesis Data Analytics verify schema results

Once you have added all the columns flattened from the JSON output of your Amazon Connect CTR records, you can start using this as your “real time” query engine. If you have no errors, you will see the following results.. 

Hospital Call Center Real Time Reporting - Kinesis Data Analytics verify schema results
Hospital Call Center Real Time Reporting – Kinesis Data Analytics verify schema results

And once your healthcare call center agents start making/receiving calls, you will see the data as well. Of course, in your data, you might have symbols that are reference data OR you might have these phone numbers mapped to contact records in your medical CRM. You can very easily connect your reference data as a CSV in S3 and then query the same in real time.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect reference data
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – connect reference data

Here, click on the Connect Reference data button. Before you can connect to a reference database / CSV in your S3, you need to upload your file to Amazon S3. Once you upload the file, then you can finish this section

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect reference data
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – connect reference data

Even here, you can discover the schema like before

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect reference data
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – connect reference data

Once it finishes discovering the schema (in our case, it is the NPI database), you will see the outcome as below and can also edit the schema

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - verify reference data
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – verify reference data

We recommend that you edit the schema and give the column names something that makes sense for your data. This would be something you would refer to while running the SQL queries.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - edit reference data schema
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – edit reference data schema

Be careful about having commas (or the delimiter of your choice) in columns of the CSV you have uploaded to S3.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - edit reference data schema
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – edit reference data schema

It’s always a good idea to double check your CSV data with running Query with S3 Select on the CSV first, verifying the data that is being shown as formatted and as Raw.. and then proceeding with using this file in your Amazon Kinesis Data Analytics reference data.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - verify with S3 Select
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – verify with S3 Select

Now that you have set yourself up with reference data and to capture real time data in your real time hospital call center data analytics application using Amazon Kinesis Data analytics, you can proceed with querying this data.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - add reference data
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – add reference data

From time to time, you might see the following, but this should not concern you. This only means that no CTRs are available at that minute – that’s all.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - add reference data
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – add reference data

For our example here, we created a continuous filter like below.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - add continuous filter
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – add continuous filter

All it does are:

  1. Creates a stream first (CTR_DESTINATION_SQL_STREAM) that holds one of the columns we had created before (called DATA). This DATA column holds the entire CTR record for us. Ideally, you would select specific columns, but for brevity sake, we chose data. The CTR_DESTINATION_SQL_STREAM is where your CTR record output is recorded.
  2. Creates a PUMP that takes the data from the STREAM CTR_STREAM_PUMP and selects the column DATA (as mentioned above) from the stream you had created before- namely, SOURCE_SQL_STREAM_001.
  3. Allows you to continuously query the CTR_DESTINATION_SQL_STREAM table as a normal SQL query to get the real time analytics data you are seeking.

Wait for a few seconds and if your agents are making calls, data will start showing up like below

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - verify continuous filter results
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – verify continuous filter results

New results are added every 2-10 seconds. 

At this point, you can also connect an in-application stream to a Kinesis stream, or to a Firehose delivery stream, to continuously deliver SQL results to AWS destinations. This could be a Lambda function, another Firehose stream, Kinesis stream etc. This way, you can write applications that read from any of these data sources to show you the desired charts.

Do keep in mind that the limit is three destinations for each application.

Let’s say that you want to store the outputs of your continuous queries in Amazon S3 as CSV files. 

For this, you would first create a bucket/destination to hold your CSV files.

Next, go ahead and create a new Kinesis Firehose stream.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect to firehose delivery stream
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – connect to firehose delivery stream

And for source, use direct PUT

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect to firehose delivery stream
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – connect to firehose delivery stream

For the next step, you can choose to transform the record, but we are not discussing that in this post. Instead, disable transformation and proceed.

In the next step, choose the folder you had created in Amazon S3

We always recommend compressing the files you put in S3. In this case, you can choose Snappy (pretty good). You can also choose to ignore compression on this next page.

Wait for a bit and the Amazon Firehose stream would be created and ready for you.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect to firehose delivery stream

Next, go back to Amazon Kinesis and connect to the destination you just created (the Amazon Kinesis Data Firehouse), choose the in-application stream you had created in the steps before and proceed.

Hospital Call Center Real Time Reporting - Kinesis Data Analytics - connect to firehose delivery stream
Hospital Call Center Real Time Reporting – Kinesis Data Analytics – connect to firehose delivery stream

You are now ready to go. As the continuous filter runs and produces results (i.e. your call center agents are working), these results will show up in your Amazon S3 bucket you created before.

Once you have your results in the Amazon S3 bucket, you can query it in your web application using Amazon Athena as well (super cheap to use).

Now, let’s achieve something similar with Amazon Quicksight

Amazon QuickSight is a powerful application for real time business intelligence. What’s more? It charges you for usage ONLY.

In this case, let’s go back to the Amazon Kinesis Data Stream you had created before. You can also create a brand new data stream if you want to experiment with these two methods. 

For our purposes, let’s create a brand new Amazon Kinesis data stream. 

Once you create a Kinesis data stream, you will see both producers and consumers in your data stream like below.

Hospital Call Center Real Time Reporting - kinesis producers consumers
Hospital Call Center Real Time Reporting – kinesis producers consumers

Next, let’s create a consumer that’s an Amazon Kinesis Data Firehose (the button that says “Process with delivery stream”).

Hospital Call Center Real Time Reporting - kinesis
Hospital Call Center Real Time Reporting – kinesis Data Firehose

So, effectively, you are taking the stream of data that Amazon Connect contact center is producing (Btw, do note that Amazon Connect produces multiple logs namely agent logs, contact flow logs, contact trace records logs etc), and you are storing them for further analysis. Your analysis could be real time or historical – each has to be treated differently.

What you want to do is to flatten those json files that Amazon Connect contact center CTR records produces.

Again, in this case, you can choose to not “Transform source records with AWS Lambda“. In this case, you are sending the raw data stream logs to Amazon S3. 

If you choose not to transform source records with AWS Lambda at the firehose level itself, you can flatten those files once they hit the S3 bucket. You will have to do this with an AWS Lambda that is triggered when the file hits the Amazon S3 bucket.

For the moment, let’s send these CTR log files to Amazon S3.

In your Amazon Kinesis Firehose delivery stream, make sure that you select the right Kinesis data stream for contact trace records

Hospital Call Center Real Time Reporting - kinesis contact trace records
Hospital Call Center Real Time Reporting – kinesis contact trace records

That’s the same one you are going to use in your Amazon Kinesis Firehose delivery stream.

Hospital Call Center Real Time Reporting - kinesis contact trace records
Hospital Call Center Real Time Reporting – kinesis contact trace records

This will log to a bucket of your choice. You can choose prefixes – e.g. fh_logs/ and fh_error_logs/ for your logs and error logs. The slash is needed if those are going to be directories. If you want to simply prepend a prefix you can choose fh_logs_ and fh_error_logs_ OR you can leave this entirely blank.

Place some test calls and answer your own calls to test this out.

Confirm that you do receive log files in the bucket you created. E.g.

Hospital Call Center Real Time Reporting - kinesis to Amazon S3

You can quickly query any of those files with Amazon S3 Select to see the output of the file

Hospital Call Center Real Time Reporting -query with S3 select
Hospital Call Center Real Time Reporting -query with S3 select

Thereafter choose JSON as input and output formats

Hospital Call Center Real Time Reporting -query with S3 select
Hospital Call Center Real Time Reporting -query with S3 select

Note that this is not a flat format – rather in JSON structured data format

Hospital Call Center Real Time Reporting -query with S3 select
Hospital Call Center Real Time Reporting -query with S3 select

So, your next step is to flatten these files. To do this, you will create a lambda function and associate it with a trigger. The trigger will be that when a file is added to your S3 bucket via a PUT operation, it will flatten the file and will write it back to the same Amazon S3 bucket.

You can use any language you are comfortable with. 

Here’s a great blogpost with the complete code.

Hospital Call Center Real Time Reporting - flatten the files
Hospital Call Center Real Time Reporting – flatten the files

All this does is to take the nested directory structure that Amazon Kinesis puts the CTR records in, within Amazon S3 and flattens it to the flatfiles directory. That’s about it.

This makes it increasingly easier for Amazon Glue to crawl the flatfiles directory and make any schema discovery and schema changes / updates if and when discovered.

Whoa wait – Amazon Glue? For what?

Simple – we are going to use Amazon Glue to discover a schema from the giant JSON that the Amazon Connect Call center CTR records are in. Schema changes can and do occur – that’s why this is not a one time thing. Keep in mind that Amazon Connect Contact center CTR attributes allow you to create multiple custom options based on whatever call flow you have decided. So, when this happens, you need to capture this information to flatten it out. 

These CTR attributes are just key value pairs, so instead of traversing through a giant list of key value pairs, you can use Glue crawler to discover the updated schema and update your database table with the new schema as well. 

That’s why we use Amazon Glue here.

This doesn’t mean that you run Amazon Glue crawler all the time. You can trigger the Amazon Glue crawler via events. So, based on CTR attribute change events, you trigger the AWS Glue crawler, discover and update the schema / database tables. That’s it.

So, back to the Lambda function you created just now. Next step is to make sure that it triggers on appropriate events – i.e. when a file lands in the CTR bucket you created in S3.

Hospital Call Center Real Time Reporting - trigger for the lambda
Hospital Call Center Real Time Reporting – trigger for the lambda

Once you have done this, make some calls to and from your number. You will see ctr records being created in the S3 bucket you created above. You will also see an additional folder and files inside that folder

Hospital Call Center Real Time Reporting - validate the S3 files
Hospital Call Center Real Time Reporting – validate the S3 files

Your next step is to create an AWS Glue Crawler. A crawler connects to a data store, progresses through a prioritized list of classifiers to determine the schema for your data, and then creates metadata tables in your data catalog. 

Go ahead and create an AWS Glue crawler.

Hospital Call Center Real Time Reporting - AWS Glue crawler set up
Hospital Call Center Real Time Reporting – AWS Glue crawler set up

See above for the configuration that you would need to create.

Keep in mind that your Glue crawler ETL job really does not need to crawl ALL the files for eternity. It just needs to crawl the latest files to find schema changes, so make sure you set a lifecycle policy on your flatfiles folder to something short – e.g. 1 day or 2 days (there are LOTs of files – albeit small).

Run the crawler after creating it. If all goes well, the table will show up in AWS Glue (and you can view the data / contents using AWS Athena). 

If there are any errors, check CloudWatch for the possible errors

Hospital Call Center Real Time Reporting - AWS Glue crawler set up
Hospital Call Center Real Time Reporting – AWS Glue crawler set up

If you do not like the schema that Amazon Glue has inferred / discovered for you, you can edit the schema as well

Hospital Call Center Real Time Reporting - AWS Glue crawler edit schema
Hospital Call Center Real Time Reporting – AWS Glue crawler edit schema

Next, go to Amazon Athena and find this database and the table.

In all probability, it will look something like this

Hospital Call Center Real Time Reporting - AWS Glue crawler edit schema
Hospital Call Center Real Time Reporting – AWS Glue crawler edit schema

Note that this table still has nested JSONs as various columns.

You could store the files in this format as well, but we recommend transforming these files into parquet format from the JSON format that it is currently in. 

If you modify the files to parquet format, the storage is optimized a lot AND on top of it, athena queries become infinitely easier to run (much like regular SQL rather than running UNNEST commands that are typical of PrestoDB.

One HUGE benefit of using Amazon Athena is that you only pay for the queries you run 🙂 We LOVE it.

Keep in mind that you want to store call logs for an extended period of time because you want to perform historical analysis / reporting. Meanwhile, you want the latest (maybe the last 15-30 mins) data to perform “real time” reporting as well.

After you have data in the flatfiles folder, you can use AWS Glue to catalog the data and transform it into Parquet format inside a separate folder. In this case, the AWS Glue job performs the ETL that transforms the data from JSON to Parquet format. However, do keep in mind that jobs cannot be run faster than 5 mins. So, that’s a limitation you need to be aware of and work around / work with.

Considering that this is not a real time stock trading application, you can get away with processing data every 5 mins.

Great, so your next step would be to (again) use another AWS Glue crawler to crawl through this parquet directory and create a table for you.

You have already created a crawler before, so this shouldn’t be a problem for you.

Go ahead and create a Glue Job to transform your JSON files in the flattened directory to parquet format.

Hospital Call Center Real Time Reporting - AWS Glue Job create
Hospital Call Center Real Time Reporting – AWS Glue Job create

We would advise you to use AWS Glue Studio to visually create and monitor jobs

Hospital Call Center Real Time Reporting - AWS Glue Job create
Hospital Call Center Real Time Reporting – AWS Glue Job create

And use these parameters to drive the job

Hospital Call Center Real Time Reporting - AWS Glue Job create
Hospital Call Center Real Time Reporting – AWS Glue Job create

Click on Advanced Properties dropdown and fill in the details. We tend to collocate our work logically in a single bucket, but you can choose to do this however it works for you.

You will notice that the AWS Glue job is ready to be run. You can click on the Script tab to fill in the details. 

Hospital Call Center Real Time Reporting - AWS Glue Job create
Hospital Call Center Real Time Reporting – AWS Glue Job create

The entire script is available on AWS Blog

Keep in mind that this script does a couple of things

  1. It waits for the first AWS Glue crawler to finish running.
  2. Then it uses relationalize to flattens the nested json attributes of the data
  3. Then, it removes fields with null values
  4. Then it deletes the repeated records using distinct
  5. It also turns column names to lowercase – this follows Athena Best Practices (Hive ones)
  6. Finally, the result data is sent to the target

Go ahead and run this first crawler. Run the job to try it out. If there are errors, you will find them in the AWS Cloudwatch error logs (see link). 

If there are no errors, you will find the ctr files now available in the parquet/ctr bucket you had created.

Hospital Call Center Real Time Reporting - AWS Glue Job validate parquet outputs
Hospital Call Center Real Time Reporting – AWS Glue Job validate parquet outputs
Hospital Call Center Real Time Reporting - AWS Glue Job validate parquet table
Hospital Call Center Real Time Reporting – AWS Glue Job validate parquet table

Next up, you can create a trigger and schedule it to run every 5-10 mins.. And have it kick off the AWS Glue crawler.

Hospital call center reporting - edit AWS Glue trigger
Hospital call center reporting – edit AWS Glue trigger

This trigger is going to kick off the parquet transformation job you had created.

Hospital call center reporting - AWS Glue trigger your crawler
Hospital call center reporting – AWS Glue trigger your crawler

Keep in mind that the script in that transformation job starts the source crawler at this line.. glue.start_crawler(Name=sourcecrawler) . The sourcecrawler is what you fed the script. In our case, it was “nengage-ccp-crawler”. 

Schedule it every 5-10 mins (example) 0/10 13-22 ? * MON-FRI *

Keep in mind that the cron is in UTC timing (hence the 13-22)

Verify that your crawler is running

Hospital call center reporting - AWS Glue trigger your crawler
Hospital call center reporting – AWS Glue trigger your crawler

This crawler, as you recall, crawls the flatfiles folder in your S3 bucket to discover changes to schema (if any).

Typically you would see this output if you haven’t made any changes

Hospital call center reporting - AWS Glue trigger your crawler
Hospital call center reporting – AWS Glue trigger your crawler

After running this crawler, the transform job next updates the parquet files in your destination path – /parquet/ctr within the S3 bucket you had created.

Hospital call center reporting - AWS Glue trigger your crawler
Hospital call center reporting – AWS Glue trigger your crawler

After this, it kicks off the results crawler – which in our case was the “nengage-ccp-parquet-crawler”. This crawler, if you recall, crawls through the parquet files created by AWS Glue job and infers schema for the parquet formatted CTR data.

So, if there were any updates to the schema, you would see the updates reflected in the parquet table as well.

So now, you have 

  1. Captured CTR logs of your Amazon Connect Contact center instance via an Amazon Kinesis Data stream (real time).
  2. You have created an Amazon Kinesis Firehose data delivery stream to take the Kinesis stream of CTR records and delivered the file to an Amazon S3 bucket of your choice.
  3. You have created a lambda function that takes the files from the deep folder structure in the Amazon S3 bucket and moves them to a flat directory called flatfiles.
  4. An AWS Glue crawler was created to take the files, infer the schema, create a table for you. This table is accessible to you in Amazon Athena. In our case, that table was called ccp_flatfiles.
  5. You have created an AWS Glue job cataloging the data and transforming it into Parquet format. After cataloging, AWS Glue places this data inside a separate AWS S3 bucket – e.g. parquet/ctr.
  6. You created another Glue crawler to take the parquet files, infer the schema, and create a table for you. This table is also accessible to you in Amazon Athena.

So, why all this when Amazon Connect gives you reporting in its console itself?

As call center managers we want to report on the following in chart format and be able to switch to table formats as well.

Call center managers need to be able to add any of these small widgets to their dashboard so they can pick and choose what they want to see and when. Call center managers should be able to save their views as well. This way, if they create a custom dashboard, they can visit it anytime they want.

All the data we want is already there and is presented by Amazon Connect in Amazon Connect’s own reports as well. Their reports are tabular and a bit harder to understand/digest. Our call center teams seek visual reports and simplicity – hence this initiative.

Amazon Connect Wallboard (real time)

The most important thing for call center managers is a wallboard – both on mobile and desktop.

The wallboard shows us a snapshot of how our call center is performing.

Incoming number widget

The business has multiple phone numbers that patients call. This shows the calls received per such phone number. E.g. The agents have their own phone numbers (DIDs), plus the business has additional numbers for each location.

Agent Status widget

This shows the status of agents in real time. This is a pie chart with the following data: Incoming, On contact, ACW (after call work), Missed.

Queue Status widget

This shows the status of all our queues in real time. There are multiple queues and we will know on which queues how many agents are Online, how many are On contact (talking to callers), how many agents are in NPT (non productive state), how many agents are in ACW(after call work), how many queues have errors, how many queues are Available and how many queues are Staffed.

Contacts On Hold / In Queue widget 

This shows the status of callers (contacts) that are in queue in real time. These contacts could be in any queue. This is a bar chart with Queue name, contacts in queue. 

Queued callbacks widget

This tells us all the callbacks across queues that are waiting for an agent to be freed up. 

Calls handled widget

This tells us all the top agents (maybe 5?) that have handled the maximum number of calls today.

Oldest contact widget

This tells us the contact that has been in the queue for the longest time (in real time). This also compares this against the longest a caller had to wait today.

Calls Received, Answered and Abandoned widget

This tells us the total calls received so far, answered so far and abandoned so far today

Calls AHT (average handling time) widget

This tells us the average handling time across all agents for today’s calls. This widget also shows us the longest call and the shortest call time.

SLA today widget

This is a pie chart that breaks down the service levels (SL) into SL 60 secs, SL 15 secs, SL 20 secs, SL 25 secs, SL 30 secs, SL 45 secs, SL 90 secs, SL 120 secs, SL 180 secs, SL 240 secs, SL 300 secs, SL 600 secs.

Call Types Widgets

This tells us the kind of calls we have gotten / made all day. E.g. How many billing related calls, how many pharmacy related calls, how many appointment related calls etc. For each call type, it tells us the received / made (inbound vs outbound), answered / connected to (inbound vs outbound).

This is driven by the Contact Lens rules set up. Automatically categorize contacts based on uttered keywords and phrases – Amazon Connect

Call Issue Widget

This is driven by using About issue/call driver detection in Contact Lens – Amazon Connect. This shows us the issues that callers are calling about (grouped issues).  

Call volumes widget

This tells us (until now) how many calls we received per 15, 30, 60 mins for inbound calls. This tells us the same for outbound calls as well.

Call sentiment widget

This tells us (until now) the average sentiment score for all calls. This tells us the same for outbound calls as well. The widget shows average and highest, lowest scores. This uses Contact Lens entirely (eg even About loudness scores in Contact Lens – Amazon Connect

Amazon Connect Historical Reporting

This can be plotted for a maximum of 1 year at a time (choosing custom timeframe) and can be compared against the same time length for the “previous period” (as in Google analytics)

Amazon Connect reporting periods - inspired by Google Analytics
Amazon Connect reporting periods – inspired by Google Analytics

Agent Daily Summary Widget

It shows the agent state, state duration, calls answered, TOTAL talk time, average talk time, total work time, average work time per hour, outbound calls and average outbound talk time. Outbound calls are the calls made by the agent manually to internal and external numbers. Internal numbers (later on) will be to Amazon Chime numbers.

Agent & Team Daily Performance Comparison Widget

This will compare ANY agent that you choose from a dropdown and compare against the average numbers of all the agents for the day.

Day break down widget

  • After contact work time
  • Agent on contact time
  • Agent idle time
  • Online time
  • Nonproductive time
  • Average queue abandon time
  • Average after contact work time
  • Average queue answer time
  • Average handle time
  • Average customer hold time
  • Average agent interaction and customer hold time
  • Average agent interaction time
  • Agent answer rate

Contacts breakdown widget

Contacts handled

  • Incoming
  • Outbound
  • Callback
  • Missed
  • Average Handle time

Contacts abandoned 

  • Total
  • Abandoned in 15, 20, 25, 30, 45, 60, 90, 120, 180, 240, 300, 600 seconds

Contacts agent hung up first

Contacts put on hold, Customer hold time

Contacts hold disconnect

  • Contacts hold agent disconnect
  • Contacts hold customer disconnect

Contacts answered 

  • Total
  • Answered in 15, 20, 25, 30, 45, 60, 90, 120, 180, 240, 300, 600 seconds

Contacts queued

  • Total
  • Maximum queued time

Contacts transferred 

  • In, In from queue 
  • Out, out external, out internal, out from queue

Service level 

  • Avg 
  • SL in 15, 20, 25, 30, 45, 60, 90, 120, 180, 240, 300, 600 seconds

Online time

Agent interaction and hold time

Call sentiment

Call non-talk time

Call Issues handled

This is driven by using About issue/call driver detection in Contact Lens – Amazon Connect. This shows us the issues that callers are calling about (grouped issues).

Agent & Team Performance Comparison Widget

This shows the performance of the whole team and allows you to break it down per team. Team definition depends on the team leader (combination of agents). It allows you to break it down per routing profile. 

Daily break down widget

  • After contact work time
  • Agent on contact time
  • Agent idle time
  • Online time
  • Nonproductive time
  • Average queue abandon time
  • Average after contact work time
  • Average queue answer time
  • Average handle time
  • Average customer hold time
  • Average agent interaction and customer hold time
  • Average agent interaction time
  • Agent answer rate

Contacts breakdown widget

Contacts handled

  • Incoming
  • Outbound
  • Callback
  • Missed
  • Average Handle time

Contacts abandoned 

  • Total
  • Abandoned in 15, 20, 25, 30, 45, 60, 90, 120, 180, 240, 300, 600 seconds

Contacts agent hung up first

Contacts put on hold, Customer hold time

Contacts hold disconnect

  • Contacts hold agent disconnect
  • Contacts hold customer disconnect

Contacts answered 

  • Total
  • Answered in 15, 20, 25, 30, 45, 60, 90, 120, 180, 240, 300, 600 seconds

Contacts queued

  • Total
  • Maximum queued time

Contacts transferred 

  • In, In from queue 
  • Out, out external, out internal, out from queue

Service level 

  • Avg 
  • SL in 15, 20, 25, 30, 45, 60, 90, 120, 180, 240, 300, 600 seconds

Online time

Agent interaction and hold time

Call sentiment

Call non-talk time

Call Issues handled

This is driven by using About issue/call driver detection in Contact Lens – Amazon Connect. This shows us the issues that callers are calling about (grouped issues).

Agent Login/Logout reports widget

It includes all the login time during the day even though the agent has logged out and logged back in several times. This is already a report in Amazon Connect. 

Average FTEs Hourly Widget

Average number of FTEs based on the login time of the selected agents on each hour. This is a weighted average using total FTEs logged in at each hour

Overall Daily Agent Efficiency Widget

Percentage of the time selected agents spent efficiently during their logged in time. Efficiency is based on the criteria configured by the team leaders and assigned to each team. Efficiency might be defined by a team leader as NPT (non productive time) being below 10%.

Calls Answered Heat Map Widget

Heatmaps are used to analyze the indicators for the quarter and YTD period for each hour in the days of the week. The threshold bands might be 60%-80% and this would be defined by the team leader. Below 60% shows in red and 60-80% shows in orange.

There are two levels of this report

  1. Team level
  2. Individual agent level compared against the team level

Resolution on first call analysis widget

Customers or patients call the call center multiple times a day if their initial query is not resolved. There might be valid reasons why the customer has to call back multiple times a day. If the team leader defines the max callback threshold to be 2 and if the customer calls back more than twice a day, then this is a red flag as the call is not resolved on first contact. This is shown as a bar chart per hour.

SPAM calls widget

Calls that are marked as spam and dropped are shown as a widget per hour/day/month.

Year on Year Performance Analysis widgets

All the widgets can be compared on a separate web page as a YoY basis. The call center manager can choose any number of widgets and comparison periods to do a YoY Analysis 

Amazon Connect reporting architecture

Contact Trace Record (CTR) streaming architecture 

AWS Cloud Amazon Connect → Amazon Kinesis CTR → Amazon Kinesis Data Firehose CTR → Amazon S3 bucket CTR 

Data model: Contact trace records (CTR) data model – Amazon Connect 

Records delayed by ~120 seconds

Amazon Connect reporting architecture for contact trace records - as recommended by Amazon architects
Amazon Connect reporting architecture for contact trace records – as recommended by Amazon architects

Agent events streaming architecture

AWS Cloud Amazon Connect → Amazon Kinesis AE → Amazon Kinesis Data Firehose AE → Amazon S3 bucket AE 

Records delayed by ~60 seconds

Data model: Amazon Connect agent event streams – Amazon Connect

Amazon Connect reporting architecture for Agent Events records - as recommended by Amazon architects
Amazon Connect reporting architecture for Agent Events records – as recommended by Amazon architects

Contact flow logs CFL streaming architecture

AWS Cloud Amazon Connect → Amazon Cloudwatch CFL → Amazon Lambda CFL → Amazon Kinesis Data Firehouse CFL→ Amazon S3 bucket CFL

More info Enable contact flow logs – Amazon Connect

Amazon Connect reporting architecture for Call Flow Logs records - as recommended by Amazon architects
Amazon Connect reporting architecture for Call Flow Logs records – as recommended by Amazon architects

Overall Architecture To Query And Visualize Connect Data

Amazon Quicksight connects with Amazon Athena. Amazon Athena has out of the box connectivity with AWS Glue. AWD Glue allows you to create CTR, AE and CFL tables very easily. AWS Glue is connected out of the box with Amazon S3 bucket CTR/AE/CFL.

When you use our product, these AWS products will be automatically configured within your own account (not our account).

Amazon Connect reporting architecture - as recommended by Amazon architects
Amazon Connect reporting architecture – as recommended by Amazon architects