You can't, that's all wrong.<div><br></div><div>look for media bugs.</div><div><br></div><div><br><div class="gmail_quote">On Mon, Jul 26, 2010 at 5:08 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;">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 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 in my while<br>
loop. But after bridging I want to keep control over reading and 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 in while loop.<br>
How can i execute an extension with 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" data="hangup_after_bridge=false"/><br>
<action application="set" data="ignore_early_media=true"/><br>
<action application="myapplication" 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, 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 = 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>" ,60, session, &dstream);<br>
<br>
while (switch_channel_ready(channel))<br>
{<br>
// Read Frame :<br>
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);<br>
...<br>
CControlThirdPartyApplication::getInstance().setAudio(session,vucInAudio);<br>
<br>
// Write Frame :<br>
vucOutAudio = CControlThirdPartyApplication::getInstance().getAudio(session);<br>
...<br>
switch_status_t tstatus_caller = switch_core_session_write_frame(session, read_frame, SWITCH_IO_FLAG_NONE, 0);<br>
<br>
// Make Outbound Call:<br>
string dialNumber = CControlThirdPartyApplication::getInstance().getDialNumber(session);<br>
if (!dialNumber.empty())<br>
{<br>
// @ ToDo Dial outbound:<br>
// execute another extension ("Test"), that is doing our outbound call ??:<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>
mybg(dialNumber.c_str(), 60, session, &dstream);<br>
// if dialNumber pickup, than freeswitch 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>
<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>
</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>