Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] buffer-issue when piping live-streams into


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
russell at digium.com
Guest





PostPosted: Thu Jan 17, 2008 3:52 pm    Post subject: [asterisk-users] buffer-issue when piping live-streams into Reply with quote

Michael Kamleitner wrote:
Quote:
10:00 I'm calling the pbx, musiconhold starts correctly to play the
live-stream (almost live, with very small delay) - that's OK.
10:01 I hangup.

-- than I pause for 20 min --

10:20 I'm calling a second time. However moh now doesn't stream live, but
starts to continue playing the stream from 10:01. This goes on for about
30secs, then the replay stops for a second and continues at the correct
position (once again, rather "live"). along I get this message at the
console:

<snip>

Quote:
musiconhold.conf:

[default]
mode=custom
application=/etc/asterisk/mohstream.sh

mohstream.sh

#!/bin/bash
/usr/bin/wget -q -O - http://my.stream.com:8000 | /usr/bin/madplay -Q -z -o
raw:- --mono -R 8000 -a -12 -

Most players don't work quite correctly with Asterisk MOH. For it to work the
way you expect, the player you are using must throw away the audio when Asterisk
isn't currently reading from the stream. There was a magic version of mpg123
(0.59r IIRC) that did that, and that is why it was the recommended version.

If you're reading from a raw TCP stream, then you can use the small streamplayer
utility included with Asterisk. Otherwise, I don't really have a good
suggestion for you right now. I suppose that you could use some sort of hack to
ensure that music on hold is always playing so that the stream is being serviced.

extensions.conf:

[moh_hack]

exten => hack,1,Answer
exten => hack,n,StartMusicOnHold(default)
exten => hack,n,While(1)
exten => hack,n,Wait(300)
exten => hack,n,EndWhile()

*CLI> originate Local/hack at moh_hack application Echo

--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.
Back to top
russell at digium.com
Guest





PostPosted: Thu Jan 17, 2008 5:32 pm    Post subject: [asterisk-users] buffer-issue when piping live-streams into Reply with quote

Michael Kamleitner wrote:
Quote:
thx a lot russel...your hack actually works!! Smile

Awesome. Smile

Quote:
Meanwhile I've found something about the musiconhold-conf-option
"cachertclasses", which might help in starting a separate instance for every
caller. however, that didn't really work for me... probably this option only
works for mode=files?!

http://www.asterisk.org/doxygen/trunk/Config_moh.html
http://lists.digium.com/pipermail/asterisk-commits/2007-November/017911.html

Well, that option only exists in Asterisk trunk, and is only relevant when using
realtime for music on hold. I assume you're probably using one of the released
versions of Asterisk, so this wouldn't be available.

Quote:
anyway, thx a lot for your suggestions Smile

You're quite welcome. I'm glad I could help out.

--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services