Streaming Audio

Home » Asterisk Users » Streaming Audio
Asterisk Users 5 Comments

hi All,

I am using 11.25.2 and musing on hold. CentOS 7.4

I am trying to setup a MusicOnHold() streaming audio.

I have one machine I tried this on and it worked. This machine is on the internet. I have another machine behind a firewall that does not play. Both machines installed mpg123.

I have a windows machine behind the firewall that plays the audio stream so firewall is not the issue.

I see no errors on the CLI, I see the MusicOnHold startup like it should –
just no audio. I took the setup directly from the internet setup that worked.

— Goto (smvoice-audio-streaming,s,1)
— Executing [s@smvoice-audio-streaming:1] Set(“SIP/401-00000000”,
“CHANNEL(MUSICCLASS)

5 thoughts on - Streaming Audio

  • Jerry,

    1) What do you have in musiconhold.conf?
    2) When you do a tcpdump for the host that mp123 is connecting to what do you see?

  • tcpdump -A -i eth0 port 10010

    give no output.

    music on hold entry is:

    [easyonhold]
    mode=custom application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 –mono -s http://streaming5.easyonhold.com:10010/strea ming/571c0e9d84290

    The stream is not complete. I removed the ending. if I past that stream into a windows browser behind the firewall it works.

    My server is CentOS 7.4
    I tried stopping iptables and firewalld re-ran the tcpdump command above and nothing.

    Thoughts?

    Jerry

  • If you run /usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 –mono -s http://streaming5.easyonhold.com:10010/strea from root does tcpdump show anything? What is asterisk runing as? I always use custom bash scripts when doing moh so I can put in my own logging. For instance:

    moh,sh:
    #! /bin/bash

    /usr/bin/ffmpeg -i ‘https:/myurl.com/playlist.m3u8’ -vn -ar 8000 -ac 1 -f s16le –
    echo “[$(date +%F) $(date +%T)] $0” >> /tmp/streams_down #Log downed streams for now. In the future put out an alert sleep $(( ( RANDOM % 60 ) )) #This is extremley important as if it’s not here the repeat will lockup a core on the box

    musiconhold.conf
    [test]
    mode=custom application=/etc/asterisk/moh.sh

  • running as root the mpg123 command it does output stuff as well does tcptump does also.

    I then started asterisk again and re-ran my tcpdump -A -i eth0 port 10010
    and I also got stuff coming out.

    I am also running both as root at the moment on my box.

    Jerry

  • try using mpg123 and the bash script that I posted. The last time I tried mpg123 with Asterisk was 10+ years ago. There were lots of issues back then and I went to madplay (and more recently ffmpeg for aac2 support) and have never looked back.

LEAVE A COMMENT