Welcome to madhatt.com

A Simple website from a computer geek in Colorado with dreams of moving to Alaska

My Travels Photo Gallery

Trixbox streaming music on hold

Shoutcast Streaming MOH for Trixbox 2.0 Instructions I have written a document that outlines how to setup Shoutcast Streaming MOH for Trixbox 2.0. Please test and let me know what you think. I want to think many people here for coming up with bits and pieces. If you have mpg123 installed, you can check which version you have my typing the below from the command line. If it is not installed it will not return anything. mpg123 -v If the player is not installed, or you have an older version download and install version 0.59r by typing the following in command prompt, one line at the time. cd /usr/bin wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz tar -zxvf mpg123-0.59r.tar.gz cd mpg123-0.59r make linux make install ln -s /usr/local/bin/mpg123 /usr/bin/mpg123 Now you need to make a directory for the streaming music, do the following: cd /var/lib/asterisk/mohmp3/ mkdir stream Make a zero length dummy mp3 file inside of the stream directory, do: cd stream touch stream.mp3 Edit the musiconhold_additional.conf file and comment out the following lines: ;[default] ;mode=files ;directory=/var/lib/asterisk/mohmp3/ ;random=yes Next we will need to create a new conf file that will hold our settings so that Freepbx does not wipe them out: cd /etc/asterisk touch musiconhold_custom.conf chown asterisk musiconhold_custom.conf chmod 664 musiconhold_custom.conf Once the file is created, you will copy and paste the following into musiconhond_custom.conf using Config Edit from Freepbx: NOTE THAT THERE ARE 2 DASHES IN FRONT OF MONO NOT ONE!!! [default] mode=custom directory=/var/lib/asterisk/mohmp3/stream [default] mode=custom directory=/var/lib/asterisk/mohmp3/stream ;24k SKY.FM 80's ;application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 ;24k SKY.FM Top 40's application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 ;24k SKY.FM Soft Smooth Jazz ;application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 ;56k Hard Rockin 80's Hair Bands ;application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 ;24k SKY.FM Hit Country ;application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 When pasting the above lines, make sure that the application is on one continuous line. After completing this, just uncomment out which stream you want to use. Currently the stream that will work will be the Top 40’s. These are all 24k streams except for one, so they use very little bandwidth plus you don’t need anymore than that for a moh. You can then add the following to extensions_trixbox.conf using Config Edit in Freepbx to test: exten => 68742,1,Answer exten => 68742,2,MusicOnHold exten => 68742,3,Hangup You will need to reload asterisk after this is complete: amportal restart After Asterisk restarts, pick up the phone and dial 68742 (MUSIC). Enjoy!