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@bar.com "); if (newSession.ready()) { .... yay } On Tue, Aug 19, 2008 at 8:40 AM, Jonas Gauffin <jonas.gauffin@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@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@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@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@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400