Skip to content

Playback events

Playback events track audio playback on active calls, including start, completion, and error states. The command.result event provides an additional confirmation of command success or failure.

Fired when the call leg actually begins playing the requested audio — the moment the gateway reports that the playback application has started executing on the channel, after URL fetch and decoding. Receipt of playback.started means audio is now reaching the caller.

Payload schema

FieldTypeDescription
eventstringAlways "playback.started". required
session_uuidstringUnique session identifier. required
command_uidstringThe command_uid from the playback/start request. required
urlsstring[]The original URL(s) from the API request, as an array. Single-URL playbacks emit a one-element array. Matches the shape used by conference.play.* events. required
file_pathstringdeprecated The original URL(s) joined with ,. Retained for two releases for backward compatibility — new consumers should read urls instead.
{
"event": "playback.started",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"command_uid": "play-greeting-001",
"urls": ["https://cdn.example.com/audio/greeting.wav"],
"file_path": "https://cdn.example.com/audio/greeting.wav"
}

Fired when playback completes normally (reaches the end of the file) or is stopped via the playback/stop command. The offset_ms field indicates where playback was when it ended.

Payload schema

FieldTypeDescription
eventstringAlways "playback.stopped". required
session_uuidstringUnique session identifier. required
command_uidstringThe command_uid from the playback/start request. required
urlsstring[]The original URL(s) from the API request, as an array. required
file_pathstringdeprecated The original URL(s) joined with ,. Read urls instead.
offset_msintegerPlayback position at stop time in milliseconds. required
duration_msintegerTotal playback duration in milliseconds. required
{
"event": "playback.stopped",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"command_uid": "play-greeting-001",
"urls": ["https://cdn.example.com/audio/greeting.wav"],
"file_path": "https://cdn.example.com/audio/greeting.wav",
"offset_ms": 15230,
"duration_ms": 15230
}

Fired when an audio file cannot be found or fetched. This can occur during the HTTP file fetch phase or during playback execution. Applies to both playback/start and play_and_get_digits commands.

Payload schema

FieldTypeDescription
eventstringAlways "playback.file_not_found". required
session_uuidstringUnique session identifier. required
command_uidstringThe command_uid from the playback/start or play_and_get_digits request. required
urlsstring[]The original URL(s) that failed, as an array. required
file_pathstringdeprecated The original URL(s) joined with ,. Read urls instead.
{
"event": "playback.file_not_found",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"command_uid": "play-greeting-001",
"urls": ["https://cdn.example.com/audio/missing.wav"],
"file_path": "https://cdn.example.com/audio/missing.wav"
}

Reports the outcome of an asynchronous command. For fire-and-forget commands (hangup, disconnect, playback/stop, etc.), this is published immediately. For deferred commands (answer, playback/start, play_and_get_digits), it is published after the operation completes or after a 2-second timeout.

Payload schema

FieldTypeDescription
eventstringAlways "command.result". required
session_uuidstringUnique session identifier. required
operation_idstringUUID matching the operation_id from the 202 Accepted HTTP response. required
commandstringThe command type (e.g. call.answer, playback.start, play_and_get_digits). required
command_uidstringThe command_uid from the original API request. required
successbooleantrue if the command completed successfully, false on failure or timeout. required

Example — success:

{
"event": "command.result",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"operation_id": "b3d1c8a0-7e2f-4a91-9c3e-1a2b3c4d5e6f",
"command": "playback.start",
"command_uid": "play-greeting-001",
"success": true
}

Example — timeout:

{
"event": "command.result",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"operation_id": "b3d1c8a0-7e2f-4a91-9c3e-1a2b3c4d5e6f",
"command": "call.answer",
"command_uid": "my-answer-cmd-001",
"success": false
}

These events are produced by the following endpoints: