<Stream>
Fork the call audio to your WebSocket server.
Used inside<Connect>, <Start>, <Stop>.
Example
<Response>
<Connect action="https://app.example.com/stream-done">
<Stream url="wss://audio.example.com/ingest" track="inbound_track">
<Parameter name="session" value="a1b2"/>
</Stream>
</Connect>
</Response>
Attributes
| Attribute | Default | Behaviour |
|---|---|---|
url |
required |
wss:// (or ws:// in test environments) endpoint that receives the audio fork. |
track |
inbound_track |
Which audio to fork: inbound_track (the caller, the default), outbound_track, or both_tracks. |
name |
unset |
Operator-friendly identifier echoed in logs and callbacks. One audio fork is active per call, so <Stop><Stream> targets the running fork regardless of name. |
statusCallback |
unset |
Lifecycle webhook fired on stream start, stop, and failure. |
statusCallbackMethod |
POST |
HTTP method for lifecycle webhooks. |
Nesting
<Stream> accepts these nested elements:
Notes
- Under <Connect>, the stream blocks until the WebSocket closes or the call hangs up, then posts StreamSid, StreamDuration, and StreamStatus to the <Connect> action URL.
- Under <Start>, the fork is non-blocking: subsequent verbs run while it is live; <Stop><Stream/> or call hangup ends it.
- Nested <Parameter name value/> children are delivered to your WebSocket server as customParameters in the start frame.