Page 327 - Asterisk™: The Future of Telephony
P. 327

that will be entering the system using the GSM codec). Sure, you save some hard drive
               space, but the extra load on your CPU when it has to transcode all these files (not to
               mention the lower overall quality of the sound) makes the use of GSM undesirable, to
               our thinking. Use uncompressed files (such as .wav, .ulaw or .alaw) and your CPU will
               not have to work as hard. As an added bonus, your prompts will sound better.

                                   Sound Recording from the Dialplan

                  Surprisingly, one of the easiest ways to get respectable-quality recordings is not through
                  a PC with fancy editing software, but rather through a telephone set. There are many
                  reasons for this, but the most important is that the telephone will tend to filter out
                  background noise (such as white noise caused by HVAC equipment) and will record
                  at a consistent audio level.
                  This little addition to your dialplan will allow you to easily create recordings, which
                  will be placed in your system’s /tmp/ folder (from there, you can rename them and move
                  them wherever you’d like):
                     exten => _66XX,1,Wait(2)
                     exten => _66XX,n,Record(/tmp/prompt${EXTEN:2}:wav)
                     exten => _66XX,n,Wait(1)
                     exten => _66XX,n,Playback(/tmp/prompt${EXTEN:2})
                     exten => _66XX,n,Wait(2)
                     exten => _66XX,n,Hangup()
                  This snippet will allow you to dial from 6600 to 6699, and it will record prompts in
                  the /tmp/ folder using the names prompt00.wav to prompt99.wav. After you complete
                  recording (by pressing the # key), it will play your prompt back to you and hang up.
                  Be sure to move your prompts out of the /tmp/ dir to the Asterisk sounds directory. To
                  keep the dialplan readable, rename your prompt<XX> files to something more mean-
                  ingful. For example:
                     mv /tmp/prompt00.wav /var/lib/asterisk/sounds/custom/welcome-message.wav



               Music on Hold

               Any popular PBX system offers the ability to supply a source of music to be played for
               callers while on hold. Asterisk allows for a lot of creativity in this regard.

               Nowadays, everyone is familiar with the MP3 music format, and there is a lot of interest
               in using MP3s as a music-on-hold source. The concept sure seems like a good idea, but
               there are a few things that we think should be given some consideration:










                                                                          Music on Hold | 299
   322   323   324   325   326   327   328   329   330   331   332