stream
Stream the call’s audio to a WebSocket endpoint you control. The stream runs in the background: execution continues to the next instruction while audio is delivered to your endpoint in real time, which is useful for live transcription, voice analytics, or other custom media processing.
The stream keeps running until you stop it with stop_stream or the call ends. You can run more than one stream at once by giving each its own control_id.
Properties
stream
An object that accepts the following properties.
stream.url
The secure WebSocket URI (wss://) to stream the call’s audio to.
stream.control_id
Identifier for this stream, used to stop it later with stop_stream. Must be unique among the active streams on the call.
stream.name
A friendly name to identify this stream. Included in the stream’s status events.
stream.track
Which side of the call’s audio to stream: inbound_track for what the caller says, outbound_track for what the caller hears, or both_tracks for both.
stream.codec
Codec to use for the streamed audio. Freeform and endpoint-specific; common values include PCMU, PCMA, and OPUS.
stream.status_url
HTTP or HTTPS URL to deliver stream status events. Learn more about status callbacks.
stream.status_url_method
HTTP method used to deliver stream status events to status_url. Possible values: GET, POST.
stream.authorization_bearer_token
Bearer token sent in the Authorization header when connecting to the WebSocket endpoint.
stream.custom_parameters
Custom key-value pairs included in the first message sent to your WebSocket endpoint when the stream connects.
Variables
stream_result
Whether the stream started successfully.
stream_control_id
Identifier assigned to this stream. stop_stream uses it to stop the right one.
StatusCallbacks
When you set status_url, SignalWire POSTs a calling.call.stream event to it whenever the stream changes state: params.state is streaming when the stream starts and finished when it ends.
See the Stream status callback webhook page for the full field reference.