Skip to content

Assistance in creating a cloud contact center using Amazon Connect Service

0

We have the following requirement in building a simple call center:

  1. A bunch of customers would be registered into a web application.

  2. Connect would initiate calls to these numbers.

  3. The call flow would be as follows:

    Customer picks up call
    A simple audio file is played to the user
    Customer responds through natural language (voice)
    This voice is analyzed in real time, transcript is picked up, and the transcript is fed into a simple logic in a lambda function.
    The lambda function determines what would be the next audio file to be played.
    The audio file is then picked out of the S3 bucket and played to the user. This process goes back and forth until the lambda determines whether the call must be transferred to an agent. And if so, they would be transferred.
    

In order to go about this, I have created the following Contact flow (this isn't the complete one, but its a simple proof-of-concept to test out the voice analysis)

{
  "Version": "2019-10-30",
  "StartAction": "9e0d03d7-8045-4c95-afee-06bda3ba6ca7",
  "Metadata": {
    "entryPointPosition": {
      "x": -140.8,
      "y": 33.6
    },
    "ActionMetadata": {
      "9e0d03d7-8045-4c95-afee-06bda3ba6ca7": {
        "position": {
          "x": -18.4,
          "y": 24.8
        }
      },
      "421283f3-c5e9-4a9f-a8ce-c5599fb38933": {
        "position": {
          "x": 625.6,
          "y": 656
        }
      },
      "c17decd1-c9a9-4f1e-bcc0-6b7101c34965": {
        "position": {
          "x": 1042.4,
          "y": 242.4
        }
      },
      "c583f7f6-fd6e-44b9-914f-26b6c246f47e": {
        "position": {
          "x": -120.8,
          "y": 211.2
        },
        "toCustomer": true,
        "fromCustomer": true
      },
      "d6236838-1250-4c89-9845-a44d170ebfd3": {
        "position": {
          "x": 143.2,
          "y": 208.8
        }
      },
      "2f5e4e0e-ed68-4bec-8e7c-f28008d1b3c5": {
        "position": {
          "x": 361.6,
          "y": 196
        }
      },
      "c884051f-4cb9-4317-96ef-c5eaec0a2c7b": {
        "position": {
          "x": 825.6,
          "y": 312
        },
        "parameters": {
          "QueueId": {
            "displayName": "BasicQueue"
          }
        },
        "queue": {
          "text": "BasicQueue"
        }
      },
      "f7446253-f2a3-4d42-bc50-5b12bf210ac2": {
        "position": {
          "x": 216,
          "y": 567.2
        }
      },
      "6388d0bd-f386-470d-8927-0b626d4eb5f9": {
        "position": {
          "x": 461.6,
          "y": -27.2
        }
      },
      "cce0d82c-dbe3-43ec-9842-1493c40c05a7": {
        "position": {
          "x": 736.8,
          "y": 64.8
        },
        "dynamicMetadata": {}
      }
    },
    "Annotations": [],
    "name": "AICallFlow",
    "description": "",
    "type": "contactFlow",
    "status": "published",
    "hash": {}
  },
  "Actions": [
    {
      "Parameters": {
        "FlowLoggingBehavior": "Enabled"
      },
      "Identifier": "9e0d03d7-8045-4c95-afee-06bda3ba6ca7",
      "Type": "UpdateFlowLoggingBehavior",
      "Transitions": {
        "NextAction": "c583f7f6-fd6e-44b9-914f-26b6c246f47e"
      }
    },
    {
      "Parameters": {},
      "Identifier": "421283f3-c5e9-4a9f-a8ce-c5599fb38933",
      "Type": "DisconnectParticipant",
      "Transitions": {}
    },
    {
      "Parameters": {},
      "Identifier": "c17decd1-c9a9-4f1e-bcc0-6b7101c34965",
      "Type": "TransferContactToQueue",
      "Transitions": {
        "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
        "Errors": [
          {
            "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
            "ErrorType": "QueueAtCapacity"
          },
          {
            "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    },
    {
      "Parameters": {
        "MediaStreamingState": "Enabled",
        "MediaStreamType": "Audio",
        "Participants": [
          {
            "ParticipantType": "Customer",
            "MediaDirections": [
              "To",
              "From"
            ]
          }
        ]
      },
      "Identifier": "c583f7f6-fd6e-44b9-914f-26b6c246f47e",
      "Type": "UpdateContactMediaStreamingBehavior",
      "Transitions": {
        "NextAction": "d6236838-1250-4c89-9845-a44d170ebfd3",
        "Errors": [
          {
            "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    },
    {
      "Parameters": {
        "RecordingBehavior": {
          "RecordedParticipants": [
            "Agent",
            "Customer"
          ],
          "ScreenRecordedParticipants": [
            "Agent"
          ],
          "IVRRecordingBehavior": "Enabled"
        },
        "AnalyticsBehavior": {
          "Enabled": "True",
          "AnalyticsLanguage": "en-US",
          "AnalyticsRedactionBehavior": "Disabled",
          "AnalyticsRedactionResults": "RedactedAndOriginal",
          "ChannelConfiguration": {
            "Chat": {
              "AnalyticsModes": [
                "ContactLens"
              ]
            },
            "Voice": {
              "AnalyticsModes": [
                "RealTime"
              ]
            }
          },
          "SentimentConfiguration": {
            "Enabled": "False"
          }
        }
      },
      "Identifier": "d6236838-1250-4c89-9845-a44d170ebfd3",
      "Type": "UpdateContactRecordingBehavior",
      "Transitions": {
        "NextAction": "2f5e4e0e-ed68-4bec-8e7c-f28008d1b3c5"
      }
    },
    {
      "Parameters": {
        "Text": "Hello there."
      },
      "Identifier": "2f5e4e0e-ed68-4bec-8e7c-f28008d1b3c5",
      "Type": "MessageParticipant",
      "Transitions": {
        "NextAction": "6388d0bd-f386-470d-8927-0b626d4eb5f9",
        "Errors": [
          {
            "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    },
    {
      "Parameters": {
        "QueueId": "-------------------------"
      },
      "Identifier": "c884051f-4cb9-4317-96ef-c5eaec0a2c7b",
      "Type": "UpdateContactTargetQueue",
      "Transitions": {
        "NextAction": "c17decd1-c9a9-4f1e-bcc0-6b7101c34965",
        "Errors": [
          {
            "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    },
    {
      "Parameters": {
        "MediaStreamingState": "Disabled",
        "Participants": [
          {
            "ParticipantType": "Customer",
            "MediaDirections": [
              "To",
              "From"
            ]
          }
        ],
        "MediaStreamType": "Audio"
      },
      "Identifier": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
      "Type": "UpdateContactMediaStreamingBehavior",
      "Transitions": {
        "NextAction": "421283f3-c5e9-4a9f-a8ce-c5599fb38933",
        "Errors": [
          {
            "NextAction": "421283f3-c5e9-4a9f-a8ce-c5599fb38933",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    },
    {
      "Parameters": {},
      "Identifier": "6388d0bd-f386-470d-8927-0b626d4eb5f9",
      "Type": "Wait",
      "Transitions": {
        "NextAction": "2f5e4e0e-ed68-4bec-8e7c-f28008d1b3c5",
        "Conditions": [
          {
            "NextAction": "cce0d82c-dbe3-43ec-9842-1493c40c05a7",
            "Condition": {
              "Operator": "Equals",
              "Operands": [
                "WaitCompleted"
              ]
            }
          }
        ],
        "Errors": [
          {
            "NextAction": "2f5e4e0e-ed68-4bec-8e7c-f28008d1b3c5",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    },
    {
      "Parameters": {
        "LambdaFunctionARN": "----------------------",
        "InvocationTimeLimitSeconds": "3",
        "ResponseValidation": {
          "ResponseType": "STRING_MAP"
        }
      },
      "Identifier": "cce0d82c-dbe3-43ec-9842-1493c40c05a7",
      "Type": "InvokeLambdaFunction",
      "Transitions": {
        "NextAction": "c884051f-4cb9-4317-96ef-c5eaec0a2c7b",
        "Errors": [
          {
            "NextAction": "f7446253-f2a3-4d42-bc50-5b12bf210ac2",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    }
  ]
}

https://ibb.co/0R78qd54

Data streams as well as live media streaming (via video streams) have been enabled.

Most resources are outdated (GitHub repos are archived upon introduction of Contact Lens)

So far, the transcript doesn't come to the lambda, additionally I'm not exactly sure how to wait till the customer finishes speaking?

If this is not exactly possible, how could I go about it instead?

Any help would be very much appreciated :)

2 Answers
0

To create a cloud contact center using Amazon Connect that can initiate outbound calls, play audio files, analyze customer speech, and route calls based on that analysis, I'll help you address the issues with your current implementation and suggest a better approach.

First, let's understand how to implement your call flow requirements:

  1. For outbound calling, you'll need to use the StartOutboundVoiceContact API from Amazon Connect to initiate calls to your registered customers.

  2. For the interactive voice flow you described, you need to:

  • Play audio prompts to customers
  • Capture and analyze their speech
  • Process the transcript in a Lambda function
  • Play different audio files based on the Lambda response
  • Potentially transfer to an agent

The issue with your current flow is that you're using media streaming but not properly capturing and processing the customer's speech. Here's how to improve it:

Instead of using raw media streaming, use Amazon Lex integration with Amazon Connect. This provides a more structured way to:

  • Capture customer utterances
  • Wait for the customer to finish speaking
  • Get transcripts automatically
  • Process the intent in your Lambda

Here's a revised approach:

  1. Create an Amazon Lex bot with intents that match your use case
  2. In your Connect flow, use the "Get customer input" block to invoke the Lex bot
  3. Configure a Lambda function as the fulfillment for your Lex intents
  4. The Lambda can determine the next step (play another prompt or transfer to agent)
  5. Use "Play prompt" blocks to play audio files from your S3 bucket

Your flow would look like:

  • Start the call
  • Play initial prompt
  • Get customer input (using Lex)
  • Process in Lambda
  • Based on Lambda response, either play another prompt and loop back to get more input, or transfer to an agent queue

This approach gives you natural language understanding capabilities and handles the conversation flow more elegantly than trying to process raw media streams directly.

For outbound campaigns, you can store your customer data in a database or CRM system and use a scheduled process to call the StartOutboundVoiceContact API with the appropriate flow ID and customer phone numbers.
Sources
Scenario and deployment approaches in Amazon Connect - Amazon Connect
Amazon Connect features for IVR applications - AWS Prescriptive Guidance
Flows in Amazon Connect - Amazon Connect

answered a year ago
0
  • Wait block doesn't capture speech - It just waits for a timeout
  • Real-time analytics don't directly feed Lambda - You need to use Kinesis Data Streams
  • For real-time metrics, use contact lens for more features

For automated outbound calls, follow this blog: https://aws.amazon.com/blogs/contact-center/automating-outbound-calling-to-customers-using-amazon-connect/

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.