Music On Hold

Hello, I am new to FreePBX and I am using it via a Raspberry Pi (it is an amazing setup and my big thanks goes to Ward Mundy for his hard work on getting FreePBX support on this hardware).

I am struggling a bit with Music On Hold. I am trying to upload a custom recording to use for all my hold music on both internal and external calls. So far I have not set up a trunk so I cannot tell what is happening on external calls, but for internal calls I can only get the pre-installed music to play no matter what I set.

I have tried deleting all the other songs in MOH leaving only my uploaded ones, that does not work. I have tried uploading as MP3 and using the converter plug-in which uploads and appears fine but when I test it goes back to playing the standard music that came with the distro. I have ensured it is encoded properly and tried as a ulaw and as a wave file at 8khz but that does not seem to make a difference.

All my searches on here have been fruitless so far, so this is my question - how can I get the same hold music from my custom music on both internal and external calls?

Thanks all for your help.

Please post some logs of a call being placed on hold so we can see what
Asterisk is doing.

I find it odd that you deleted the files and they are still playing. Did you delete the MOH files from the Linux command line?

Hi Alan, no I didn’t but you have inspired me to give that a shot. I have SFTP’d into the box and deleted all the MOH files - nothing played. So it seems the web interface does not necessarily correspond with what is actually going on.

After I did that it’s a bit brutal, but I took my MOH track and renamed it ‘macroform-cold_day.alaw’ and sent that to the box - that worked. Not ideal, but it does work for internal calls (I have not set up a trunk yet) and it’s working well. Thanks for your input, you inspired me to give this a try.

Gosh, you are making this 1000 times harder than it has to be.

Take a look at /etc/asterisk/musiconhold.com and /etc/asterisk/musiconhold_additional.conf.

What is in these files.

Also output of Asterisk ‘moh show files’

The command ‘moh reload’ will reread the config files and reset the MOH subsystem inside Asterisk.

I too have my brand new little Raspberry PI and was just getting MOH updated yesterday (yes, many thanks and kudos to Ward). I found that I needed to upload my custom file as a 16-bit mono .wav file). I’m a newbie too,but hopefully my tip will get you up and going past your little hurdle.

Before you do this go into the asterisk CLI (asterisk -r) and put your asterisk into SIP debug mode (SIP set debug on) and set verbose level to 10 (core set verbose 10). I bet when you try to put your call on hold that you see an error message related to not being able to open a file in 16-bit format.

You probably can upload the .mp3 file, but you might find it more efficient to have it play a .wav file.

I used a utility called golden wave to save my custom .mp3 file as at 16-bit .wav file).

I too use Wards IncrediblePBX for the RPi… simply awesome!

As with any recording that is played on the PBX, it needs to be in the same format as the audio codec. Transcoding from one codec to another requires CPU power, and happens each time the file is played. For this reason it is a good idea to have versions of your audio files in all the formats matching the VoIP codecs that you use - this way no in call transcoding needs to happen. This why you see all the audio files with -alaw -ulaw -gsm -g729 etc. at the end of the file name.

This doesn’t answer why it is not working for you, but it avoids there needing to be any in-call transcoding. :smiley: