[Icecast] icecast and asterisk

Andy Brown andy at thebmwz3.co.uk
Thu Mar 8 12:55:31 UTC 2007

Bayrouni wrote:
> Hello all,
> This is my first post to this list that I have just discovered.
> I am using icecast2 with ices2 and really it is great.
> I am using it also with ezstream.
> Now I would like to use icecast with  asterisk for the music on hold.
> I read all I found about this but without success.
> Is there anyway to use icecast and asterisk in the way that this works?
> Is there someone used asterisk and icecast to stream audio?  (music on
> hold in terms of asterisk)

Hi There,
Yes this is incredibly simple but not really relating to Icecast, so 
apologies to list people for starters.
I'll briefly explain, but all details are at:

Create the dummy folder:
mkdir /var/lib/asterisk/mohmp3-empty
In your musiconhold.conf put in something like:


Then create the shell script
/usr/bin/ogg123 -q -b 128 -p 32 -d wav -f - 
http://localhost:8000/stream.ogg| sox -r 16000 -t wav - -r 8000 -c 1 -t 
raw - vol 0.10

As you can see this uses the ogg stream from Icecast and converts it to 
wav format for asterisk to handle.
This is what I use for our installation here and have used similar 
combinations in the past.

Another simpler setup is in musiconhold.conf just put:

moh_icecast => custom:/var/lib/asterisk/mohmp3-empty,/usr/bin/mpg123 -q 
-s --mono -r 8000 -f 8192 -b 0 http://localhost:8000/stream.mp3

(note this needs to be an mp3 stream rather than ogg)

Hope that helps!

e: andy @ thebmwz3.co.uk
w: http://www.thebmwz3.co.uk
w: http://www.broadcast-tech.co.uk
t: 08704781480
f: 08704781595

More information about the Icecast mailing list