<Play>
The <Play>
verb plays an audio file back to the caller. Voxtelesys retrieves the file from a URL that you provide.
<Play>
Attributes
<Play>
supports the following attributes that change its behavior:
Attribute | Allowed Values | Default Value |
---|---|---|
history | disable , compact , full | disable |
loop | integer > 0 | 1 |
digits | integer >= 0, w | none |
history
The history
attribute determines if the <Play>
verb should be logged in the history
array of the CDR. The default is to not log.
For <Play>
, the compact
and full
values log the following payload to the history
array respectively.
compact
{
"payload": {
"url": "http://example.com/noise"
}
}
full
{
"payload": {
"url": "http://example.com/noise",
"loop": "1"
}
}
loop
The loop
attribute specifies how many times the audio file is played.
digits
The digits
attribute lets you play DTMF tones during a call.
For example, if you need to test an IVR system, you can use this feature to simulate digits being pressed to navigate through the menu options.
Include w
to introduce a 0.5s
pause between DTMF tones. For example, 1w2
will tell Voxtelesys to pause 0.5s before playing DTMF tone 2. To include 1s of pause, simply add ww
.
<Play>
Nouns
The URL of an audio file that Voxtelesys will retrieve and play to the caller.
<Play>
Examples
DTMF Usage
Generate DTMF tone 1, wait 1 second, then generate DTMF tone 2.
<Response>
<Play digits="1ww2"></Play>
<Hangup/>
</Response>
URL Usage
Play the cowbell sound clip 2 times.
<Response>
<Play loops="2">https://example.com/cowbell.mp3</Play>
</Response>