Asterisk music on hold

From LinuxMCE
Revision as of 22:17, 17 December 2010 by Mexious2011 (Talk | contribs) (New page: Ok, so my first wikki page submission! This page will explain how to get customer music on hold in your asterisk and also how to use customer system recordings. Firstly, music on hold. A...)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Ok, so my first wikki page submission!

This page will explain how to get customer music on hold in your asterisk and also how to use customer system recordings.

Firstly, music on hold. As you may know, when you phone a business or company and you are placed on hold, generally you will hear either music or a radio station playing. Well you can do the same with your home asterisk PBX system.

I'll begin simply to start with as there are various options involving music on hold.

When you recieve a call and during the call you have to put them on hold, either to transfer them to another phone in the house or even just so you don't burn your mac and cheese sitting on the stove you can add your own custom music that the caller will hear as they sit on hold patiently waiting for you to come back to them (of course they don't realize your mac and cheese are burning down your kitchen)

There is built on hold music, but it's a little dull and boring, great for a business, but you want something a little more exciting for home.

So, firstly work out what you would like to use. either great 60s or 70s classics, death metal, hard core techno or perhaps something a little more mellow so you don't frighten your caller, really bad if grandma phones and she hears Ramstein!

Now that you have worked out what you wish to use, your files will most likely be in MP3 format. For the audio files to work in your asterisk system you will need to convert your audio file/s to ".sln" This format is quite common in asterisk systems and the same for ".gsm" .

To do this, you will firstly need to convert your mp3 files to wav.

Steps

  1. 1 Get your self an audio converter which converts mp3 to wav. there are pleanty out there, try and find your self a free one. You can also use a wav editor for any audio gurus out there such as soundforge, adobe audition or even a free one called "Audacity" which is simple and easy to use.
  1. 2 Log in to the LMCE admin page and navigate to ->Advanced ->Configuration ->Phones Setup, then navigate to "Music On Hold" You will see there is a Catagory in there titled "default" this is where your default music on hold is stored. You have the option to create your own catagories, such as those mentioned above that will either have your best mate shuffeling to techno or grandma freaking because she hears ramstein while they wait on hold. If just want to keep it simple and stick with the default section then skip this. For more than the default catagory, click on "Create New Music Catagory" give it a name and there you go.
  1. 3 No you need to transfer the audio files you converted to .wav to the asterisk system. I have found that by uploading through the MOH page, files won't work. To do this, you need WinSCP. It's an ssh based file transfer client which allows you to transfer files between windows and linux systems. I should also mention you will need a root enabled account to do this. I enabled my root account because there are certain things i need to do which require "root" rather than just "sudo" such as remote file transfer.
  1. 4 Once logged in to your LMCE core, navigate to "/var/lib/asterisk/mohmp3" you will notice 2 files in there, they are the default music on hold audio files that came with asterisk. If you created custom music on hold catagories, you will notice those in there also. Navigate to where you saved your audio files and drag them across to the appropriate directory on the remote system.
  1. 5 Now we need an SSH terminal, login to your system and navigate to where we just put our audio files. "cd /var/lib/asterisk/mohmp3"
  1. 6 run the following command on all your audio files "then-name-of-your-origional-file.wav -t raw -r 8000 -s -w -c 1 the-name-you-want-to-call-your-converted-file.sln"

OK! now we have all your music on hold files done. I'd suggest getting rid of the wav files as it just looks messy. Go back to WinSCP and refresh the remote directory and delete any wav files.

No we need to give your asterisk system a quick restart so it knows there are changes. From your ssh terminal run "/etc/init.d/asterisk restart" and bobs your uncle!

Now call a phone in the house, place the call on hold and your should hear your new music!

More To Come

I'll post some more later regarding custom system recordings and also and also how to use an internet radio station as your music on hold. But for now, enjoy.