Play

Introduction

The play command is employed to transmit pre-recorded audio to a call.

The play command can accept the following attributes:

Options

Option

Description

Required

url

Url in wav or mp3 format (play in sequence if it is an array of urls).

yes

loop

Times to play the url(s). Defaults to 1.

no

earlyMedia

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

no

timeoutSecs

The duration of time to play the url

no

seekOffset

Samples to seek into the url

no

actionHook

Specify a webhook that will be triggered when the media completes

no

actionHook properties

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

Property name

Description

playback_seconds

The duration that played (in second)

playback_milliseconds

The duration that played (in milisecond)

playback_last_offset_pos

The last offset position in samples

Example

{
    "verb": "play",
    "url": "https://example.com/example.mp3",
    "timeoutSecs": 10,
    "seekOffset": 8000,
    "actionHook": "/play/action"
}

Please contact us for timely support via: