Streaming MOH – KlavoWiki

Streaming MOH with Asterisk

mpg123 is the application to be used to stream internet radio into Asterisk.

Installing mpg123

The first thing we need to do is to download the application mpg123. Go to the source forge site for the latest version.

I’ll use mpg123 Version 1.7.3 as an example.

cd /tmp


tar jxvf mpg123-1.7.3.tar.bz2

cd mpg123-1.7.3



make install

Configuring Asterisk

Edit the file musiconhold.conf and use the following as an example.




application=/usr/local/bin/mpg123 -q -r 8000 -f 8192 -b 2048 –mono -s



application=/usr/local/bin/mpg123 -q -r 8000 -f 8192 -b 2048 –mono -s

Reload MOH Module

From the CLI reload the MOH Module.

Asterisk 1.6.x

module reload

Asterisk 1.2.x, 1.4.x



When Asterisk first starts there is no connection to the configured radio stream. When the stream first started there is about a 30 to 35 second pause before any sound is heard. Once the channel is established the stream stops and starts when required.

Even though the connection is permanently kept alive there is no data transmitted while there is no one using the MOH stream.

Sky.FM after a period of time reset the connections to their servers. This causes an interruption in the music stream. Someone placed on hold may hear music and then a short pause, or a short pause and then music until the stream can be re-established.

viaStreaming MOH – KlavoWiki.

Retour en haut