>> 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: j...@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

Reply via email to