AWS Partner Network (APN) Blog

Presidio Builds Conversational Bots Using Amazon Lex and the Amazon Chime SDK

By Joey Kilpatrick, Cloud Engineer – Presidio
By Rick Anderson, Cloud Architect – Presidio
By Satish Pallapotu, Engineering Director, CX – Presidio


With the rise of voice assistants like Amazon Alexa, customer expectations for handling inquiries and transactions have shifted from the outdated phone keypad, also known as dual tone multi-frequency (DTMF), to modern conversational AI that enables machines to communicate with human beings.

Conversational AI—which leverages natural language understanding (NLU)—is the brain that powers a virtual agent or chatbot. To stay ahead of the competition, businesses must quickly adapt to this new technology.

But replacing telephony hardware with modern infrastructure can be expensive and time-consuming. Businesses today are looking for ways to implement conversational AI without a significant lift and shift of the current voice and telephony system.

To meet these challenges, Presidio—a leading global digital systems integrator and an AWS Premier Tier Services Partner—is implementing conversational bots for calls to or from a public telephone network using Amazon Chime SDK integration with Amazon Lex.

Leveraging this integration capability from Amazon Web Services (AWS), Presidio can deliver a sophisticated self-service experience, including virtual contact center agents and interactive voice response (IVR) solutions that use Session Initiation Protocol (SIP) for voice communications. This can help businesses drive revenue, decrease churn, eliminate customer frustration, and increase customer satisfaction.

With a full range of consulting, assessment, planning, and implementation services across different industry verticals, Presidio helps companies shape their customer’s journey using conversational AI to improve the key performance metrics of the contact center.

In this post, we demonstrate how Presidio implemented conversational AI to check the wait time and reserve a table at a restaurant using Amazon Chime SDK, Amazon Lex, and Amazon Polly.

Solution Overview

The Presidio team built a solution using the Amazon Chime SDK public switching telephone network (PSTN) service and Amazon Lex. The results demonstrate the flexibility and seamless integration of PSTN, Amazon Chime SDK, Amazon Lex, and Amazon Polly. Integration with Amazon Polly makes it easy to create applications that turn text and numerical data into life-like speech; which can then be played to a caller.

In addition to Amazon Lex and Amazon Polly, the team successfully implemented Amazon Voice Focus, which uses machine learning (ML) to reduce unwanted noise on PSTN audio calls, such as wind, fans, running water, lawnmowers, barking dogs, typing, and papers shuffling. This improves the caller experience in customer service conversations.

Use Case

On busy nights, fifty percent of the calls to Bob’s Restaurant (a fictitious company) were from customers asking about the wait time to be seated. Callers often experienced long hold times while staff was serving customers and taking other calls.

The restaurant’s goal was to reduce caller hold times and limit the number of calls that staff needed to answer during busy times.

Their solution was to create a self-service IVR that tells customers the wait time for their party size and allows them to choose their seating preference. Once they knew the wait time, callers can choose to add themselves to the waitlist and/or be transferred to the restaurant for further questions.


Figure 1 – Solution call flow.

The sample code for this solution can be found on our GitHub repository. When a call is received, the solution does the following:

  • The Amazon Chime SDK connects the incoming call, using text-to-speech audio from Amazon Polly to greet the caller.
  • The Amazon Chime SDK connects the caller to Amazon Lex to gather information.
  • Amazon Lex gathers the necessary information from the caller, gets the wait time, and passes relevant information back to the Amazon Chime SDK.
  • The Amazon Chime SDK either concludes the call or initiates an outbound call to another SIP application, which simulates the front desk.


Figure 2 – Solution architecture.

How it Works

Incoming calls are handled by an Amazon Chime SIP media application which controls the flow of the call and connects to other AWS services. The SIP media application is driven by an AWS Lambda function that receives inbound call information and responds with actions for the Amazon SIP media application to perform:

  • Speak: Tells the Amazon Chime SDK to use Amazon Polly to generate spoken audio from a text prompt. Then, the audio is played back to the caller.
  • StartBotConversation: Tells the Amazon Chime SDK to start a new session with a given Amazon Lex bot. The caller will hear audio from the Amazon Lex bot and will be able to respond verbally or with input from their keypad (DTMF) until the conversation with the Amazon Lex bot completes. Once the conversation ends, the Amazon Chime SDK will invoke the SIP media application AWS Lambda function with data from the Amazon Lex bot conversation, such as slot values and session attributes.
  • CallAndBridge: Tells the Amazon Chime SDK to create a new SIP connection with a given PSTN endpoint. Both legs of the call (the caller to the Amazon Chime SDK and the Amazon Chime SDK to the new PSTN endpoint) will join. Custom data can be added to the SIP request through SIP headers.
  • VoiceFocus: Tells the Amazon Chime SDK to turn on/off the Voice Focus feature, reducing background noise on the call.
  • Hangup: Tells the Amazon Chime SDK to end the call.

To create a SIP media application that plays a prompt back to the user with Amazon Polly when the call begins, use the Speak action. Figure 3 below shows an example of JavaScript code that responds with a Speak action when it receives a NEW_INBOUND_CALL event.


Figure 3 – Code snippet for the Speak action. 


The use case in this post shows how the Amazon Chime SDK PSTN service can be used for building powerful conversational AI using natural language voice agents and seamless integration with the existing voice and telephony system.

Many leading companies trust Presidio to run their essential customer-facing platform because of their demonstrated ability to carry out a turnkey solution. Leveraging their boutique capabilities and experience with contact centers, Presidio’s unique suite of services and tools help customers migrate from their on-premises contact center solution to the cloud.

For more information about our capabilities or if you would like to work with us, please contact us or visit the website. We can help you leverage the technology and the development patterns showcased in this post to implement solutions that enable IVR menus and augment cloud-based or on-premise call centers, without needing to replace the entire infrastructure for call routing.

To learn more, read these additional resources:

The content and opinions in this blog are those of the third-party author and AWS is not responsible for the content or accuracy of this post.


Presidio – AWS Partner Spotlight

Presidio is an AWS Premier Tier Services Partner and leading IT services and solutions provider that helps customers accelerate time-to-outcome via agile digital platforms, with technology expertise across cloud, security, modern IT infrastructure, and networking.

Contact Presidio | Partner Overview | AWS Marketplace