Conversation Orchestrator: Streaming Unidirectional Audio

Note: The "Stream audio unidirectional" component has additional usage costs. For detailed information on its pricing, please contact your Customer Success Manager.

When you want to stream the audio of voice calls from Talkdesk to a Partner, the “Stream audio unidirectional” component plays a crucial role, as it can use a WebSocket (WSS) connection to start streaming the audio at any point in the call flow.

The stream of audio from Talkdesk to a Partner will not interfere with the normal flow of the call, as the stream is just mirroring the audio to your system.

The “Stream audio unidirectional” component triggers different events during the conversation stream’s lifecycle. These events are represented via the following WebSocket messages:

  • Connected: The first message sent, once a WebSocket connection is established.
  • Start: This message contains important metadata about the conversation stream and is sent immediately after the Connected message. It is only sent once at the beginning of the conversation stream.
  • Media: This message encapsulates the raw audio data.
  • Stop: A stop message that is sent when the conversation stream is either stopped or the call has ended.

To understand the structure of these WebSocket messages, please review the WebSocket Messages protocols section.

Note: The component only allows you to do a unidirectional audio stream, and it will stream both channels: agent and caller. Currently, the option to stream bidirectional audio is available using the Connect Virtual Agent Studio component, as explained in Conversation Orchestrator: Streaming Bidirectional Audio.

The “Stream audio unidirectional” component can be added to any step of the Studio flow, and the stream will start immediately.

 

Stream_audio_1.png

1. Add a "Stream audio unidirectional" component to the “Initial step” exit for successful outcomes (exit “OK”).

2. On the “Stream audio unidirectional” step, configure the “Stream URL” to the WSS connection you want the audio to be streamed.

stream_audio_2.png3. Set up the “Stream audio unidirectional” exits, depending on the flow you would like to define.

In this case, we have added an “Assignment and Dial” as the “Successful” exit of the "Stream audio unidirectional", so that when the agent finishes the call, the audio is streamed.

 

WebSocket Messages protocols 

The WebSocket message protocols are based on Talkdesk Global Communications Network (GNC) TwiML™️ Voice: <Stream>.

Connected Message

"Connect" is the first message sent once a WebSocket connection is established.

For details on the message format, and parameters, please see the documentation here.

 

Start Message

The "Start" message contains important metadata about the conversation stream and is sent immediately after the "Connected" message. It is only sent once, at the start of the conversation stream.

For details on the message format and parameters, please see the documentation here

To enrich the start message produced by Talkdesk Global Communications Network (GNC) we add the following information to the "customParameters" section of the payload:

  • extra_parameters: deprecated field.
  • account_id: The Talkdesk ID for the account.
  • Interaction_id: The unique ID of that Talkdesk interaction.
  • stream_url: The WebSocket URL where the audio is being streamed. 
  • correlation_id: The ID that identifies the call throughout its lifetime, for all our corresponding interaction_id of that call.
  • type: The media flow, that is either inbound or outbound

Example:

"customParameters": {
     "extra_parameters": {},
     "account_id": "5ea75fe7aa224700012eae40",
     "interaction_id": "cadc093d381648e98e520739630c47ff",
     "stream_url": "wss://my.service.com/socket/messages",
     "correlation_id": "72d64225890846c39a05616d08d5d5a1",
     "type": "inbound"
}

Media Message

The "Media" message encapsulates the raw audio data.

For details on the message format and parameters please see the documentation here

 

Stop Message

The "Stop" message will be sent when the conversation stream is either stopped or the call has ended.

For details on the message format and parameters please see the documentation here

 

For more information on Conversation Orchestrator, please consult our documentation.

 

 

 

 

 

 

 

 

 

All Articles ""
Please sign in to submit a request.