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 <[email protected]> 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: [email protected]  |
> |    John Wehle    |     Fax: 1-215-540-5495  |                         |
> -------------------------------------------------------------------------
>
>
> _______________________________________________
> Freeswitch-users mailing list
> [email protected]
> 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:[email protected] <msn%[email protected]>
GTALK/JABBER/PAYPAL:[email protected]<paypal%[email protected]>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:[email protected] <sip%[email protected]>
iax:[email protected]/888
googletalk:[email protected]<googletalk%3aconf%[email protected]>
pstn:213-799-1400
_______________________________________________
Freeswitch-users mailing list
[email protected]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Reply via email to