Skip to main content
The play verb is used to stream recorded audio to a call.
{
  "verb": "play",
  "url": [
    "https://example.com/example1.mp3",
    "https://example.com/example2.wav"
  ],
  "loop": 2,
  "earlyMedia": true,
  "timeoutSecs": 15,
  "seekOffset": 8000,
  "actionHook": {
    "url": "/play/action",
    "playback_seconds": 12,
    "playback_milliseconds": 12000,
    "playback_last_offset_pos": 8000
  }
}

Configuration

You can use the following options in the play verb:
ParameterTypeDescriptionRequired
urlstring | arrayA URL string or an array of URLs pointing to WAV or MP3 files to play sequentially. The .mp3 or .wav extension isn’t required at the end of the URL. For example: https://abc.xyz/music.mp3 or https://audio.jukehost.co.uk/N5pnlULbup8KabGRE7dsGwHTeIZAwWdr.Yes
loopnumber | stringThe number of times to play the URLs. Can be a number or string. The default value is 1.No
earlyMediabooleanIf true and the call hasn’t yet been answered, audio will play without answering the call. The default value is false.No
timeoutSecsnumber | stringThe maximum number of seconds to play the audio. Can be a number or string.No
seekOffsetnumber | stringThe number of samples to seek into the URL before starting playback. Can be a number or string.No
actionHookstring | objectA webhook to receive an HTTP POST when the play verb completes.No
actionHook.playback_secondsnumberThe number of seconds that were played during the playback.No
actionHook.playback_millisecondsnumberThe number of milliseconds that were played during the playback.No
actionHook.playback_last_offset_posnumberThe last offset position in samples that was played. Useful for resuming playback if interrupted.No