Music on hold is a nice feature of asterisk, implemented through res_musiconhold.so. To setup music on hold the standard way you need to download recompile and install mpg123 as voip-info suggests.
Note that on Debian there's a symlink between mpg123 and mpg321 (which is not supported currently). So, download mpg123-0.59r.tar.gz, compile it, and install it (by default the package is installed in /usr/local/bin, which is the first path searched by asterisk).
Another way to setup music on hold is to integrate MoH patch (the patch is bundled with chanspy) into the asterisk package, thus enabling native file format decoding and removing mpg123 dependancy. What follows are some simple steps to setup a MoH extension using ulaw encoded files.
0. Prerequisites
# apt-get install build-essential dh-make patch
# wget <url-to-chanspy-tar-gzip-archive>
# tar xzf chanspy.tar.gz
This command creates a directory named chanspy
1. Patch and rebuild asterisk
# apt-get source asterisk
This command creates a directory named asterisk-<current-version> (in my case asterisk-1.0.1)
# cd asterisk-1.0.1
# patch -p0 < ../chanspy/mohpatch.diff
# dpkg-buildpackage -D -b
If this last command fails, make sure to fulfill all the dependencies (don't be warned if more than 50 packages need to be installed).
# dpkg -i ../asterisk_*.deb
2. Add a sample extension to asterisk
First add the following lines to /etc/asterisk/extensions.conf
exten => 1234,1,Answer
exten => 1234,2,SetMusicOnHold(ulawfiles)
exten => 1234,3,MusicOnHold()
Then configure the ulawfiles class in /etc/asterisk/musiconhold.conf adding these lines
[moh_files]
ulawfiles => /usr/share/asterisk/sounds/ulawfiles
Make sure to have some files to be played in the right place
# mkdir -p /usr/share/asterisk/sounds/ulawfiles
# sox -V example.mp3 -t au -r 8000 -U -b -c 1 \
/usr/share/asterisk/sounds/ulawfiles/example.ulaw resample -ql
3. Restart asterisk and make a call to 1234 and enjoy the music on hold...
# /etc/init.d/asterisk restart
4. Fine tuning and audio improvements
With format_mp3.so module MoH can also play mp3 files. Some files may play scratchy due to the high volume level, you can adjust the amplitude with the "-v volume" flag of sox.
Thursday, November 11, 2004
Subscribe to:
Post Comments (Atom)
3 comments:
Great entry. Linked from Daily Asterisk News here:
http://www.sineapps.com/news.php?rssid=308
Keep up the good work!
Cheers,
Matt
You said you will love me wow gold the whole life, but WoW Gold you marry her. You said you will wow power leveling,come to marry me, but this will not be carried out forever.WoW Gold I am trying my best to forget you and do not love you anymore. wow leveling But I failed and I still love you. Maybe wow leveling she needs you more compared wow leveling with me. So I tell you that world of warcraft power leveling you should love world of warcraft power leveling her and take good world of warcraft leveling care of her. You said I was so kind.world of warcraft leveling Yes, because I love you,world of warcraft leveling I hope you will be power leveling happy forever.
cheap products for man penis enlargement ideal penis enlargement
penis enlargement pills penis enlargement pills
penis enlargement exercises fast weight loss supplements fast weight loss
penis enhancement
natural penis enlargement
Post a Comment