The Playback Application

The Playback() application can be used in the dial plan to play a sound or video file. The default sound files are stored in the /usr/share/asterisk/sounds directory. In the sounds directory there should be folders for the language package used by Asterisk. For example, English sounds will be located in the en or en_US directories.

The default sound files are used for various modules in Asterisk. There should be testing files in the diretory. The testing files start with tt-. A few files that come with the Asterisk installing in Ubuntu include: tt-allbusy.gsm, tt-monkeys.gsm, tt-monkeysintro.gsm, tt-somethingwrong.gsm, and tt-weasels.gsm.

When using the Playback() application you do not include the file extension of the media file.  Open the /etc/asterisk/extensions.conf file and add the following lines to the [phone] context within the file:
exten => 200,1,NoOp(Play Monkey Test Sound)
same => n,Playback(tt-monkeys)
same => n,Hangup

exten => 201,1,NoOp(Play AllBusy Test Sound)
same => n,Playback(tt-allbusy)
same => n,Hangup

Now test the Playback application by reloading the dialplan in the console and dialing extensions 200 and 201. To view detailed information about the Playback() application, use the command core show application Playback in the Asterisk console.