This seems to do the trick, unless anyone can suggest anything more elegant than the while loop?<div><br></div><div><div>obSession = freeswitch.Session("sofia/lpmedia/<a href="http://91979197@10.15.20.122:5060">91979197@10.15.20.122:5060</a>")</div>
<div>obSession:setVariable('bypass_media', 'true');</div><div><br></div><div>function myHangupHook()</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>freeswitch.consoleLog("INFO", "hungup\n");</div>
<div>end</div><div><br></div><div>if obSession:ready() then</div><div><br></div><div> obSession:setHangupHook("myHangupHook")</div><div><br></div><div> obSession:execute("bridge", "sofia/lpmedia/<a href="http://2000@10.15.20.122:5060">2000@10.15.20.122:5060</a>")</div>
<div><br></div><div> while (obSession:ready() == true) do</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>obSession:sleep("1000");</div><div> end</div><div>end</div></div><div><br>
</div><div><br><br><div class="gmail_quote">On 6 October 2010 11:38, Pete Kelly <span dir="ltr"><<a href="mailto:pkelly@gmail.com">pkelly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div class="im">On 6 October 2010 11:28, Wasim Baig <span dir="ltr"><<a href="mailto:wasim@convergence.pk" target="_blank">wasim@convergence.pk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Perhaps you've got it setup async, in which case nothing blocks FS from going through the rest of the script after the bridge.<div>You need to tell Lua to watch out for a hangup on either leg after the bridge before continuing with the script.</div>
<div>Or do it sync.</div></div></blockquote><div><br></div></div><div>That sounds like exactly what is happening, as the while loop prevents the hangup.</div><div><br></div><div>How would you suggest I watch for the hangup? If I check the output of obSession:hangupCause() and obSession:hangupState() within the while loop they are always both set to SUCCESS (during the call, and after hangup).</div>
<div><br></div><div>Hangup hook maybe?</div><div><div></div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>
<div>-wasim<div><div></div><div>
<br><br><div class="gmail_quote">On Wed, Oct 6, 2010 at 15:21, Nyamul Hassan <span dir="ltr"><<a href="mailto:mnhassan@usa.net" target="_blank">mnhassan@usa.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That does not look like the full log. Can you put the complete log,<br>
right from the start to the end, in the PasteBin?<br>
<br>
Also, it appears that both the legs are to the same IP. Is that by design?<br>
<br>
Regards<br>
HASSAN<br>
<br>
<br>
On 2010-10-06, Pete Kelly <<a href="mailto:pkelly@gmail.com" target="_blank">pkelly@gmail.com</a>> wrote:<br>
> After the call is set up, Freeswitch sends a reINVITE to legA, with legB's<br>
> media IP/port, then vice versa.<br>
><br>
> Then it sends a BYE to both legs immediately .<br>
><br>
> However I've put a dummy while loop after the bridge:<br>
><br>
> while(1==1) do<br>
><br>
> end<br>
><br>
> and the call remains up!<br>
><br>
> However the lua script now never ends.<br>
><br>
> On 6 October 2010 10:42, David Ponzone <<a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a>> wrote:<br>
><br>
>> my question is going to sound stupid but:<br>
>> how long before the call is ended ?<br>
>> are you sure A can talk to B directly ?<br>
>><br>
>> David Ponzone Direction Technique<br>
>> email: <a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a><br>
>> tel: 01 74 03 18 97<br>
>> gsm: 06 66 98 76 34<br>
>><br>
>> Service Client IPeva<br>
>> tel: 0811 46 26 26<br>
>> <a href="http://www.ipeva.fr" target="_blank">www.ipeva.fr</a> - <a href="http://www.ipeva-studio.com" target="_blank">www.ipeva-studio.com</a><br>
>><br>
>> *Ce message et toutes les pièces jointes sont confidentiels et établis à<br>
>> l'intention exclusive de ses destinataires. Toute utilisation ou diffusion<br>
>> non autorisée est interdite. Tout message électronique est susceptible<br>
>> d'altération. **IPeva** décline toute responsabilité au titre de ce<br>
>> message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas<br>
>> destinataire de ce message, merci de le détruire immédiatement et<br>
>> d'avertir<br>
>> l'expéditeur.*<br>
>> *<br>
>> *<br>
>><br>
>><br>
>><br>
>> Le 06/10/2010 à 11:33, Pete Kelly a écrit :<br>
>><br>
>> I've checked and it's PCMU for all legs, including Freeswitch... anyway<br>
>> it's Freeswitch which is ending the calls. I would expect leg A or leg B<br>
>> to<br>
>> end the call if it was a codec issue.<br>
>><br>
>> On 6 October 2010 10:26, David Ponzone <<a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a>> wrote:<br>
>><br>
>>> Pete,<br>
>>><br>
>>> perhaps leg A and B can't agree on the codec ?<br>
>>><br>
>>> David Ponzone Direction Technique<br>
>>> email: <a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a><br>
>>> tel: 01 74 03 18 97<br>
>>> gsm: 06 66 98 76 34<br>
>>><br>
>>> Service Client IPeva<br>
>>> tel: 0811 46 26 26<br>
>>> <a href="http://www.ipeva.fr" target="_blank">www.ipeva.fr</a> - <a href="http://www.ipeva-studio.com" target="_blank">www.ipeva-studio.com</a><br>
>>><br>
>>> *Ce message et toutes les pièces jointes sont confidentiels et établis à<br>
>>> l'intention exclusive de ses destinataires. Toute utilisation ou<br>
>>> diffusion<br>
>>> non autorisée est interdite. Tout message électronique est susceptible<br>
>>> d'altération. **IPeva** décline toute responsabilité au titre de ce<br>
>>> message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas<br>
>>> destinataire de ce message, merci de le détruire immédiatement et<br>
>>> d'avertir<br>
>>> l'expéditeur.*<br>
>>> *<br>
>>> *<br>
>>><br>
>>><br>
>>><br>
>>> Le 06/10/2010 à 11:18, Pete Kelly a écrit :<br>
>>><br>
>>> Hi<br>
>>><br>
>>> I am having some problems bridging 2 calls and bypassing the media.<br>
>>><br>
>>> I am using a lua script executed from the command line to phone out to<br>
>>> the<br>
>>> first device (leg A), then on answer bridge a call to a second device<br>
>>> (leg<br>
>>> B).<br>
>>><br>
>>> If I set the bypass_media=true, then freeswitch immediately sends out<br>
>>> BYEs<br>
>>> after the reINVITEs have happened.<br>
>>><br>
>>> If I leave bypass_media unset, everything works fine except the media is<br>
>>> bridged.<br>
>>><br>
>>> The lua script I am using is a very simple one and looks like this:<br>
>>><br>
>>> obSession = freeswitch.Session("sofia/lpmedia/<a href="http://91979197@10.15.20.122:5060" target="_blank">91979197@10.15.20.122:5060</a><br>
>>> ")<br>
>>> obSession:setVariable('bypass_media', 'true');<br>
>>><br>
>>> if obSession:ready() then<br>
>>> -- Do something good here<br>
>>><br>
>>> obSession:execute("bridge", "sofia/lpmedia/<a href="http://2000@10.15.20.122:5060" target="_blank">2000@10.15.20.122:5060</a>")<br>
>>> end<br>
>>><br>
>>> I have tried variations on this including, putting [bypass_media=true]<br>
>>> on<br>
>>> leg A, and using the [bypass_media_after_bridge=true] on leg B<br>
>>><br>
>>> The logs say this:<br>
>>> ...<br>
>>> 2010-10-06 10:10:05.847278 [NOTICE] sofia.c:5085 Channel [sofia/lpmedia/<br>
>>> <a href="http://2000@10.15.20.122:5060" target="_blank">2000@10.15.20.122:5060</a>] has been answered<br>
>>> 2010-10-06 10:10:06.650155 [NOTICE] switch_cpp.cpp:976 Hangup<br>
>>> sofia/lpmedia/<a href="http://91979197@10.15.20.122:5060" target="_blank">91979197@10.15.20.122:5060</a> [CS_HIBERNATE] [NORMAL_CLEARING]<br>
>>> 2010-10-06 10:10:06.650155 [NOTICE] switch_ivr_bridge.c:936 Hangup<br>
>>> sofia/lpmedia/<a href="http://2000@10.15.20.122:5060" target="_blank">2000@10.15.20.122:5060</a> [CS_HIBERNATE] [NORMAL_CLEARING]<br>
>>> 2010-10-06 10:10:06.651420 [NOTICE] switch_core_session.c:1228 Session 27<br>
>>> (sofia/lpmedia/<a href="http://91979197@10.15.20.122:5060" target="_blank">91979197@10.15.20.122:5060</a>) Ended<br>
>>> 2010-10-06 10:10:06.651420 [NOTICE] switch_core_session.c:1230 Close<br>
>>> Channel sofia/lpmedia/<a href="http://91979197@10.15.20.122:5060" target="_blank">91979197@10.15.20.122:5060</a> [CS_DESTROY]<br>
>>> freeswitch@pete-desktop> 2010-10-06 10:10:06.651420 [NOTICE]<br>
>>> switch_core_session.c:1228 Session 28 (sofia/lpmedia/<br>
>>> <a href="http://2000@10.15.20.122:5060" target="_blank">2000@10.15.20.122:5060</a>) Ended<br>
>>> 2010-10-06 10:10:06.651420 [NOTICE] switch_core_session.c:1230 Close<br>
>>> Channel sofia/lpmedia/<a href="http://2000@10.15.20.122:5060" target="_blank">2000@10.15.20.122:5060</a> [CS_DESTROY]<br>
>>><br>
>>><br>
>>> Does anyone have any ideas as to why freeswitch may be ending the calls?<br>
>>><br>
>>> I am using the latest git checkout - the behaviour was slightly different<br>
>>> with the 1.06 package. The call would setup but the reINVITEs did not<br>
>>> happen<br>
>>> as they should.<br>
>>><br>
>>> Pete<br>
>>><br>
>>> _______________________________________________<br>
>>> FreeSWITCH-users mailing list<br>
>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> FreeSWITCH-users mailing list<br>
>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>><br>
>>><br>
>> _______________________________________________<br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
>><br>
><br>
<br>
--<br>
Sent from my mobile device<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>wasim h. baig | principal consultant | convergence pk | +92 30 0850 8070 | peace be upon you ...<br>
</div></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div></div></div><br>
</blockquote></div><br></div>