I think this is an oversight<br>update to trunk and session.ready() should work as expected.<br><br><br><div class="gmail_quote">On Thu, Jun 25, 2009 at 2:35 PM, John Wehle <span dir="ltr">&lt;<a href="mailto:john@feith.com">john@feith.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;&gt; What&#39;s the recommended way to check if the session constructor was<br>
&gt;&gt; successful (i.e. the number could be dialed)?<br>
<br>
&gt; check that s is nil.<br>
<br>
Doesn&#39;t work ... s is never nil.  Type shows it as userdata<br>
even if Session failed.  Specifically my test was:<br>
<br>
  local s = freeswitch.Session (<br>
              &quot;{ignore_early_media=true,origination_caller_id_name=&quot; ..<br>
               caller .. &quot;}loopback/&quot; .. destination .. &quot;/default/XML&quot;)<br>
<br>
  stream:write (type(s))<br>
<br>
  if s == nil then<br>
    stream:write (&quot;-ERR call failed\n&quot;)<br>
    return<br>
  end<br>
<br>
and I dialed an unreachable number.<br>
<br>
&gt; and that s.ready() is true<br>
<br>
Checking s.ready() results in:<br>
<br>
  [ERR] freeswitch_lua.cpp:102 session is not initalized<br>
<br>
if Session failed.<br>
<br>
What I&#39;m looking for is a way to try to originate a call which doesn&#39;t<br>
throw ERR messages if the attempt fails.<br>
<br>
Explicitly calling session.originate seems to allow you to check if<br>
the call was successful ... is there a particular reason it&#39;s discouraged?<br>
<br>
I&#39;m happy to avoid it if a better approach is available, however I&#39;m<br>
having trouble finding one.<br>
<br>
-- John<br>
-------------------------------------------------------------------------<br>
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: <a href="mailto:john@feith.com">john@feith.com</a>  |<br>
|    John Wehle    |     Fax: 1-215-540-5495  |                         |<br>
-------------------------------------------------------------------------<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>