Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt

Use this file to discover all available pages before exploring further.

The <Play> verb plays an MP3 or WAV audio file, which Telnyx fetches back to the caller from the URL you configure. Alternatively, specify mediaStorage="true" to fetch a file you previously uploaded to Telnyx using media storage APIs. When mediaStorage="true" is used the verb expects a media_name instead of a URL. You can also use the digits attribute to play DTMF tones instead of an audio file. <Play> can be used independently as a verb or nested within <Gather> as a noun to play an audio file while waiting for DTMF tones.

Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
loop Times to repeat the audio 1
mediaStorage When true fetches the file from Telnyx media storage using the provided media name. true, falsefalse
digits DTMF tones to play. The value can include digits 0-9, *, #, and w (for a 0.5 second pause). When specified, the verb plays DTMF tones instead of an audio file. -
failoverUrl Backup audio source played when the primary URL fails. The mediaStorage flag also applies to this URL. Only one retry attempt is made. -
continueOnError When true, a playback failure does not abort the script. Telnyx still logs the error and continues with the next verb. false
ringTone Plays a country-specific ringback tone instead of an audio file. Cannot be combined with an audio body. Not supported inside <Conference>. at, au, bg, br, be, ch, cl, cn, cz, de, dk, ee, es, fi, fr, gr, hu, il, in, it, lt, jp, mx, my, nl, no, nz, ph, pl, pt, ru, se, sg, th, tw, ve, za, us, us-old, uk-

Examples

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play>https://example.com/welcome.mp3</Play>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play ringTone="us" loop="3"/>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play continueOnError="true">https://example.com/might-404.mp3</Play>
    <Say>Sorry, we could not play the message.</Say>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play failoverUrl="https://cdn-backup.example.com/welcome.mp3">https://cdn.example.com/welcome.mp3</Play>
</Response>