Michale,
thanks again. That's what I wanted to hear from you!
Sergey,
in my FS server, it works like explained on wiki:
session:ready
- checks whether the session is still active (true anytime between call starts and hangup)
So is "true" even when legA is ringing. As you can see in Michael script, you need to put it on a "while do" cycle.
Thanks for your test, anyway.
-----Messaggio originale-----
Da: Sergey Scheglov <sid@eltc.ru>
Inviato il: 14 Set 2011 - 09:12
A: freeswitch-users@lists.freeswitch.org
? 13 Sep 2011 12:21:38 -0000
chrisbware@interfree.it wrote:
> Hi,
>
> thank you for your help, but doesn't work.
> legA:ready() is true when the first session start and not when the
> call is answered. So legB is called at the same time.
>
> Any other suggestion?
>
>
>
>
> -----Messaggio originale-----
> Da: Sergey Scheglov
> Inviato il: 13 Set 2011 - 17:15
> A: freeswitch-users@lists.freeswitch.org
>
>
> ? 13 Sep 2011 09:39:33 -0000
> chrisbware@interfree.it wrote:
>
> >
> > Hi guys,
> >
> > I've read anything on this argument on Wiki but I can't find a
> > complete answer.
> >
> > I need to bridge two calls in Lua, waiting the first to be answered.
> > My basic script is:
> >
> > local GwParams =
> > "origination_caller_id_number="..gateway..",sip_auth_username="..gateway..",sip_auth_password="..sip_passwd
> > local slegA =
> > "[ignore_early_media=false,"..GwParams.."]sofia/external/"..callee.."@"..sip_domain
> > local slegB =
> > "[ignore_early_media=true,"..GwParams.."]sofia/external/"..called.."@"..sip_domain
> >
> > legA = freeswitch.Session(slegA);
> > legB = freeswitch.Session(slegB);
> > freeswitch.bridge(legA, legB);
> >
> >
> > It works but legA and legB are called at the same time. Using:
> >
> > while (legA:answered()== false) do end;
> >
> > between the two session do the job but called parties can't hear
> > audio.
> >
> > I promise to add a script on wiki if you help me ! :)
> >
> > Thanks in advance.
> >
> >
> > -------------------------------------------------------------------------------
> > Valore legale alle tue mail
> > InterfreePEC - la tua Posta Elettronica Certificata
> > http://pec.interfree.it
> > -------------------------------------------------------------------------------
> >
> >
> >
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users@lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
> >
>
> Try:
>
> legA = freeswitch.Session(slegA);
> if (legA:ready()) then
> legB = freeswitch.Session(slegB, legA);
> freeswitch.bridge(legA, legB);
> end
>
> ----
>
> Scheglov Sergey
>
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
> -------------------------------------------------------------------------------
> Valore legale alle tue mail
> InterfreePEC - la tua Posta Elettronica Certificata
> http://pec.interfree.it
> -------------------------------------------------------------------------------
Just checked this script from cli:
luarun test.lua
--
local slegA="user/1000"
local slegB="user/1001"
legA = freeswitch.Session(slegA);
if (legA:ready()) then
legB = freeswitch.Session(slegB, legA);
freeswitch.bridge(legA, legB);
end
Leg B is created after the leg A answered.
Also, look this example
http://wiki.freeswitch.org/wiki/Bridging_two_calls_with_retry
--
Scheglov Sergey
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------------------------------------------------------------------------
Valore legale alle tue mail
InterfreePEC - la tua Posta Elettronica Certificata
http://pec.interfree.it
-------------------------------------------------------------------------------