<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">The idea for the bugs is so you can stream audio to the channel<br>while it's doing something else.<br><br>As for the file format thing, I do think that can be adapted to<br>handle streaming audio too so I am going to add a little framework code so you could express file playback in url form such as<br><br>wav:///tmp/file.wav<br><br>which is silly yet valid but gives way to:<br><br>shoutcast://mystream.com/foo.stream<br><br>Look for that in the next commit.<br><br>a shoutcast type module could stand to benifit from a common streaming framework that registers as an application, a file format and a media bug.<br><br><div> </div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank"
href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>JABBER:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: "mda@discerning.com" <mda@discerning.com><br>To: freeswitch-dev@lists.freeswitch.org<br>Sent: Friday, March 9, 2007 5:12:49 PM<br>Subject: Re: [Freeswitch-dev] adding support for incoming streaming audio<br><br><div><br>On Fri, 9 Mar 2007 11:35:15 -0800 (PST), "Anthony Minessale" <anthmct@yahoo.com> said:<br>> The proper approach for this would be to use the
media_bugs which are <br>> used to record the session have have been recently enhanced to displace<br>> the actual audio with audio you can replace.<br><br>hmmm, I can see this for the case where someone might want to just<br>sniff the frames (like recording) or if it wants to do arbitrary<br>signal manipulation (such as noise cleanup or whatever).<br><br>(perhaps a more evocative name would be better, like "filter" or "interceptor"?)<br><br>but this case seems very similar in theory to what it would be to mux audio<br>in a conference, or bridge to a hardware endpoint -- something the<br>core should be able to do without me having to write all the <br>by-frame signal muxing?<br><br>> each streaming protocol can implement it's own mod<br>> say "mod_shoutcast" and have an application or api command interface<br>> hook to attach itself to the channel.<br><br>but for example that isn't what mod_iax does, yet an IAX call can<br>participate in a conference as a
member, right?<br>And so can dingaling.<br>so why would mod_shoutcast be different?<br><br>far be it to be to argue architecture with the architect :),<br>but i'm still at a loss as to how/why this should be a "media bug"<br>entity instead of a "file" entity or an "endpoint" entity.<br><br>-mda<br><br><br>> <br>> media bugs is a concept where you can latch a struct and a callback onto<br>> a channel. Your callback will be called continuously when audio is read<br>> or<br>> written to a channel and you can choose on setup if you want it to be<br>> called<br>> on read/write with muxed audio from both sides of a call or on write<br>> giving<br>> you a chance to replace the audio.<br>> <br>> <a target="_blank" href="http://www.freeswitch.org/docs/group__mb1.html">http://www.freeswitch.org/docs/group__mb1.html</a><br>> <br>> If you look in switch_ivr.c in switch_ivr_record_file<br>> <a target="_blank"
href="http://fisheye.freeswitch.org/browse/FreeSWITCH/trunk/src/switch_ivr.c?r=4489">http://fisheye.freeswitch.org/browse/FreeSWITCH/trunk/src/switch_ivr.c?r=4489</a><br>> <br>> You can see this is how it's possible to record from the background.<br>> <br>> If you look at mod_ivrtest.c (basically a scratch pad to test code)<br>> <a target="_blank" href="http://fisheye.freeswitch.org/browse/FreeSWITCH/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c?r=4400">http://fisheye.freeswitch.org/browse/FreeSWITCH/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c?r=4400</a><br>> <br>> the bugtest function shows how to set the channel up to run a bug<br>> that gives you a chance to replace the frames as they are supposed to be <br>> written to the channel so you could attach your shoutcast socket and<br>> whenever<br>> audio was to be written to the channel you could replace the frame with<br>> one<br>> from your stream so the caller would
hear the stream instead of silence<br>> or whatever the channel was really writing etc.<br>> <br>> <br>> When a bug is active on a channel it forces trancoding even when it's not <br>> necessary for a bridge so you can always get the audio as raw SLIN which<br>> is <br>> the only common audio format you can work with when combining media.<br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> Anthony Minessale II<br>> <br>> FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>> ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>> <br>> AIM: anthm<br>> MSN:anthony_minessale@hotmail.com<br>> JABBER:anthony.minessale@gmail.com<br>> IRC: irc.freenode.net #freeswitch<br>> <br>> FreeSWITCH Developer Conference<br>> sip:888@conference.freeswitch.org<br>> iax:guest@conference.freeswitch.org/888<br>>
googletalk:conf+888@conference.freeswitch.org<br>> pstn:213-799-1400<br>> <br>> <br>> ----- Original Message ----<br>> From: Mark D. Anderson <mda@discerning.com><br>> To: freeswitch-dev@lists.freeswitch.org<br>> Sent: Thursday, March 8, 2007 5:04:50 PM<br>> Subject: [Freeswitch-dev] adding support for incoming streaming audio<br>> <br>> I'd like to have a streaming audio source (not just playing a local file)<br>> for users while they are parked or waiting for a conference to start.<br>> <br>> In digging into FS it seems there are several ways this<br>> might be approached. Of course this is based on only a superficial<br>> understanding of the FS internals.<br>> But I've come up with 6 (count them, 6) possibilities:<br>> <br>> 1) hack the "playback" application.<br>> Right now, the lookup of driver in switch-core.c is by file suffix<br>> (with no override in xml conf).<br>> Currently the only real
format module is mod_sndfile.<br>> (The string constants for metadata like SWITCH_AUDIO_COL_STR_TITLE <br>> are conveniently set to be identical to the enum used by libsndfile.)<br>> <br>> It could be done by hacking mod_sndfile, or instead by<br>> making a new format driver, say "mod_url".<br>> libsndfile does not support mp3 (and won't), and is oriented around local<br>> files.<br>> So a mod_url driver would be better, with support for some suffixes <br>> like .pipe or .m3u or .mp3. It would need to do content-type sniffing<br>> in some cases.<br>> <br>> One issue is that it seems that mod_playback is blocking til completion.<br>> There is a timer in switch_ivr_play_file; it would be necessary to invert<br>> control there to allow the processing to proceed without the file ending.<br>> <br>> Pros: most useful; wherever a local file is used, a remote could be used<br>> instead.<br>> Cons:
non-trivial amount of hacking.<br>> <br>> 2) Use an external process to convert streaming audio into sip.<br>> For example, using mjua or pjsua as sip clients, along with some<br>> command-line streaming audio client such as streamripper.<br>> <br>> Pros: no change to FS required<br>> Cons: lots of moving parts, and the SIP gateway utility will probably<br>> require some hacking.<br>> <br>> 3) implement a "mod_shout" as an endpoint for shoutcast/icecast protocol<br>> <br>> Pros: fits in well with FS architecture<br>> Cons: requires understanding FS internals concerning threading,<br>> buffering, etc.<br>> <br>> 4) implement a "mod_rtsp" as an endpoint.<br>> This would mean I'd have to be satisfied with supporting only<br>> rtsp streaming audio, not shoutcast/icecast streaming audio.<br>> <br>> Pros: In theory there wouldn't be much to do, since there is already RTSP<br>>
support in the FS stack.<br>> Cons: requires underestanding FS internals *and* RTSP streaming audio<br>> <br>> 5) hack mod_conference to do stream-in just like record-out, as a thread.<br>> [I'm not sure why mod_conference does it that way, rather than at the<br>> core<br>> switch level (which *also* has session recording ability) -- isn't the<br>> point<br>> of a softswitch framework that it can allow<br>> for arbitrary combinations of modules? Shouldn't there be a way to<br>> supply an arbitrary channel as a member?]<br>> <br>> Pros: relatively easy to do by blindly copying the session record case.<br>> Cons: specific to conferencing, and makes mod_conference even bulkier.<br>> <br>> 6) implement mod_park with specific support for streaming audio<br>> [right now mod_park is just an empty stub.]<br>> <br>> Pros: standalone so easier to implement<br>> Cons: limits its usefulness to just that "application"<br>>
<br>> _______________________________________________<br>> Freeswitch-dev mailing list<br>> Freeswitch-dev@lists.freeswitch.org<br>> <a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>> UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>> <a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> ____________________________________________________________________________________<br>> Expecting? Get great news right away with email Auto-Check. <br>> Try the Yahoo! Mail Beta.<br>> <a target="_blank"
href="http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html</a> <br><br>_______________________________________________<br>Freeswitch-dev mailing list<br>Freeswitch-dev@lists.freeswitch.org<br><a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></div><br></div></div><br>
<hr size=1>TV dinner still cooling?<br><a href="http://us.rd.yahoo.com/evt=49979/*http://tv.yahoo.com/">Check out "Tonight's Picks"</a> on Yahoo! TV.</body></html>