Asterisk mpg123 redhat

Musiconhold on RedHat Linux

Redhat (v7-v9) has replaced the mpg123 application with another application, mpg321, and created a symbolic link to "mpg123", so it seems to work in the same way. Asterisk MusicOnHold only works with original mpg123.

How to fix the problem

First, shutdown asterisk and kill all mpg process:

killall -9 mpg123

Second, remove the symbolic links mpg123 located in /usr/bin and /usr/local/bin:
rm /usr/bin/mpg123
rm /usr/local/bin/mpg123 (if exists)
Third, you need to download
And install using
rpm -ivh mpg123-0.59q-1.i386.rpm
I would suggest an alternative way of doing this which in my opinion is cleaner:

  1. cd /usr/src/asterisk
  2. make mpg123
  3. make install

This will automatically download mpg123 0.59r from its source, unpack it and compile it. Make install will install mpg123 together with Asterisk.

Please note that if you use RedHat (I'm using RH 7.3), your music on hold won't work unless you do this.

In the /etc/asterisk/musiconhold.conf file, ensure an entry like this exists:
; Music on hold class definitions
default => mp3:/var/lib/asterisk/mohmp3 ; location of mp3 files to play sequentially

No other changes are required to any other asterisk configuration files for simple Music On Hold use.

Last step (obviously) is start asterisk again.

On a properly configured system, the asterisk CLI will show something similar to the following when a sip phone places a call on hold:

— Called 3014
— SIP/3014-7874 is ringing
— SIP/3014-7874 answered SIP/3000-56f1
— Attempting native bridge of SIP/3000-56f1 and SIP/3014-7874
— Started music on hold, class 'default', on SIP/3000-56f1

Also see format_mp3 from asterisk-addons. This can be used as a replacement for a external mp3 decoder.
See Asterisk MusicOnHold Configuration for more info.

See Also

Created by: oej, Last modification: Tue 07 of Jun, 2005 (13:36 UTC) by jamieg
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+