Business Productivity
Video-Call Escalation powered by Amazon Connect and Amazon Chime SDK
In late 2019 and early 2020, the concept of a “routine” shifted overnight in both professional and personal arenas. Terms like “social distancing”, “shelter at home”, and “quarantine” have become mainstream buzzwords, and many jobs normally accomplished in an office have moved to virtual settings. Making agents accessible through multiple channels (such as voice, chat, and video) without imposing downloads or additional requirements has become critical for businesses trying to maintain a high standard for customer service.
In this blog, we will teach you to deploy a video, audio, and screen share enabled chat interface for contact center agents on Amazon Connect in addition to a browser-based participant interface that can be used as a standalone site or integrated into existing company website.
Overview
This solution will help you enable Video Communication in a Contact Center environment. We are using Amazon Connect, and Amazon Chime SDK.
Walkthrough
On a high level, the solution consists of five components, each contained in a separate folder.
- agent-app – web based (React) agent application, including Amazon Connect Streams API and Amazon Chime SDK
- demo-website – a demo webpage for customers, including Amazon Connect Chat SDK and Amazon Chime SDK
- cdk-stacks – AWS CDK stacks:
- cdk-backend-stack with all the backend resources needed for the solution (AWS Lambda, Amazon API Gateway, Amazon Cognito etc)
- cdk-frontend-stack with front-end resources for hosting both agent-app and demo-website (Amazon S3, Amazon CloudFront distribution)
Prerequisites
- AWS Account
- AWS IAM user with Administrator permissions
- Amazon Connect instance (SSO/SAML enabled)
- Node and NPM installed and configured on your computer
- AWS CLI installed and configured on your computer
- AWS CDK installed and configured on your computer
Solution setup
This step assumes you have completed all the prerequisites, and you have an existing Amazon Connect instance, SSO/SAML enabled.
Creating and Customizing the Solution:
- Clone the solution to your computer (using git clone) https://github.com/amazon-connect/video-call-escalation
- Import Amazon Connect Contact Flows
- Log into your Amazon Connect console, as Admin
- From the main menu, select Routing -> Contact Flows
- Click the drop-down button next to Create contact flow, and select Create customer queue flow.
- Click the drop-down button next to Save, and select Import flow
- Browse to solution’s ConnectContactFlows folder and select VideoCallEscalationQueue file
- Save and Publish the contact flow
- Navigate again to Routing -> Contact Flows
- Click Create contact flow button
- Click the drop-down button next to Save and select Import flows
- Browse to solution’s ConnectContactFlows folder and select VideoCallEscalationChat file
- Save and Publish the contact flow
- Check Command Line Interface (AWS CLI)
- AWS CDK acquires its authorization from the AWS CLI credentials based on the specific associated region.
- Confirm that your AWS CLI configuration aligns to your desired output by running an AWS CLI command
(example command to see configuration:aws s3 ls
) - You can also use profiles (i.e.
export AWS_PROFILE = yourProfile
) - You can confirm the configured region with
aws ec2 describe-availability-zones --output text --query 'AvailabilityZones[0].[RegionName]'
- Install NPM packages
- Open your Terminal and navigate to video-call-escalation/cdk-stacks
- Run
npm run install:all
- This script goes through all folders of the solution and installs necessary packages
- Make any desired modifications to the background image or chat icon image shown below.
- Navigate to the demo-website/src folder and import/upload your revised images.
- Make sure to maintain the same naming convention image format and extension
- For chat icon: replace chat-video-button.png
- Navigate to the demo-website/src folder and import/upload your revised images.
-
-
-
- For chat icon: replace chat-video-button.png
-
-
Configuring and Deploying the Solution:
- Configure CDK stacks
- In your terminal, navigate to video-call-escalation/cdk-stacks
- To see the full instructions for the configuration script, run
node configure.js -h
- For the purpose of this guide, start the configuration script in interactive mode
node configure.js -i
- When prompted, provide the following parameters:
- connect-instance-arn: Amazon Connect instance ARN that solution will use
- connect-instance-url: Amazon Connect instance URL that solution will use
- connect-default-contact-flow-id: Amazon Connect Contact Flow Id for the Contact Flow to be started when a new Chat contact is initiated (video-call-escalation Chat Flow Id).
- cognito-domain-prefix: Amazon Cognito hosted UI domain, where users will be redirected during the login process. The domain prefix has to be unique.
- agent-api-allowed-origins: Allowed Origins for agent-side APIs, please keep * at this point, we will come back to it once our front-end is deployed.
- website-api-allowed-origins: Allowed Origins for (demo-)website-side APIs, please keep * at this point, we will come back to it once our front-end is deployed.
- cognito-saml-enabled: for the purpose of this guide, set this parameter to false
- cdk-pipeline-enabled: for the purpose of this guide, set this parameter to false
- The script stores the deployment parameters to AWS System Manager Parameter Store
- Deploy CDK stacks
- In your terminal, navigate to video-call-escalation/cdk-stacks
- Run the build script:
npm run build:frontend
- This script builds frontend applications (agent-app, demo-website)
- In case you started with a new environment, please bootstrap AWS CDK:
cdk bootstrap
- Run the deploy script:
npm run cdk:deploy
- This script deploys CDK stacks
- Wait for all resources to be provisioned before continuing to the next step
- AWS CDK output will be provided in your Terminal (Amazon Cognito User Pool Id, Amazon CloudFront Distribution URL)
- Configure Amazon Connect Approved Origins
- Login to your AWS Management Console
- Navigate to Amazon Connect -> Your instance alias -> Approved origins
- Click + Add origin
- Enter your Amazon CloudFront Distribution URL (from the previous step)
- Configure API Allowed Origins (optional)
- Cross-origin resource sharing (CORS) is a browser security feature that restricts cross-origin HTTP requests that are initiated from scripts running in the browser. At this point, we can restrict our APIs to be accessible only from our Amazon CloudFront Distribution domain (origin).
- In your terminal, navigate to video-call-escalation/cdk-stacks
- Start the configuration script in interactive mode, with additional -l (load) parameter:
node configure.js –i -l
- The script loads all the existing parameters, and prompts for new parameters to be provided
- Accept all the existing parameters, but provide new values for:
- agent-api-allowed-origins: Domain of your agent application, in this case Amazon CloudFront Distribution URL. For instance: https://aaaabbbbcccc.cloudfront.net
- website-api-allowed-origins: Domain of your (demo-)website application, in this case Amazon CloudFront Distribution URL. For instance: https://aaaabbbbcccc.cloudfront.net
- For the demo purpose, both agent-app and demo-website are hosted at the same Amazon CloudFront Distribution, but these would, most probably, be different in your production environment.
- The script stores the deployment parameters to AWS System Manager Parameter Store
- While in video-call-escalation/cdk-stacks, run the deploy script:
npm run cdk:deploy
- Wait for the CDK stacks to be updated
- Create a test agent (user)
- To create an Amazon Cognito user, you’ll need Cognito User Pool Id (created in step 6 – check for the AWS CDK Output, or check it in your AWS Management Console > Amazon Cognito User Pools)
- Create an Amazon Cognito user by running:
aws cognito-idp admin-create-user --region yourDesiredRegion --user-pool-id yourUserPoolId --username yourEmailAddress --user-attributes Name=name,Value=YourName
- You will receive an email, with a temporary password, which you will need in the next step
- To create an Amazon Connect user, login into your Amazon Connect Console, select Users -> User management from the main menu
- Click Add new users button, then click Next
- Provide First name, Last name
- Set Login name as your email address (as you have set when creating Cognito user)
- Set Routing Profile (i.e. Basic Routing Profile)
- Set Security Profile (i.e. Agent)
- Click Save, then Create users
- Note: Amazon Cognito accepts + in the email (user name), for instance when using a single email address for multiple users, while Amazon Connect UI doesn’t support + in the user name. Therefore, create Amazon Cognito user with +, but in Amazon Connect, replace + with _
Test the solution
- Open your browser and navigate to Amazon CloudFront Distribution URL
- On the Login screen, provide your email address and temporary password you received via email
- In the demo solution, you will be asked to confirm your email address – select Email and wait for the confirmation code to be delivered, then enter the confirmation code in the form and submit
- At this point, the agent is logged in, and you could see Amazon Connect CCP on the left-hand side, and Amazon Chime meeting form on the right-hand side
- In the top-right corner, click on ‘Demo website’ link (best to open it in a new, detached window)
- On the demo-website, click the “Video Call now” button, in the bottom-right corner
- When prompted, provide your name (as a customer name)
- Provide your email address – please note, the demo Contact Flow (VideoCallEscalationChat) routes the chat contact to agent’s personal queue (based on this email address)
- Once customer is in queue, set your agent to Available state
- Accept the incoming Chat contact
- Exchange a couple of messages between agent and customer (i.e. asking customer about upgrading to video call)
- On the agent side, in the Join Meeting form, click Continue
- This would trigger a device selection form, on both Agent and Customer side
- Join the meeting on the agent side
- Join the meeting on the customer side
- Camera(s) are disabled by default, click the camera button on each side to enable
- Test screen share (click on Content share button)
- End chat on the customer side
- Clear chat contact on the agent side
- Agent is ready for a next contact
Clean up
To remove the solution from your account, please follow these steps:
- Remove CDK Stacks
- Open your Terminal, navigate to video-call-escalation/cdk-stacks
- Run
cdk destroy --all
- Remove deployment parameters from AWS System Manager Parameter Store
- In your Terminal, navigate to video-call-escalation/cdk-stacks
- Run
node configure.js -d
Conclusion
Having an easily accessible and intuitive contact center is key to earning customer trust and loyalty. By combining AWS Services, Amazon Connect and Amazon Chime SDK, organizations can empower their contact center agents and customer with the tools required to facilitate these interactions while removing unnecessary complexity.