Signals Docs
OneML reference

Play

The <Play> verb plays an audio file to the caller, or sends DTMF tones instead of audio.

Attributes

NameTypeDefaultDescription
loopinteger1Number of times to play the file. 0 repeats it until the call ends, capped at 1,000 repetitions, the same as <Say>.
digitsstringNoneSends DTMF tones instead of playing a file. Accepts 0-9, A-D (any case), *, # and w; each w waits 0.5 seconds.

Nesting

<Play> contains the URL of the audio file as text content, or no content when you use digits. Use one or the other. <Play> cannot contain other verbs.

Examples

Playing an audio file from a URL:

XMLCode
<?xml version="1.0" encoding="UTF-8"?> <Response> <Play>https://cdn.example.com/audio/welcome.mp3</Play> </Response>

Playing hold music twice before continuing:

XMLCode
<?xml version="1.0" encoding="UTF-8"?> <Response> <Play loop="2">https://cdn.example.com/audio/hold-music.mp3</Play> <Hangup/> </Response>

Sending DTMF tones to reach an extension after the call connects:

XMLCode
<?xml version="1.0" encoding="UTF-8"?> <Response> <Play digits="wwww1928"/> </Response>

See also

Last modified on