Extra Sounds

If you would like to download extra sound files for Asterisk, there is an archive of sounds on the Web located at http://downloads.asterisk.org/pub/telephony/sounds/.

If you are not familiar with a command line Linux operating system, downloading files and extracting the data may be changing. In this lesson we will walk through the process of downloading an extra sounds package to the /usr/share/asterisk/sounds/ directory so they can be played by Asterisk.

First we will create a folder to hold the extra sounds. Make a new folder in the sounds directory called extras using the following command:
sudo mkdir /usr/share/asterisk/sounds/extras

Now change the current directory to so that your prompt is located in the new extras folder. When we download the files, the current directory the prompt is in is where the files get downloaded to. Use the following command:
cd /usr/share/asterisk/sounds/extras

Now to download the extras sound package we will use the wget command. This will download a file at a given URL. To download the file use the command:
sudo wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz

The file is in a zipped archive. To unzip and extract the files use the command:
sudo tar -xzvf asterisk-extra-sounds-en-gsm-current.tar.gz

The sound files should now be extracted into the extras folder. To test the new sounds out we will create a new extension, 202 to play one of the new sounds, zombies.gsm. Open the /etc/asterisk/extensions.conf file and add the following lines of code to the [phones] context:
exten => 202,1,NoOp(Play Extras Zombie Sound)
same => n,Playback(extras/zombies)
same => n,Hangup

If you notice the filepath used in the Playback() application is slightly changed. Starting the filename with “extras/” indicates to Asterisk that the media file is inside the extras folder, which is located in the sounds folder. It will not look there by default. Test your new dialplan by reloading it in the console and dialing extension 202.