Recording IVR Voice Prompts

Create a folder in the /usr/share/asterisk/sounds/ directory to place your IVR audio recordings. To do this I will use the command:

sudo mkdir /usr/share/asterisk/sounds/ivr

For the best audio quality it would be recommended that you use professional recording equipment, edit and convert the audio to a format Asterisk can use, then upload the file to the /usr/share/asterisk/ivr directory. In this lesson we will take an easier approach and use the phone and dialplan to record our audio.

Change the permissions of the new ivr folder so that Asterisk can record files to the folder. To do this use the command:

sudo chown -r asterisk:asterisk /usr/share/asterisk/sounds/ivr

Create a new extension in the dialplan to record audio to the IVR audio directory. I will use extension 212. Also don’t forget to reload the dialplan after adding the new extension:

exten => 212,1,NoOp(IVR recording)
same => n,Answer
same => n,Record(ivr/temp.gsm)
same => Hangup

After recording the audio rename the temp.gsm file to an appropriate file name. You can use the mv command to rename a file in Linux command line. For example, to rename the temp.gsm file to mainmenu.gsm I would use the command:

sudo mv /usr/share/asterisk/sounds/ivr/temp.gsm /usr/share/asterisk/sounds/ivr/mainmenu.gsm

Repeat the steps of recording and renaming files until all prompts are recorded.