Upgrade 3CX to v18 and get it hosted free!

Asterisk cmd Playback

Author image

Synopsis

Play a sound and/or video file

Description

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 Asterisk cmd 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 Asterisk cmd 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


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.