Nouns

<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"/>
  </Connect>
</Response>

Attributes

Attribute Default Behaviour
url required wss:// (or ws:// in test environments) endpoint that receives the audio fork.
track both_tracks Which audio to fork: inbound_track, 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.

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.