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

FreePBX/PIAF – Transfering to voicemail

I couldn’t believe, how long it took me to find this simple answer, go ahead try googling “freepbx transfer a call to voicemail”, you will find forums with complex problems with transfers, voicemail and more.

Except my problem was, I simply didn’t know how to do it, so here it is.

1. if you are on the internal network and want to go directly to someone’s voice mail
press * followed by their extension ex: *2000

2. if you want to transfer an inbound call to someone’s voicemail
press ## followed by * and then their extension ex: ##*2000

if you omit the “*” it will ring that extension but by adding the “*” it goes directly to voicemail, quite useful, to leave yourself a message that get’s automatically sent to your email.

Asterisk, FreePBX, PBX in a Flash

What is Asterisk? well basically it’s a telephone system you normally see in large companies, which have an IVR, many extensions, with voicemail and features like: conference calling, call transfer, music on hold etc.

So I have been trying to play around with this open source system they call asterisk, for a few years, but always without success.

When I first gave it a go, it was a little intimidating, what with all the command line linux stuff, and editing config files with 1000s of options. If you don’t know what your doing, reading a couple of tutorials might not be enough to get going…. so at first, I was unsuccessful and put it aside.

many months later, I bought a book “Asterisk for Dummies”, I got a better understanding of the system, and managed to get some basic tests working, but nothing fancy… so I dropped it again.

Finaly a few years go by, and the open source community really pushed it forward to make it way easier to setup, automating a lot of the basic configurations… there are many flavors like: Asterisk@Home, Trixbox, FreePBX, and the one I chose to go with was “PBX in a flash”. These are all based on asterisk, I haven’t tried them all but i really like PIAF.

So in the last couple of weeks, I’ve been setting up my PBX, and even though it’s really easy to use, I still found myself stuck on basic things I just didn’t know about. So I decided to document some of my findings.

I will update this post to link to future FreePBX/PIAF hints and tutorials that took me hours to find through google.