Play

Stream recorded audio to a call.

1{
2 "verb": "play",
3 "url": "https://example.com/example.mp3",
4 "timeoutSecs": 10,
5 "seekOffset": 8000,
6 "actionHook": "/play/action"
7}

Parameters

url
string | arrayRequired

A single URL or an array of URLs (will play in sequence) to a WAV or MP3 file.

actionHook
string

Webhook that is called when the play verb completes.

earlyMedia
booleanDefaults to false

If true and the call has not yet been answered, play the audio without answering the call.

loop
numberDefaults to 1

Number of times to play the URL(s).

seekOffset
number

Number of samples to seek into the URL.

timeoutSecs
number

Number of seconds to play the URL.

actionHook properties

The actionHook that is invoked when the play command completes will include the following properties:

property namedescription
playback_secondsthe number of seconds played
playback_millisecondsthe number of milliseconds played
playback_last_offset_posthe last offset position in samples
Built with