<span>Hi,</span><br /><span>&nbsp;</span><br /><span>thank you for your help, but doesn't work.</span><br /><span>legA:ready() is true when the first session start and not when the call is answered.</span><br /><span>So legB is called at the same time.</span><br /><span>&nbsp;</span><br /><span>Any other suggestion?</span><br /><span>&nbsp;</span><br /><span>&nbsp;</span><br /><span>&nbsp;</span><br /><span>&nbsp;</span><br /><span>-----Messaggio originale-----</span><br /><span>Da: Sergey Scheglov &lt;sid@eltc.ru&gt;</span><br /><span>Inviato il: 13 Set 2011 - 17:15</span><br /><span>A: freeswitch-users@lists.freeswitch.org</span><br /><span><br /><br />? 13 Sep 2011 09:39:33 -0000<br />chrisbware@interfree.it wrote:<br /><br />&gt; <br />&gt; Hi guys,<br />&gt; <br />&gt; I've read anything on this argument on Wiki but I can't find a<br />&gt; complete answer.<br />&gt; <br />&gt; I need to bridge two calls in Lua, waiting the first to be answered.<br />&gt; My basic script is:<br />&gt; <br />&gt; local GwParams =<br />&gt; "origination_caller_id_number="..gateway..",sip_auth_username="..gateway..",sip_auth_password="..sip_passwd<br />&gt; local slegA =<br />&gt; "[ignore_early_media=false,"..GwParams.."]sofia/external/"..callee.."@"..sip_domain<br />&gt; local slegB =<br />&gt; "[ignore_early_media=true,"..GwParams.."]sofia/external/"..called.."@"..sip_domain<br />&gt; <br />&gt; legA = freeswitch.Session(slegA);<br />&gt; legB = freeswitch.Session(slegB);<br />&gt; freeswitch.bridge(legA, legB);<br />&gt; <br />&gt; <br />&gt; It works but legA and legB are called at the same time. Using:<br />&gt; <br />&gt; while (legA:answered()== false) do end;<br />&gt; <br />&gt; between the two session do the job but called parties can't hear<br />&gt; audio.<br />&gt; <br />&gt; I promise to add a script on wiki if you help me ! :)<br />&gt; <br />&gt; Thanks in advance.<br />&gt; <br />&gt; <br />&gt; -------------------------------------------------------------------------------<br />&gt; Valore legale alle tue mail<br />&gt; InterfreePEC - la tua Posta Elettronica Certificata<br />&gt; <a href="http://pec.interfree.it" target="new">http://pec.interfree.it</a><br />&gt; -------------------------------------------------------------------------------<br />&gt; <br />&gt; <br />&gt; <br />&gt; FreeSWITCH-users mailing list<br />&gt; FreeSWITCH-users@lists.freeswitch.org<br />&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="new">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br />&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="new">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br />&gt; <a href="http://www.freeswitch.org" target="new">http://www.freeswitch.org</a><br />&gt; <br /><br />Try:<br /><br />legA = freeswitch.Session(slegA);<br />if (legA:ready()) then<br /> legB = freeswitch.Session(slegB, legA);<br /> freeswitch.bridge(legA, legB);<br />end<br /><br />----<br /><br />Scheglov Sergey<br /><br /><br />FreeSWITCH-users mailing list<br />FreeSWITCH-users@lists.freeswitch.org<br /><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="new">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br />UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="new">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br /><a href="http://www.freeswitch.org" target="new">http://www.freeswitch.org</a></span><br />

<br>-------------------------------------------------------------------------------<br>Valore legale alle tue mail<br>InterfreePEC - la tua Posta Elettronica Certificata<br>http://pec.interfree.it<br>-------------------------------------------------------------------------------<br>