[asterisk-users] Asterisk / Trixbox 2.6 Streaming MOH Problems

Gary T. Giesen giesen at snickers.org
Mon Mar 1 11:04:24 CST 2010


I've tried a number of solutions, but I've been unable to get Asterisk
working with streaming MOH without running into the "buffer" issue.

I've tried using various combinations madplay, mpg123, mpg321. I've
also tried streamplayer by itself, and in combination with play-fifo (
http://www.freeswitch.org/asterisk_stuff/play-fifo.c ) to try and
eliminate the issue.

For those that are unaware of the problem, what happens when you use a
streaming music source with asterisk is you have a process that is
running all the time that pipes MOH into stdout, which is then read by
asterisk. When a caller is on hold, asterisk starts reading from
stdin, and you get your music on hold. When the caller hangs up,
asterisk stops reading from stdin (and the pipe becomes blocking), and
a "buffer" is created (I'm not sure where the buffer resides, although
I suspect it's probably the system fifo pipe buffer). The problem
becomes, when the next caller comes in, and is put on hold, you will
hear that buffer (usually about 20-30 seconds), and then it will jump
to the current position in the stream, so you hear an ugly jump
between the middle of two songs. There was a magic version of mpg123
that was supposed to solve this problem (0.59r, I believe), but I've
been unable to get this to work.

For those interested, I'm streaming music off of a Barix Instreamer,
attached to a satellite radio source (and yes, I'm paying the proper
licence fees).

The only thing I've found that works so far is a pretty ugly (although
ingenious) hack as seen here
(http://www.mail-archive.com/asterisk-users@lists.digium.com/msg197299.html),
which creates its own host of problems (such as not being able to do a
"restart when convienent" since it generates a call on its own (that's
always running), so it's never "convienent" for asterisk to restart.
Also, when I do restart asterisk, I have to restart the call, so I'd
prefer having to go this route if at all possible.

Another solution would be if asterisk could spawn a new process for
every MOH caller. Is this possible?

Does anyone have a successful deployment of streaming music on hold
that they'd care to share? I'm using Asterisk 1.4 as part of Trixbox
2.6



More information about the asterisk-users mailing list