<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>&nbsp;</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" &lt;mda@discerning.com&gt;<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" &lt;anthmct@yahoo.com&gt; said:<br>&gt; The proper approach for this would be to use the
 media_bugs which are <br>&gt; used to record the session have have been recently enhanced to displace<br>&gt; 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>&gt; each streaming protocol can implement it's own mod<br>&gt; say "mod_shoutcast" and have an application or api command interface<br>&gt; 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>&gt; <br>&gt; media bugs is a concept where you can latch a struct and a callback onto<br>&gt; a channel. Your callback will be called continuously when audio is read<br>&gt; or<br>&gt; written to a channel and you can choose on setup if you want it to be<br>&gt; called<br>&gt; on read/write with muxed audio from both sides of a call or on write<br>&gt; giving<br>&gt; you a chance to replace the audio.<br>&gt; <br>&gt; <a target="_blank" href="http://www.freeswitch.org/docs/group__mb1.html">http://www.freeswitch.org/docs/group__mb1.html</a><br>&gt;&nbsp;&nbsp;<br>&gt; If you look in switch_ivr.c in switch_ivr_record_file<br>&gt; <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>&gt; <br>&gt; You can see this is how it's possible to record from the background.<br>&gt; <br>&gt; If you look at mod_ivrtest.c (basically a scratch pad to test code)<br>&gt; <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>&gt; <br>&gt; the bugtest function shows how to set the channel up to run a bug<br>&gt; that gives you a chance to replace the frames as they are supposed to be <br>&gt; written to the channel so you could attach your shoutcast socket and<br>&gt; whenever<br>&gt; audio was to be written to the channel you could replace the frame with<br>&gt; one<br>&gt; from your stream so the caller would
 hear the stream instead of silence<br>&gt; or whatever the channel was really writing etc.<br>&gt; <br>&gt; <br>&gt; When a bug is active on a channel it forces trancoding even when it's not <br>&gt; necessary for a bridge so you can always get the audio as raw SLIN which<br>&gt; is <br>&gt; the only common audio format you can work with when combining media.<br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; Anthony Minessale II<br>&gt; <br>&gt; FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>&gt; ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>&gt; <br>&gt; AIM: anthm<br>&gt; MSN:anthony_minessale@hotmail.com<br>&gt; JABBER:anthony.minessale@gmail.com<br>&gt; IRC: irc.freenode.net #freeswitch<br>&gt; <br>&gt; FreeSWITCH Developer Conference<br>&gt; sip:888@conference.freeswitch.org<br>&gt; iax:guest@conference.freeswitch.org/888<br>&gt;
 googletalk:conf+888@conference.freeswitch.org<br>&gt; pstn:213-799-1400<br>&gt; <br>&gt; <br>&gt; ----- Original Message ----<br>&gt; From: Mark D. Anderson &lt;mda@discerning.com&gt;<br>&gt; To: freeswitch-dev@lists.freeswitch.org<br>&gt; Sent: Thursday, March 8, 2007 5:04:50 PM<br>&gt; Subject: [Freeswitch-dev] adding support for incoming streaming audio<br>&gt; <br>&gt; I'd like to have a streaming audio source (not just playing a local file)<br>&gt; for users while they are parked or waiting for a conference to start.<br>&gt; <br>&gt; In digging into FS it seems there are several ways this<br>&gt; might be approached. Of course this is based on only a superficial<br>&gt; understanding of the FS internals.<br>&gt; But I've come up with 6 (count them, 6) possibilities:<br>&gt; <br>&gt; 1) hack the "playback" application.<br>&gt; Right now, the lookup of driver in switch-core.c is by file suffix<br>&gt; (with no override in xml conf).<br>&gt; Currently the only real
 format module is mod_sndfile.<br>&gt; (The string constants for metadata like SWITCH_AUDIO_COL_STR_TITLE&nbsp;&nbsp; <br>&gt; are conveniently set to be identical to the enum used by libsndfile.)<br>&gt; <br>&gt; It could be done by hacking mod_sndfile, or instead by<br>&gt; making a new format driver, say "mod_url".<br>&gt; libsndfile does not support mp3 (and won't), and is oriented around local<br>&gt; files.<br>&gt; So a mod_url driver would be better, with support for some suffixes&nbsp;&nbsp;<br>&gt; like .pipe or .m3u or .mp3. It would need to do content-type sniffing<br>&gt; in some cases.<br>&gt; <br>&gt; One issue is that it seems that mod_playback is blocking til completion.<br>&gt; There is a timer in switch_ivr_play_file; it would be necessary to invert<br>&gt; control there to allow the processing to proceed without the file ending.<br>&gt; <br>&gt; Pros: most useful; wherever a local file is used, a remote could be used<br>&gt; instead.<br>&gt; Cons:
 non-trivial amount of hacking.<br>&gt; <br>&gt; 2) Use an external process to convert streaming audio into sip.<br>&gt; For example, using mjua or pjsua as sip clients, along with some<br>&gt; command-line streaming audio client such as streamripper.<br>&gt; <br>&gt; Pros: no change to FS required<br>&gt; Cons: lots of moving parts, and the SIP gateway utility will probably<br>&gt; require some hacking.<br>&gt; <br>&gt; 3) implement a "mod_shout" as an endpoint for shoutcast/icecast protocol<br>&gt; <br>&gt; Pros: fits in well with FS architecture<br>&gt; Cons: requires understanding FS internals concerning threading,<br>&gt; buffering, etc.<br>&gt; <br>&gt; 4) implement a "mod_rtsp" as an endpoint.<br>&gt; This would mean I'd have to be satisfied with supporting only<br>&gt; rtsp streaming audio, not shoutcast/icecast streaming audio.<br>&gt; <br>&gt; Pros: In theory there wouldn't be much to do, since there is already RTSP<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 support in the FS stack.<br>&gt; Cons: requires underestanding FS internals *and* RTSP streaming audio<br>&gt; <br>&gt; 5) hack mod_conference to do stream-in just like record-out, as a thread.<br>&gt; [I'm not sure why mod_conference does it that way, rather than at the<br>&gt; core<br>&gt; switch level (which *also* has session recording ability) -- isn't the<br>&gt; point<br>&gt; of a softswitch framework that it can allow<br>&gt; for arbitrary combinations of modules? Shouldn't there be a way to<br>&gt; supply an arbitrary channel as a member?]<br>&gt; <br>&gt; Pros: relatively easy to do by blindly copying the session record case.<br>&gt; Cons: specific to conferencing, and makes mod_conference even bulkier.<br>&gt; <br>&gt; 6) implement mod_park with specific support for streaming audio<br>&gt; [right now mod_park is just an empty stub.]<br>&gt; <br>&gt; Pros: standalone so easier to implement<br>&gt; Cons: limits its usefulness to just that "application"<br>&gt;
 <br>&gt; _______________________________________________<br>&gt; Freeswitch-dev mailing list<br>&gt; Freeswitch-dev@lists.freeswitch.org<br>&gt; <a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>&gt; UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>&gt; <a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt;&nbsp;&nbsp;<br>&gt; ____________________________________________________________________________________<br>&gt; Expecting? Get great news right away with email Auto-Check. <br>&gt; Try the Yahoo! Mail Beta.<br>&gt; <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>