Synopsis
Play a sound and/or video fileDescription
Playback(filename1[&filename2...][,options])Plays the specified sound or video file(s) (you need to omit the filename extension). Sound files are stored in the /var/lib/asterisk/sounds directory by default (the directory path can be changed in asterisk.conf).
Playback is Multi-Language-compliant. It will look in a subdirectory corresponding with the current language code (as set by the SetLanguage command, or the channel's default language code. Failing that, it will play the non-language-specific edition.
Playback will play the whole sound file(s), and when complete, return control. Compare with the Background command, which plays a sound file but returns control immediately, allowing Asterisk to perform other commands on this channel while the sound file is playing.
See: Asterisk tips answer-before-playback on how to avoid the dropping of audio on the first prompt played after you answer a call.
Options
skip: Play the sound file only if the channel has already been answered. If the channel has not yet been answered, the Playback command will return immediately without playing anything.noanswer: Play the sound file, but don't answer the channel first (if hasn't been answered already). Not all channels support playing messages while still on hook.
j: If option is specified, the application will jump to priority n+101 if present when a file specified to be played does not exist.
say: Use say.conf to interpret the string
If neither skip nor noanswer options are specified, then the Playback command will first answer the channel (if it hasn't been answered already) and then play the sound file.
Note: The options wont work if there are spaces between the filename, the comma and the option(s).
Example
exten => 500,1,Playback(tt-weasels,skip)Return code
On completion, ${PLAYBACKSTATUS} contains either "FAILED" or "SUCCESS".Troubleshooting
Playback is not affected by timing, unless internal_timing is turned on in asterisk.conf.See also
- ControlPlayback: Play a sound file with fast forward, rewind and exit controls
- Background: Play a sound file while processing other commands
- WaitForSilence: Useful for example to leave a message on an answering machine/mailbox
- Asterisk cmd WaitForNoise
- Record: Record sound and/or video for playback
- Playtones: Play a tone sequence