Streaming musiconhold via mpg123

Home » Asterisk Users » Streaming musiconhold via mpg123
Asterisk Users 6 Comments

At my wits end with this, and can’t proceed any further so I’m hoping
someone has seen this and can assist. I can not get streaming
musiconhold to work with Asterisk.

My Asterisk version is 1.8.8.0 and the mpg123 version is 1.9.1, OS is
CentOS 5.7. When I call the musiconhold class (default for example) I
get nothing but silence. I’ve exhausted my troubleshooting capabilities
at this point, I’ve tried everything I can think of to include:

– a newer version of mpg123, I went with the latest version
– verified I could play an MP3 file by itself in Asterisk by using the
MP3Player application

What does not work, is if I use the mpg123 application for musiconhold
to play a standalone file or a streaming source. I seem to be missing
something and I just can’t quite put a finger on it.

6 thoughts on - Streaming musiconhold via mpg123

  • Do you have a link to the bug report? I was unable to find anything but
    it’s possible I’m not looking hard enough 😉

    Here it is… please excuse the mess, it’s been a wild ride so my
    formatting/commenting has been left in-tact:

    ;
    ; Music on hold class definitions
    ; This is using the new 1.2 config file format, and will not work with 1.0
    ; based Asterisk systems
    ;
    ; #include musiconhold_custom.conf
    ; #include musiconhold_additional.conf
    ;[default]
    ;mode=custom
    ;application=/usr/src/mpg123/mpg123-1.13.4/src/mpg123 -q -s –mono -r
    8000 -f 8192 -b 0 http://scfire-ntc-aa03.stream.aol.com:80/stream/1074
    ;application=/usr/bin/mpg123 -q -s –mono -r 8000 -f 8192 -b 0
    http://scfire-ntc-aa03.stream.aol.com:80/stream/1074

    [test]
    mode=custom
    ;application=/usr/src/mpg123/mpg123-1.13.4/src/mpg123 -q -s –mono -r
    8000 -f 8192 -b 0 http://scfire-ntc-aa03.stream.aol.com:80/stream/1074
    ;application=/usr/bin/mpg123 -q -s –mono -r 8000 -f 8192 -b 0
    http://scfire-ntc-aa03.stream.aol.com:80/stream/1074
    application=/usr/bin/mpg123 -q -s -f 8192 –mono -r 8000
    /var/lib/asterisk/sounds/music/Rolling In The Deep.mp3

    I setup a simple 2 digit extension to call the test context and my MP3
    file nor my stream will play, and here’s something else interesting: If
    use the MP3Player application to play an MP3, mpg123 spawns and plays
    it. I came to this conclusion by running ps aux | grep mpg while the
    song was playing.

  • that bug is running since the start of 1.8 and has been fixed in 1.8.9

    https://issues.asterisk.org/jira/browse/ASTERISK-17474

    i know it says that after the first time asterisks starts it works but
    thats true only if the moh was loaded before the timing

    its a long story but the fix is finally in

    when typing timing test in the cli what timer to get if its dahdi then
    thats the probably problem

  • DAHDI it is…. are there any known workarounds? I use the FreePBX
    distro and they are a bit behind, so no telling when they will update.

  • You could preload the res_moh (don’t remember the full name) but that will only help until the next reload which is the next time you’ll click the orange bar

    Or use a different timer which could get you into other problems

    Maybe some else has a other idea