MPG123 CRASHES ASTERISK 1.4.28..

striderec

Joined
Nov 25, 2008
Messages
105
Likes
0
Points
16
#1
Greetings all,

I've read all kind of posts related to mpg123 crashing Asterisk 1.4.x when you use it for a streaming music category but nothing seems to be concrete to solve the issue.

I have Elastix 1.6-13 64 bits with Asterisk 1.4.28 and the latest mpg123 1.10.0 64-bit version (just in case I am told I am using the 32-bit version under the 64-bit environment).

The program seems to crash res_musiconhold.so at random times leaving the PBX unusable until you manually have to restart the asterisk server via /etc/rc.d/init.d/asterisk restart

But it also happens under 32-bit environments, it looks like Asterisk 1.4.28 doesn't like mpg123 so question is... do you know of a true workaround for this problem or, instead, do you know of a STEADY streaming audio application that Asterisk does like to play any stream?

By the way, another problem mpg123 has is that it stops playing the music after a few days as long as it does not crash asterisk first, of course! :p


Thank you in advance,


Paul
 

rodgerg

Joined
Aug 5, 2007
Messages
64
Likes
0
Points
0
#2
yes we have the same problem
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#3
This has been a real pain in the rear end for a while

Here is what I did to fix my issue

Removed mpg123 altogether and installed madplay

Files you need are
libid3tag-0.15.1b
libmad-0.15.1b
madplay-0.15.2b

You can get them from sourceforage
Now you need to edit your musiconhold_custom.conf as follows

[wave]
mode=custom
application=/tmp/music.sh

Then create a file in /tmp/ (or wherever you want to, just update the above lines too if you don't use /tmp) called music.sh
#!/bin/bash

wget -q -T 120 -O - http://216.155.137.148:8004 | /usr/local/bin/madplay -Q -o raw:- --mono -R 8000 -a -20 -

Your path to bash may differ, as well as paths to wget and madplay. Use locate or which to find them.
The obvious URL above is the station I've chosen, be sure you change it to the station you have selected.

You can create extension to test

exten => 6000,1,Answer
exten => 6000,2,SetMusicOnHold(default)
exten => 6000,3,MusicOnHold()
exten => 6000,4,HangUp

It took a little time to get this working but now don't have the previous issues
 

striderec

Joined
Nov 25, 2008
Messages
105
Likes
0
Points
16
#4
Thank you very much Dave!!!

Madplay works great...... But I yet have to test it further and see if it won't crash my asterisk but so far so good..... mpg123 is indeed a pain in the ass.. I wonder if madplay does not die after a few days like mpg123 does.. you know, if the internet connection experiences a little problem, you must restart asterisk and mpg123 to have streaming audio again.. i suppose that since your script uses WGET every time it is invoked, the audio never dies..... right?

In any case thank you very much! I added a karma for you.. Ah, and by the way, I like your instrumental radio station!

- Paul
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#5
When the internet goes down feed stops.
But took around 5 seconds when internet was back and music started again

Have had this running for 2 weeks and no real issues so far

Also have another method with madplay that gets rid of that pesky MOH starts from beginning on all calls placed on hold and never plays next mp3 in list.
Will post a howto in next few days for that method
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#6
good job, I'm glad I'm not the only one who had problem with mpg123. I played with it two months ago and never achieved to have a stable solution. I was putting that on all the mods and tries I've done on my server. I will try your fix later this week.

thanks
 

Amphibian

Joined
Sep 8, 2009
Messages
1,128
Likes
2
Points
38
#7
Well gents,

I went and did the streaming thingeeee also (all I wanted was to listen to Smooth Jazz) and it took down server as stated in previous post. Go figure, I read it in EWT, thought that would be cool thing to do,followed directions as stated and it crashes.

I assume that since I didn't see any fixes it still a major prob in the backside??? What is the best way to remove the MP-3 stuff? Is it in a seperate directory or is there 300 individual files I have to hunt for.

I guess before I make any more changes to this machine I should research the forum first, although I can't really complain, as it's been working for several months now without a glitch. I need to correct the short I have between the chair and the desk I guess.

Also did the portion get completed for the continuous, next in line play as mentioned? Is so where may I find that post?

Thanks Guys
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#8
Sorry I have not completed the next in line play, will try to get it done in next few days for you
But you will still need to install madplay.

The way I installed was to use webmin and search rpmfind for madplay
yum -y install webmin
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#9
Happy to report in Elastix 2.0 so far MPG123 does not crash in the 64bit version and streaming works fine.This is with 4 different streams for different inbounds

Have run this for 1 week solid so far in production to see if I could crash it.
 

lazergeek

Joined
Aug 25, 2010
Messages
2
Likes
0
Points
0
#10
I followed the instructions to setup using madplay. It worked at first using your sample stream, so I went to change it to a diffrent stream. Now it wont stop playing that stupid robot file. I changed everything back and still the same thing. I checked the permissions on the music.sh file and asterisk has full control

Any Ideas?

Thanks

David
 

ahmershuja

Joined
Jan 15, 2010
Messages
26
Likes
0
Points
0
#11
you don't need to restart asterisk or mpg123 just use this command with root password

killall mpg123

and you are done ;D
 

fmvillares

Joined
Sep 8, 2007
Messages
1,785
Likes
0
Points
0
#12
Re: Re:MPG123 CRASHES ASTERISK 1.4.28..

this item should be deleted as asterisk 1.4.28 is almost a year and a half old and it old history with this bug...this itema is no longer failing since ages ago.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,900
Messages
130,884
Members
17,561
Latest member
marouen
Top