Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 2.69 KB

File metadata and controls

34 lines (23 loc) · 2.69 KB

Setting the AgentId field for a call

Overview

LCA v0.5.0 and later offers the option to identify an agent for a call.

You provide your own custom logic for retrieving the agent identifier from your contact center / IVR platform.
You have several options:

  1. Assign agent ID when the call streaming starts.
  2. Assign agent ID when you send a START_CALL_PROCESSING event for a previously suspended call.
  3. Assign agent ID at any time after the call has started processing.

Assign agent ID when call starts

If known, the AgentID can be provided when the call is started using a ChimeVC CallTranscriber Lambda Hook function - see ./LambdaHookFunction.md. Your Lambda hook function might retrieve the Agent identifier from the SIPREC invite headers, or (more likely) it might interact with your IVR or some other external system that associates agent with CallId.

Assign agent ID when you send a START_CALL_PROCESSING event

If you used a ChimeVC CallTranscriber Lambda Hook function to suspend immediate processing of a new call received from ChimeVC, then you can provide the AgentID later if/when you send a START_CALL_PROCESSING event for that call. This is useful when the call SIPREC stream must be initiated before the caller and agent are connected. See StartCallProcessingEvent.md for more information.

Assign agent ID at any time after the call has started

You can send an UPDATE_AGENT event to LCA at any time after the call has started transcribing. Use the Amazon Kinesis SDK to send UPDATE_AGENT events to the Kinesis Stream identified by the LCA stack output parameter CallDataStreamArn.

An UPDATE_AGENT message looks like this:

      {
        "CallId": <string>,
        "AgentId": <string>,
        "EventType": "UPDATE_AGENT",
      }

Reference implementation: The LCA repo contains a Lambda function that sends UPDATE_AGENT messages when using Amazon Connect ContactLens as the call audio source. This function subscribes to CONNECTED_TO_AGENT contact events from Amazon Connect, checks that they map to a callId known to LCA, retrieves the Agent name, and then builds and sends the UPDATE_AGENT message via Kinesis, informing LCA to update the AgentId field shown for the call in the UI. Use this sample function as a reference when building your own function that integrates with your IVR to send UPDATE_AGENT events to LCA. The code is defined in the Lambda function resource named ContactEventProcessorFunction in the lca-connect-integration-stack template.yaml.