That's a little much to explain over email.<div>maybe you should just study the code a little and look at examples in switch_ivr_async.c<br><br><div class="gmail_quote">On Tue, Jul 27, 2010 at 6:25 AM, Achim Stamm <span dir="ltr"><<a href="mailto:stamm@lyth.de">stamm@lyth.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
thanks for your reply.<br>
I found a Core Library called Media Bugs with several functions.<br>
How can i use this functions ?<br>
Can you give me an example using media bugs.<br>
Whats the difference between using hooks and using media bugs?<br>
<br>
regards<br>
<br>
Achim Stamm<br>
<br>
<br>
Anthony Minessale schrieb:<br>
<div class="im">> You can't, that's all wrong.<br>
><br>
> look for media bugs.<br>
><br>
><br>
> On Mon, Jul 26, 2010 at 5:08 AM, Achim Stamm <<a href="mailto:stamm@lyth.de">stamm@lyth.de</a><br>
</div><div><div></div><div class="h5">> <mailto:<a href="mailto:stamm@lyth.de">stamm@lyth.de</a>>> wrote:<br>
><br>
> Hello!<br>
><br>
> I have following problem:<br>
> My current session is connected to my own module which uses the<br>
> freeswitch API doing Read and write frames in the while loop.<br>
> I want bridge my current session to make an outbound call within<br>
> my while loop.<br>
> The calling of method bridge runs in a thread using modificated bgapi.<br>
> The outbounded phone rings and after picking it up the reading and<br>
> writing of frames is done only by freeswitch core and not any more<br>
> in my while<br>
> loop. But after bridging I want to keep control over reading and<br>
> writing<br>
> frames.<br>
><br>
> How can i gain control back or keep it over reading and writing<br>
> frames after bridging ?<br>
><br>
> A solution may be to run an extension instead of making the call<br>
> in while loop.<br>
> How can i execute an extension with<br>
> switch_core_session_execute_exten ?<br>
><br>
> Here is a snippet of my Dialplan:<br>
><br>
> <extension name="Caller"><br>
> <condition field="destination_number" expression="^1000$"><br>
> <action application="answer"/><br>
> <action application="info"/><br>
> <action application="set"<br>
> data="hangup_after_bridge=false"/><br>
> <action application="set"<br>
> data="ignore_early_media=true"/><br>
> <action application="myapplication"<br>
> data="DoingReadAndWriteFrames"/><br>
> </condition><br>
> </extension><br>
><br>
> Here is a snippet of my DoingReadAndWriteFrames from myapplication:<br>
><br>
> static switch_status_t DoingBridge(switch_core_session_t *session,<br>
> switch_input_args_t *args)<br>
> {<br>
> switch_codec_t codec = { 0 };<br>
> switch_status_t status;<br>
> switch_frame_t *read_frame;<br>
> switch_channel_t *channel =<br>
> switch_core_session_get_channel(session);<br>
> switch_stream_handle_t dstream = { 0 };<br>
><br>
> // Bridge to phone in a thread:<br>
> SWITCH_STANDARD_STREAM(dstream);<br>
> mybg_bridge("user/<a href="mailto:1012@192.168.1.30">1012@192.168.1.30</a><br>
</div></div>> <mailto:<a href="mailto:1012@192.168.1.30">1012@192.168.1.30</a>>" ,60, session, &dstream);<br>
<div class="im">><br>
> while (switch_channel_ready(channel))<br>
> {<br>
> // Read Frame :<br>
> status = switch_core_session_read_frame(session,<br>
> &read_frame, SWITCH_IO_FLAG_NONE, 0);<br>
> ...<br>
><br>
> CControlThirdPartyApplication::getInstance().setAudio(session,vucInAudio);<br>
><br>
> // Write Frame :<br>
> vucOutAudio =<br>
> CControlThirdPartyApplication::getInstance().getAudio(session);<br>
> ...<br>
> switch_status_t tstatus_caller =<br>
> switch_core_session_write_frame(session, read_frame,<br>
> SWITCH_IO_FLAG_NONE, 0);<br>
><br>
> // Make Outbound Call:<br>
> string dialNumber =<br>
> CControlThirdPartyApplication::getInstance().getDialNumber(session);<br>
> if (!dialNumber.empty())<br>
> {<br>
> // @ ToDo Dial outbound:<br>
> // execute another extension ("Test"), that<br>
> is doing our outbound call ??:<br>
><br>
> switch_core_session_execute_exten(session,"Test","XML","default");<br>
> // or Bridge to dialNumber in a thread:<br>
> //SWITCH_STANDARD_STREAM(dstream);<br>
> dialNumber = "user/" + dialNumber;<br>
> dialNumber = dialNumber + "@<a href="http://192.168.1.30" target="_blank">192.168.1.30</a><br>
</div>> <<a href="http://192.168.1.30" target="_blank">http://192.168.1.30</a>>";<br>
<div class="im">> mybg(dialNumber.c_str(), 60, session,<br>
> &dstream);<br>
> // if dialNumber pickup, than freeswitch<br>
> core read and write frames ?? I want control over read and write frame<br>
> }<br>
> }<br>
> }<br>
><br>
> regards<br>
><br>
> Achim Stamm<br>
><br>
> --<br>
> Achim Stamm, Dipl.-Inform. (FH)<br>
><br>
><br>
> Lyncker & Theis GmbH<br>
> Wilhelmstr. 16<br>
> 65185 Wiesbaden<br>
> Germany<br>
><br>
> Fon +49 611/9006951<br>
> Fax +49 611/9406125<br>
><br>
><br>
> Handelsregister: HRB 23156 Amtsgericht Wiesbaden<br>
> Steuernummer: 04323897052<br>
> USt-IdNr.: DE255806399<br>
><br>
> Geschäftsführer:<br>
> Filip Lyncker,<br>
> Armin Theis<br>
><br>
><br>
> _______________________________________________<br>
> FreeSWITCH-dev mailing list<br>
> <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
</div>> <mailto:<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a>><br>
<div class="im">> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Anthony Minessale II<br>
><br>
> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
><br>
> AIM: anthm<br>
> <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
</div>> <mailto:<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a>><br>
<div class="im">> GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
</div>> <mailto:<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a>><br>
> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> <<a href="http://irc.freenode.net" target="_blank">http://irc.freenode.net</a>> #freeswitch<br>
<div class="im">><br>
> FreeSWITCH Developer Conference<br>
> <a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
</div>> <mailto:<a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a>><br>
<div class="im">> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
</div>> <mailto:<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a>><br>
> pstn:+19193869900<br>
> ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">><br>
> _______________________________________________<br>
> FreeSWITCH-dev mailing list<br>
> <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
<br>
<br>
--<br>
Achim Stamm, Dipl.-Inform. (FH)<br>
<br>
<br>
Lyncker & Theis GmbH<br>
Wilhelmstr. 16<br>
65185 Wiesbaden<br>
Germany<br>
<br>
Fon +49 611/9006951<br>
Fax +49 611/9406125<br>
<br>
<br>
Handelsregister: HRB 23156 Amtsgericht Wiesbaden<br>
Steuernummer: 04323897052<br>
USt-IdNr.: DE255806399<br>
<br>
Geschäftsführer:<br>
Filip Lyncker,<br>
Armin Theis<br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div>