Skip to main content
The <Stream> instruction starts streaming the media from a call to a specific WebSocket address in near-real-time. Audio will be delivered as base64-encoded RTP payloads (no headers), wrapped in JSON payloads.

Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
url The destination WebSocket address where the stream is going to be delivered. -
track Specifies which track should be streamed. inbound_track, outbound_track, both_tracksinbound_track
name Specifies custom name for the stream instance -
codec Specifies the codec to be used for the streamed audio. When set to ‘default’ or when transcoding is not possible, the codec from the call will be used. Currently, transcoding is only supported between PCMU and PCMA codecs. PCMU, PCMA, G722, OPUS, AMR-WB, defaultdefault
bidirectionalMode Bidirectional streaming mode mp3, rtpmp3
bidirectionalCodec Bidirectional streaming codec, used only with bidirectionalMode=rtp PCMU, PCMA, G722, OPUS, AMR-WBPCMU
bidirectionalSamplingRate Bidirectional streaming sampling rate in Hz 8000, 16000, 240008000

Examples

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Start>
    <Stream url="wss://yourdomain.com/stream" track="both_tracks" />
  </Start>
</Response>

Expected callbacks

If statusCallback is set, stream status callbacks are sent for the following events:
  • stream-started — Stream has started
  • stream-stopped — Stream has stopped
  • stream-failed — Stream failed to start or was interrupted
See Stream Callback for the full payload reference.