I think this is an oversight update to trunk and session.ready() should work as expected. On Thu, Jun 25, 2009 at 2:35 PM, John Wehle <john@feith.com> wrote:
What's the recommended way to check if the session constructor was successful (i.e. the number could be dialed)?
check that s is nil.
Doesn't work ... s is never nil. Type shows it as userdata even if Session failed. Specifically my test was:
local s = freeswitch.Session ( "{ignore_early_media=true,origination_caller_id_name=" .. caller .. "}loopback/" .. destination .. "/default/XML")
stream:write (type(s))
if s == nil then stream:write ("-ERR call failed\n") return end
and I dialed an unreachable number.
and that s.ready() is true
Checking s.ready() results in:
[ERR] freeswitch_lua.cpp:102 session is not initalized
if Session failed.
What I'm looking for is a way to try to originate a call which doesn't throw ERR messages if the attempt fails.
Explicitly calling session.originate seems to allow you to check if the call was successful ... is there a particular reason it's discouraged?
I'm happy to avoid it if a better approach is available, however I'm having trouble finding one.
-- John ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | -------------------------------------------------------------------------
_______________________________________________ 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