SOLVED Fixed: Streaming MOH

ustelephone

Member
Joined
Sep 21, 2010
Messages
122
Reaction score
0
Can anyone point me to a good link for setting up a streaming audio for MOH? My client is asking for a local radio station that has streaming audio online.
 

markb1439

New Member
Joined
Jun 8, 2010
Messages
96
Reaction score
0
Hi,

I don't know if you aware of this, but...

In addition to the technical aspects of setting this stream up as your MOH, there are the legal issues of royalties and such. Some people think that you can use a radio broadcast in this fashion without royalties or repercussions because it's free public radio. However, this is not apparently the case. The RIAA (and others) view this as a rebroadcast which is subject to royalties. And those royalties can be substantial, so it might not be worth doing. This is why royalty-free MOH is so popular.

Just my .02.

Mark
 

luckman212

Guru
Joined
Jul 7, 2010
Messages
272
Reaction score
0
Ward, is that page applicable to ast 1.8 / piaf purple? because I've been trying desperately to make it work, but all I can get asterisk to playback from the local stream is silence.

I've added a "streaming" musiconhold class to Piaf. Name of it is "test". The exact app string that I am using is:
/usr/bin/mpg123 -q -s -m -r 8000 -f 8192 -b 0 http://scfire-mtc-aa04.stream.aol.com/stream/1040

I know this works because if I type the command on the shell, but instead pipe the sound out to the headphone jack (command switch -oh instead of -s) I can hear the music!

also
ps ax | grep mpg123

shows that its running, and not dying. But when I dial the 466 ext that I set up to just play that stream, I just hear silence. I added a Flite command in the context that says "music" and I do hear that-- so I know I am hitting the correct context.

Here's what that looks like:
exten => 466,1,Answer
exten => 466,n,Flite("music")
exten => 466,n,MusicOnHold(test)
exten => 466,n,Hangup


here's the console output when I dial 466
root@pbx:/ $ asterisk -rvvvvv
Verbosity is at least 5
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [466@from-internal:1] Answer("SIP/703-00000031", "") in new stack
-- Executing [466@from-internal:2] Flite("SIP/703-00000031", ""music"") in new stack
== Parsing '/etc/asterisk/flite.conf': == Found
-- <SIP/703-00000031> Playing '/tmp/Flite_893730274.slin' (language 'en')
-- Executing [466@from-internal:3] MusicOnHold("SIP/703-00000031", "test") in new stack
-- Started music on hold, class 'test', on channel 'SIP/703-00000031'


any ideas on why its not working? I know streaming MOH is generally frowned upon but this is for my "home/hobby" pbx just to tinker with. thanks!
 

luckman212

Guru
Joined
Jul 7, 2010
Messages
272
Reaction score
0
Does anyone think this is just an Asterisk 1.8 problem? Because I ran a few shell commands and it appears that the stream is running (mpg123) and has an "ESTABLISHED" connection. So everything looks good from the outside. But I have only silence on that channel. Before I blow out my pbx and reinstall 1.6 I was wondering if *anyone* has gotten streaming audio to work on a purple install.
Code:
root@pbx:~ $ ps ax | grep "mpg"
10585 ?        S      0:00 /usr/bin mpg123 -q -s -m -r 8000 -f 8192 -b 0 http://scfire-mtc-aa04.stream.aol.com/stream/1040

root@pbx:~ $ netstat | grep -i "scfire"
tcp    77705      0 pbx.lan:35695               scfire-mtc-aa04.stream:http ESTABLISHED
also is it a problem that there's a space in between /usr/bin and "mpg123" in the ps output above? shouldn't it show up as /usr/bin/mpg123? That's how I have it in musiconhold_additional.conf.

edit: just wanted to add that I updated to Asterisk 1.8.1 this morning and no change, still can't get the streaming moh to work :(
 

luckman212

Guru
Joined
Jul 7, 2010
Messages
272
Reaction score
0
:beatdeadhorse5:

no, seriously, I had another thought, does anyone think this could be some kind of codec/translation issue? Because like I said I've got mpg123 running in the ps ax list and watching the * CLI I can see that it does this when I dial 466, which seems correct:
-- Executing [466@from-internal:1] Answer("SIP/703-00000003", "") in new stack
-- Executing [466@from-internal:2] Flite("SIP/703-00000003", ""music"") in new stack
== Parsing '/etc/asterisk/flite.conf': == Found
-- <SIP/703-00000003> Playing '/tmp/Flite_1787080546.slin' (language 'en')
-- Executing [466@from-internal:3] MusicOnHold("SIP/703-00000003", "stream") in new stack
-- Started music on hold, class 'stream', on channel 'SIP/703-00000003'


Everything "should" be working, but I just hear silence. I do hear Flite say "music" as indicated. I'm up to Asterisk 1.8.1.1 now. I noticed mpg123 has a commandline option "--encoding" which I assume can force the audio into a specific format. The help says:

-e <c> --encoding <c> force a specific encoding (s16 u16 u8 s8 ulaw alaw f32 s32 u32)

Could this be needed?
 

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
772
Reaction score
124
Can someone 'fix' this to show what the update is to allow this to work? I'm getting complaints about my MOH.
It is 'tinny', too loud, etc.

Andrew
 

Members online

Forum statistics

Threads
25,810
Messages
167,752
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top