AWS Contact Center
Pause and resume call recording with a new API in Amazon Connect
Often, companies choose to record contact center calls for agent compliance, call quality, and training purposes. With Amazon Connect, call recordings are stored into an Amazon S3 bucket, which companies can view later to use for any of the above. However, when an agent handles sensitive customer information it is common practice to not record this portion of the call.
With today’s launch of Amazon Connect’s pause and resume call recording API, call center operators and agents can help support compliance with regulatory standards and by not storing sensitive data as part of a call recording. This blog post walks you through the capabilities of the new API. We will also provide an example of how to expose this pause and resume recording feature to agents in a contact control panel (CCP).
Example overview
Walkthrough
- The customer calls the business and is prompted to choose if call should be recorded.
- The customer is put into a queue and connected to an agent.
- The agent can start, pause, resume, and stop the call recording from the custom contact control panel by pressing buttons that trigger an Amazon API Gateway endpoint. This invokes an AWS Lambda function.
- The Lambda function processes the request and calls the Amazon Connect API to start, pause, resume, or stop the call recording.
Note: All resources must be created in US East (N. Virginia) Region.
Prerequisites
- AWS account
- An existing Amazon Connect instance
- Access to the following AWS services:
- AWS Identity and Access Management (IAM) with access to create policies and roles
- Amazon CloudFront with access to create a distribution
- Amazon S3 with access to create buckets
- AWS Lambda with access to create functions
Deploying this example using an AWS CloudFormation template
This AWS CloudFormation stack creates an Amazon S3 bucket with the appropriate agent desktop and CCP file. A CloudFront distribution to serve the files from S3, an API Gateway deployment, and a Lambda function to start, pause, resume, or stop the call recording.
To deploy this AWS CloudFormation stack:
- Sign in to AWS CloudFormation in US East Region.
- Launch the AWS CloudFormation stack here: .
- Enter the name you want to give under Stack Name, this has to be unique.
- Enter the name of a new S3 bucket that the template will create. This is where you will be storing the custom agent desktop files in Amazon CloudFront.
- Your entries should look similar to below picture.
- Click on the check box “I acknowledge that AWS CloudFormation might create IAM resources.”
- Click on the “Next” button.
- AWS CloudFormation template takes 15-30 minutes to create all the resources and should show the status as “CREATE_COMPLETE”. You might have to wait for another 15-20 min for Amazon CloudFront to complete its deployment of the agent desktop after the status “CREATE_COMPLETE”.
Deploy a sample contact flow to record calls
This contact flow asks you to press 1 to record calls or press 2 to not record the call.
- Download the contact flow JSON file to your local drive.
- Log in to your Amazon Connect instance as an administrator that can create and update contact flow.
- Choose Routing by clicking on the three arrowheads icon on the left bar and then click contact flows.
- Click on the Create contact flow button.
- Click on the drop-down arrow on the right and choose Import flow (beta).
- Click on Select and choose the JSON contact flow file that you downloaded.
- Name your contact flow and click Publish, it should look like the following.
- Assign this contact flow to a phone number under Routing, Phone number.
Launching the deployed agent desktop for Amazon Connect
- Continue on your AWS CloudFormation stack that you just created, choose “Outputs”.
- Click on the “Value” for “CloudfrontEndpoint”, which is a URL to your custom agent desktop.
- Add the domain portion of the URL in “Value” for “CloudfrontEndpoint” to your Amazon Connect instance following this instruction.
- The “Outputs” should look like the following:
- After launching the URL, you should see the custom agent desktop like this:
- Log in to your Amazon Connect instance as a user that can take call.
Testing the start/stop, pause/resume call recording API
The following API is used in the example
Two scenarios to show case all four call recording APIs
- Pause and resume call recording when call recording has already started.
- Start call recording when call recording has not started. Then stop call recording to disable call recording for the rest of the call.
Pause and resume call recording when call recording has already started
- Call into the phone number that has the above contact flow assigned.
- Press 1 to enable call recording and enter into queue.
- Have agent login to take the call.
- You should see the “Recording status” light is flashing red.
- Say something between the agent and caller so it will be recorded.
- Pause the recording using the button.
- This calls the SuspendContactRecording API using the AWS API Gateway via AWS Lambda.
- Say something between agent and caller, this part of the conversation is not recorded.
- Resume the recording using the button
- This calls the ResumeContactRecording API using the AWS API Gateway via AWS Lambda.
- Say something to wrap up the call as this part of the conversation should be recorded.
- End the call.
- Go to Amazon Connect console screen and go under Metrics and Quality -> Contact Search.
- Click on search to find your call and click on the playback button. You should hear hear silence where the recording was paused.
Start recording after taking the call
- Call into the phone number that has the above contact flow assigned.
- Press 2 to not record the call and enter into queue.
- Have agent login to take the call.
- You should see the “Recording status” light is not flashing red.
- Say something between the agent and caller and this part of the conversation is not recorded.
- Start the recording using the button.
- This calls the StartContactRecording API using the AWS API Gateway via AWS Lambda.
- Say something between the agent and caller and this part of the conversation is recorded.
- Stop the recording using the button.
- This calls the StopContactRecording API using the AWS API Gateway via AWS Lambda.
- Say something between the agent and caller and this part of the conversation is not recorded.
- End the call.
- Go to Amazon Connect console screen and go under Metrics and Quality -> Contact Search.
- Click on search to find your call and click on the playback button for recording to hear the expected results. You should hear the portion of the recording where you start and stop it. You should not hear any silent before or after.
Conclusion
In this post you learned about the recording APIs available in Amazon Connect and launched an example stack using them. The example code used in this blog is posted in this repository for reference. You can now add call recording control logic into your business applications as agent perform certain tasks that require the call recording to pause and resume upon completion.