Media Streams
Live call audio over a WebSocket, as JSON messages: start one with Connect><Stream> (two-way) or
Start><Stream> (one-way).
The connection
We open your wss:// URL with X-DWW-Signature on the upgrade (see Webhooks), and check your
certificate for the hostname.
Messages to you
connected, thenstart(withstreamSid,callSid, yourcustomParameters, andmediaFormataudio/x-mulaw, 8000 Hz, 1 channel);media: 20 ms of base64 µ-law each;dtmf, when the caller presses a key;mark, echoed when the audio before it has actually played;stop.
Messages from you (two-way streams)
media (µ-law 8 kHz), mark and clear.
Limits
- a message up to 64 KiB, and a
payloadup to 1 second of audio; - up to 100 messages a second, bursts of 200;
- we ping every 10 seconds and close a stream with no pong for 30 seconds (730003); your silence is fine;
- an invalid message closes the stream (730002).
Timing
start is sent once audio flows, about 1.4 seconds after the answer. Audio you send before start is dropped.