"mpg123 is a real time MPEG Audio Player for Layer 1,2 and Layer3. (MPEG 2.0 with Layer1/2 not heavily tested) Tested with Linux, FreeBSD, SunOS4.1.3, Solaris 2.5, HPUX 9.x and SGI Irix. Plays Layer 3 in stereo on an AMD-486-120Mhz or (of course) a faster machine. (Just for info: mpg123 plays an average 128bps stream, with about 66% in full quality on my AMD 486-133MHz machine) Note: this player is only for non commercial use."
Homepage of MPG123
mpg123 version 0.59r is known to work with Asterisk.
Do not install or use mpg321 on the linux-System because it does not do the necessary converting of the frequency.
So e.g. if your music on hold sounds odd on the phone, most likely there is a problem with the codec/player.
INSTALLING THE CORRECT VERSION
If you are *EVER* unsure that mpg123 is correctly installed (correct verison etc), you can enter the asterisk source tree, and type 'make mpg123' (without quotes), and mpg123 v0.59r will be download ed, unpacked, and built for you, and then a simple make install will install asterisk AND mpg123 in one smooth motion.
-Josh
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.
Page Changes
broken'make mpg123'
I have the same problem with Slackware 11.0, gcc 3.4.6, GNU Make 3.81
Same Problem in Suse 10.2
gcc: gcc-4.1.3-29
make: make-3.81-23
I was compilling mpg123 in my suse box (10.2 version) and I had the same problem of Mathias Pasquay. I did the same changes and works normally. I don't know why, but works. :) My gcc is gcc-4.1.3-29 and make is make-3.81-23.
Debian Sid (gcc 4.11 and make 3.81) workaround
<pre>
gcc -DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX \
-DREAD_MMAP -DOSS -DTERM_CONTROL\
-Wall -O2 -m486 \
-fomit-frame-pointer -funroll-all-loops \
-finline-functions -ffast-math -c -o dct64_i386.o dct64_i386.c
<command line>:1:13: warning: missing whitespace after the macro name
as -o decode_i586.o decode_i586.s
make3: *** No rule to make target `\
', needed by `mpg123'. Stop.
</pre>
I just changed these lines in the Makefile
<pre>
linux:
$(MAKE) CC=gcc LDFLAGS= \
OBJECTS='decode_i386.o dct64_i386.o decode_i586.o \
audio_oss.o term.o' \
CFLAGS='-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX \
-DREAD_MMAP -DOSS -DTERM_CONTROL\
-Wall -O2 -m486 \
-fomit-frame-pointer -funroll-all-loops \
-finline-functions -ffast-math' \
mpg123-make
</pre>
in these two lines
<pre>
linux:
$(MAKE) CC=gcc LDFLAGS= OBJECTS='decode_i386.o dct64_i386.o decode_i586.o audio_oss.o term.o' CFLAGS='-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX -DREAD_MMAP -DOSS -DTERM_CONTROL -Wall -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math' mpg123-make
</pre>
now it works. I don't know if this is a Debian specific problem or if it has something to do with my make or gcc version.