How to Stream Music on Hold - Asterisk

rodstevens
rodstevens used Ask the Experts™
on
I have Asterisk running with FreePBX and I have a couple of MOH files that I want the other party to hear when they are on hold... Is there any way I can stream those MOH files without playing a separate tracks when 100 people are on hold... This cause music break-ups, and uses lots of memory or process, I can hear the fan working very hard to keep it cool...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Even though Asterisk does randomize the song it selects, it plays a different audio stream for every user, and so every user on the call has to have their own music stream being rendered.

You can minimize the effects of this by making sure your music is in a format that Asterisk can handle easily - like a native gsm or ulaw format

Consider giving this a read:
http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html/asterisk-book.html#asterisk-CHP-13-SECT-6

Asterisk also supports "streaming" music on hold, but you will need a source to stream from. Setting this up will most likely involve modifying /etc/asterisk/musiconhold_custom.conf, because on my version of freepbx, the "streaming music" categories in the music on hold section just plain don't work.

Here's some reference material:

http://www.elastixconnection.com/index.php?Itemid=87&id=19&option=com_content&task=view
http://www.voip-info.org/wiki/view/Asterisk+config+musiconhold.conf  <-- moh.conf reference
http://www.freepbx.org/support/documentation/module-documentation/music-on-hold/add-streaming-catagory

Author

Commented:
What if I don't want to to play songs on a different audio stream for every user? I need to have a consistent MOH stream so that the system doesn't have to work as hard since it will have 100 different audio stream if 100 people are on hold.
i think that the streaming MOH in asterisk will work for this, since there's only one data source, it would make sense for Asterisk to be optimized enough to only render the audio once and pass it to whoever needs it (saving you at least the processing power if not the bandwidth as well).

If would be dumb if asteriks renders the audio stream 100 times even if you are streaming from an uncontrollable source (e.g. internet radio or line in), but if that IS the way it does it.... there probably isn't much you can do about it except for optimize your sound files and get a more powerful server.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial