FreePBX/PIAF – how to change default music on hold (MOH)

Before I go into showing how to change the default music on hold, I want to mention streaming MOH, there’s a great tutorial in this forum post “streaming music on hold“.

here’s a quick recap how to:

1. log into our asterisk server:

ssh user@AsteriskServerIP

2. install mpg123

cd /usr/bin
wget http://apt.sw.be/redhat/9/en/i386/RPMS.dag/mpg123-1.6.3-1.rh9.rf.i386.rpm
rpm -ivh mpg*.rpm
rm mpg123-1.6.3-1.rh9.rf.i386.rpm
amportal restart

3. log into your Asterisk web portal.
Music on hold > add streaming category >
Sample fields:
Category Name: Twitlive stream
Application: /usr/bin/mpg123 -q -s –mono -r 8000 -f 8192 -b 0 http://www.twit.am/listen
Optional Format: blank

4. now that you have your stream setup, you can select the MOH in your inbound routes.

but what about the internal extensions, whenever I put them on hold, they still hear the default MOH, so this is how you change the default:

5. edit /etc/asterisk/musiconhold_additional.conf

you should see the following:

[default]
mode=files
directory=/var/lib/asterisk/mohmp3/
random=yes
[none]
mode=files
directory=/dev/null
[twitlive-stream]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://www.twit.am/listen

All you need to do is duplicate, the [twitlive-stream], rename it as default, and comment out the origina default with semi-colons, like this:

;[default]
;mode=files
;directory=/var/lib/asterisk/mohmp3/
;random=yes
[default]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://www.twit.am/listen
[none]
mode=files
directory=/dev/null
[online-music]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://www.twit.am/listen

One thought on “FreePBX/PIAF – how to change default music on hold (MOH)

Leave a Reply