Streaming MOH

Streaming MOH
Sorry for post, but I have read all the threads and links on here and other sites.

I cannot get streaming MOH to work at all.
Please somebody can you give me a detailed step by step instruction on how to set this thing up.

I cannot seem to get my head around this thing.

Have you read this article

Here is a very good article


I have read them both over and over again. I think I’m getting confused or lost in the musiconhold.conf and musiconhold_custom.conf files somewhere.

Hmpf, if you are using FreePBX 2.5 or later all you have to do is to click on Music on Hold, click on Add Streaming Category, fill in the details and away you go.

You need mpg123 and the details for the stream.

Just follow the Elastixconnection article, go to the heading STREAMING MUSIC ON HOLD FOR FREEPBX 2.5 AND FURTHER

You can start by testing this string for a stream (Application in FreePBX):

/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 1024

Note, for this to work you need three things:

  1. FreePBX 2.5 or later
  2. mpg123 (test by typing mpg123 -v in a shell)
  3. Patience, the above stream takes almost 30 seconds to start.

Note 2: Don’t abuse the above link, it is my favorite radio station Gamla Godingar from Sweden. Just use it for the test.

Note 3: No, I don’t answer questions about how to obtain mpg123 if it is not available as that question have been asked and answered many many times.

Is there a setting I need to address to make stream default?

I have tried this thing in Add stream no go
Tried musiconhold.conf and musiconhold_custom.conf still nothig.

Below is my musiconhold.conf file

; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with 1.0
; based Asterisk systems
#include musiconhold_custom.conf
#include musiconhold_additional.conf
default =>quietmp3:/var/lib/asterisk/mohmp3/stream,http://scfire-mtc-aa04.strea$

default => /var/lib/asterisk/mohmp3,r
#include musiconhold_additional.conf
; class definition for Streaming MOH
;stream => quietmp3:/var/lib/asterisk/mohmp3/stream
; class definitions For A2Billing
acc_1 => mp3:/var/lib/asterisk/mohmp3/acc_1
acc_2 => mp3:/var/lib/asterisk/mohmp3/acc_2
acc_3 => mp3:/var/lib/asterisk/mohmp3/acc_3

This is my musiconhold_custom.conf file

;placeholder for future expansion PIAF Dev Team
application = /usr/bin/mpg123 -q -s --mono -r 8000 -f 800 -b 0 http://scfire-dt$

Why are you editing the files??? Don’t do that!

musiconhold.conf should only contain this:

; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with 1.0
; based Asterisk systems
#include musiconhold_custom.conf
#include musiconhold_additional.conf

When you add the streaming in FreePBX it writes out those changes to musiconhold_additional.conf

If you have followed my example above your musiconhold_additional.conf will look something like this:

application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 1024

And that is all there is to it. Have you verified that you have mpg123 installed?

And NO, you can’t make streaming default

I going to start from a fresh install and try it again just in case i screwed something up. But Im not the only one having trouble with this I check the forums and irc and they all have some kinda of complaint either it worked or they gave up.

I even called some of the so called paid support people who advertise online not FREEPBX support but others and they were just as lost as me.

Just a thought, if you run the application line in a shell, do you get garbage on the screen after a while? (ctrl-c to end the garbage)

If you don’t get that, you have a network problem, solve that and it should work.

Thanks I got and i got it to play as default.

Also i deleted your favorite station after testing.

I will NOT leave it that way just wanted to see it done.

Dear Sir,
Can u tell more clearly , i am useing freepbx 2.7 , But No voice

I know this is an old thread but I found it while looking for a solution myself.
My problem was that I was trying to stream aac and not mp3. I discovered this by running mpg123 from the shell with the verbose flag (-v) as suggested above.

I had my previous post unanswered while trying to make streaming mode the default MoH class
So I found your post stating it is not possible: is this the final answer ?
Is that why I can find lot of people asking for this feature but all questions unaswered ?
is it so hard to make a config like

application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 1024 http://etcetcetc

to be user-edited ??

Or is there some technical reason it is not or not made possible ???

Thank you

I can’t get it to work either.

Not completely.

using this:

/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 1024

I get a horrible screeching sound.

The link works in VLC Media player, so this must be something else causing the horrible screeching.

Just tried
/usr/bin/mpg123 -q -s -m -r 8000 -f 8192 -b 0
it works like a charm…

1 Like

I think you can just leave the -b flag off completely now.

For those who come along later, note that MPG123 only supports mpeg3 files, and many radio stations are now streaming MPEG4. To get that to work, you’ll need to figure out how to install VLC and to get it to work.

It may also be a good idea to update mpg123 to a newer version. The version distributed with FreePBX is somewhat buggy and may result in dead streams.

Also, note that when you set-up streaming MOH, the stream runs non-stop, 24/7, even when nobody is listening to the MOH…

1 Like