login | register
Wed 01 of Aug, 2007 [09:56 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.

Web www.voip-info.org
Shoutbox
  • Aykut, Wed 01 of Aug, 2007 [07:53 UTC]: Hi all, does anybody know about Thomson ST2030 SIP phone. I have upgraded it to latest version (1.56) but "Hold" and "Conf" features are not working after the upgrade ?? Do you know any solution or do you have Ver. 1.52 ?? Where can I find it?
  • Edward J Brown, Tue 31 of Jul, 2007 [23:33 UTC]: Has anybody experienced Choppy voice quality when using a Linksys SPA942 in an Asterisk Conference bridge? It works fine with my polycom and Cisco, but sucks with my Linksys.
  • www.astawerks.com, Fri 27 of Jul, 2007 [18:00 UTC]: does anyone use asterisk on top of clark connect? does it work good?
  • simon, Fri 27 of Jul, 2007 [14:16 UTC]: Hi All, Has anyone here managed to get the Cisco79x1 to successfully fail over to the backup proxy. I have 2 asterisk servers , handsets all register and function, except that backup proxy function doesn't work. Any working example would be very apprecia
  • Matthew Richmond, Thu 26 of Jul, 2007 [03:40 UTC]: using the page() application to page across our building...often the meetme conferences don't disconnect after the caller hangs up. Anyone else having this problem. (using Polycom phones)
  • Matthew Richmond, Wed 25 of Jul, 2007 [02:58 UTC]: thanks Nicholas Blasgen! I haven't worked with AGI before, but there's always a first! Thanks again!
  • Nicholas Blasgen, Tue 24 of Jul, 2007 [19:18 UTC]: Matthew Richmond, AGI will handle all that for you.
  • sam, Mon 23 of Jul, 2007 [16:39 UTC]: need help - certain voicemail extension will stop working and recording voicemail on asterisk - anyone know why and how to fix it? Thanks
  • john haji, Mon 23 of Jul, 2007 [14:55 UTC]: free calls to pakistan
  • bong, Sat 21 of Jul, 2007 [19:09 UTC]: hi good day to all can anyone help me how to configured the nortel sip to the signaling server and how to activate in mobile w/ sip compatible without mcs
Server Stats
  • Execution time: 0.20s
  • Memory usage: 2.17MB
  • Database queries: 28
  • GZIP: Disabled
  • Server load: 2.70

Using ffmpeg to convert Music On Hold files

Converting Asterisk Music On Hold files using ffmpeg

Letting asterisk play native file seems to be the best practice for MOH (MusicOnHold).
Here we'll convert all the mp3 files in one directory into two files. First one will be a WAV and the other a u-Law PCM all one step using ffmpeg.
Asterisk will choose the best file to play determined by the codec used on the channel.

This information is useful if you don't want to use a third party application such as mpg123 or you find using other applications to play MOH causes problems because you run asterisk on FreeBSD or something other then Linux.

Requirements

ffmpeg can be found at http://ffmpeg.mplayerhq.hu/
It's also in the FreeBSD ports

Configuration file

To make asterisk natively play files in /var/lib/asterisk/moh
This configuration will also play the files in random order.
Add the following to musiconhold.conf configuration file.
On FreeBSD /usr/local/etc/asterisk/musiconhold.conf
On Linux /etc/asterisk/musiconhold.conf

; Music on Hold
[default]
mode=files
directory=/var/lib/asterisk/moh
random=yes

Converting your MP3s

Command line for encoding all your mp3's in some directory using ffmpeg to a mono WAV and PCM u-Law file of 64kbits/s at 8000Hz sample rate.
These files will sound fine down a phone line. But not at a disco!
The resulting WAV and PCM u-Law files will be larger then the original mp3, but that's no big deal.

for f in `ls *.mp3` ; do FILE=$(basename $f .mp3) ; ffmpeg -i $FILE.mp3 -ar 8000 -ac 1 -ab 64 $FILE.wav -ar 8000 -ac 1 -ab 64 -f mulaw $FILE.pcm -map 0:0 -map 0:0 ; done

NOTE: If your filenames have spaces in them, you'll need to modify the command to something like this:

IFS=$'\n' ; for f in `ls -1 *.mp3` ; do FILE=$(basename "$f" .mp3) ; ffmpeg -i "$FILE.mp3" -ar 8000 -ac 1 -ab 64 "$FILE.wav" -ar 8000 -ac 1 -ab 64 -f mulaw "$FILE.pcm" -map 0:0 -map 0:0 ; done

With ffmpeg you should be able to convert almost any type of sound file. Just change the .mp3 extension to whatever sound file extension you have.

Moving the new files and restarting asterisk

move all the .wav and .pcm files to your moh directory and restart asterisk:

mv *.wav /var/lib/asterisk/moh/ ;mv *.pcm /var/lib/asterisk/moh/ ; asterisk -rx 'restart now'


Michael Hodges


Created by michael, Last modification by Steve Switzer on Sun 01 of Apr, 2007 [05:06 UTC]

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2007 Arte Marketing, Inc.

Powered by bitweaver