Documentation Index
Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt
Use this file to discover all available pages before exploring further.
Key Capabilities
- Bidirectional streaming: Send and receive audio in real-time
- Multiple audio tracks: Stream inbound, outbound, or both tracks
- Flexible codecs: Support for multiple audio formats and sample rates
- Event streaming: Send playback, checkpoint, and control events via WebSocket
Attributes
| Attribute | Description |
|---|---|
bidirectional boolean | Specifies whether the audio being streamed over the WebSocket is bidirectional (read/write) or one-way (read-only). If true, Vobiz accepts: - event: Takes playAudio as the value - media: JSON object containing: - contentType: audio/x-l16, audio/x-mulaw - sampleRate: 8000, 16000 - payload: Base64-encoded raw audio |
audioTrack string | The audio track (inbound/outbound) that Vobiz will fork and stream to the WebSocket. Allowed values: inbound, outbound, both Default: inbound Note: When bidirectional is true, audioTrack should not be outbound or both. |
streamTimeout integer | Maximum duration (in seconds) for audio streaming. Streaming stops after this duration. Must be a positive integer. Default: 86400 (24 hours) |
statusCallbackUrl string | URL notified when: - Audio stream is connected - Audio stream is stopped intentionally or due to timeout - Audio stream failed or disconnected |
statusCallbackMethod string | HTTP method used to invoke statusCallbackUrl. Allowed values: GET, POST Default: POST |
contentType string | Preferred audio codec and sampling rate. Allowed values: - audio/x-l16;rate=8000 - audio/x-l16;rate=16000 - audio/x-mulaw;rate=8000 Default: audio/x-l16;rate=8000 |
extraHeaders string | Key-value pairs sent to the WebSocket service with the audio stream. Example: test1=12,test2=123 Max length: 512 bytes Allowed characters: [A-Z], [a-z], [0-9] |
keepCallAlive boolean | If true, the Stream element executes exclusively and subsequent XML elements run only after the stream disconnects. Allowed values: true, false Default: false |
Parameters sent to statusCallbackUrl
This information is sent to thestatusCallbackUrl when an event is triggered.
| Parameter | Description |
|---|---|
bidirectional boolean | Indicates whether the audio stream was bidirectional (read/write) or one-way (read-only). |
audioTrack string | The audio track that Vobiz forked and streamed. Values: inbound, outbound, both |
streamTimeout integer | Maximum duration (in seconds) that audio was streamed. Default: 86400 (24 hours) |
statusCallbackUrl string | URL that received the notification of stream events. |
statusCallbackMethod string | HTTP method used (GET or POST). Default: POST |
contentType string | Audio codec and sampling rate that was used. |
extraHeaders string | Key-value pairs that were sent along with the audio stream. |
keepCallAlive boolean | Whether the stream executed exclusively before continuing with subsequent XML elements. |
Status callback events
When you configure astatusCallbackUrl, Vobiz sends HTTP POST/GET requests to that URL when specific stream lifecycle events occur. These are separate from WebSocket events and are useful for logging, monitoring, and triggering business logic.
HTTP Callbacks vs WebSocket EventsHTTP Status Callbacks (sent to statusCallbackUrl):
- StartStream, PlayedStream, StopStream events
- Sent via HTTP POST/GET to your web server
- For logging, monitoring, and triggering workflows
- start, media, stop, playedStream, clearedAudio events
- Sent through the WebSocket connection in real-time
- For audio streaming and real-time interaction
StartStream - stream started
Fired when the WebSocket connection is successfully established and audio streaming begins.Example StartStream Callback
PlayedStream - checkpoint reached
Fired when audio queued before a checkpoint event has been successfully played to the caller. TheName parameter contains the checkpoint name you specified.
Example PlayedStream Callback
StopStream - stream ended
Fired when the audio streaming session ends. This can happen due to:- Stream timeout (streamTimeout reached)
- Call ended by either party
- WebSocket connection closed
- Network error or disconnection
Example StopStream Callback
Common parameters in all events
| Parameter | Description |
|---|---|
CallUUID | Unique identifier for the call |
StreamID | Unique identifier for this streaming session |
Event | Event type: StartStream, PlayedStream, or StopStream |
From | Caller’s phone number |
To | Called phone number |
Timestamp | When the event occurred |
Name | Checkpoint name (PlayedStream only) |
ServiceURL | WebSocket URL used for streaming (StartStream only) |
Example: handling status callbacks
Node.js Express Handler
Examples
Basic audio stream
Simple one-way audio stream
Bidirectional audio stream
Two-way audio streaming with callbacks
Stream both tracks with timeout
Stream inbound and outbound audio with 1-hour timeout
Next steps
- Initiate a Stream - Learn how to establish a WebSocket connection and start streaming audio from active calls.
- Stream Events Overview - Understand how to send events like playAudio, clearAudio, and checkpoint via WebSocket.
- Checkpoint Event - Send checkpoint events to confirm audio playback completion and manage event queues.
- Play Audio Event - Transmit audio through WebSocket for bidirectional audio streaming use cases.