<Connect>
Hand the call’s audio to a bidirectional WebSocket stream (voice bot).
Connects the call’s audio to your WebSocket in both directions, for a voice bot: SIPRTC streams the caller’s audio and plays back the audio your server sends. <Connect> ends the document - nothing after it runs - and the call stays on the stream until it hangs up (or a REST update moves it). Answers the call first if it is not answered yet. The message protocol is described in the media streams guide.
Example
Section titled “Example”<Response> <Connect> <Stream url="wss://bot.example.com/voice" name="bot" encoding="audio/L16" sampleRate="16000" statusCallback="https://example.com/stream-events">{"customer_id":"42","lang":"en"}</Stream> </Connect></Response>Nested elements
Section titled “Nested elements”| Element | Description |
|---|---|
<Stream> |
Bidirectional stream of the call’s audio. |