[Freeswitch-users] Did the call connect?

Anthony Minessale anthony.minessale at gmail.com
Tue Aug 19 07:43:08 PDT 2008


The originate method technique really causes more issues than it solves =D

If you don't have some specific need for doing it that way try this:

newSession new Session("{ignore_early_media=true}sofia/default/foo at bar.com
");

if (newSession.ready()) {
   .... yay
}


On Tue, Aug 19, 2008 at 8:40 AM, Jonas Gauffin <jonas.gauffin at gmail.com>wrote:

> I had the same problem a while ago. I don't know if it's fixed, but I
> do this (and it works)
>
>                                session.setVariable("ringback",
> "%(1000,4000,425)");
>                                bleg = new Session();
>                                bleg.setCallerData("caller_id_name",
> session.caller_id_name);
>                                bleg.setCallerData("caller_id_num",
> session.caller_id_num);
>                                log.debug("Calling sofia/" + options[2] +
> "/" + options[3] + " for
> " + options[1] + " seconds");
>                                timeOut = parseInt(options[1]);
>                                destination =
> "{ignore_early_media=true,originate_timeout=10}sofia/mydomain.com/" +
> options[3] + "%" + options[2];
>                                log.debug("DESTINATION: " + destination + "
> waiting 15 secs");
>                                res = bleg.originate(session, destination);
>
>                                if (res) {
>                                        res2 = bleg.waitForAnswer(20000);
>                                        res2 = session.waitForAnswer(20000);
>                                }
>                                else
>                                        res2 = false;
>
>                                log.debug("**** Originate result: " + res +
> ", " + res2 + " ************");
>                                if (res)
>                                {
>                                        log.debug("Transferred");
>                                        socket.send("transfer\tok\n");
>                                        bridge(session, bleg);
>                                        exit();
>                                }
>                                else
>                                        socket.send("transfer\tfailed\n");
>
> On Tue, Aug 19, 2008 at 3:36 PM, James Green <james.green at stealthnet.net>
> wrote:
> > Taking the following code:
> >
> > new_session.originate(session, dialout);
> > new_session.waitForAnswer(20000);
> >
> > At this point either the call connected or we timed out.
> >
> > I expected to be able to use new_session.ready() to determine if the
> > call successfully answered but this also returns true if the call timed
> > out. The circumstances in which it will return false are not documented
> > on the wiki.
> >
> > session.ready() is apparently not a function.
> >
> > So how does one check that the originate() ended up with a connected
> call?
> >
> > Thanks again,
> >
> > James
> >
> > _______________________________________________
> > Freeswitch-users mailing list
> > Freeswitch-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
> >
> >
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080819/2c8a0a72/attachment-0002.html 


More information about the FreeSWITCH-users mailing list