This demo shows how you can leverage Amazon Connect api's to start/stop/pause/resume call recordings when the agent is on call with the customer. These api's come very handy, when accepting PCI/PII type of data from the customers, where agent can manually pause/resume or programatically pause/resume the recording. The sample html page demo's shows both versions.
Ensure you are under directory "recording-lambda"
cd recording-lambda
Run this command to init npm
npm init
Run this command to install the latest version aws-sdk and nodejs modules
npm install --save aws-sdk
Use sam
to build, invoke and deploy the function.
Ensure you are in the root folder
sam build --use-container
sam deploy template.yaml --s3-bucket REPLACE_ME --stack-name REPLACE_ME --parameter-overrides ParameterKey=CADS3BucketForWebSite,ParameterValue=REPLACE_ME ParameterKey=instanceIdParam,ParameterValue=REPLACE_ME_WITH_AMAZON_CONNECT_INSTANCE_ID ParameterKey=instanceNameParam,ParameterValue=REPLACE_ME_WITH_INSTANCE_ALIAS --capabilities CAPABILITY_IAM
sam local invoke "CADCallRecordingsControlLambdaFunction" -t template.yaml -e events/resume.json --env-vars events/env.json