<div dir="ltr"><div>getVariable(&quot;caller_id_number&quot;) will return you a string, not an integer and in Lua type matters.</div><div><br></div><div>So you will be more happy if you use the following:</div><div>    if (callerID == &quot;1234567890&quot;)  then<br>

</div><div><br></div><div>On consoleLog, you are missing the loglevel, see the documentation:</div><div><a href="http://wiki.freeswitch.org/wiki/Mod_lua#freeswitch.consoleLog">http://wiki.freeswitch.org/wiki/Mod_lua#freeswitch.consoleLog</a><br>

</div><div><br></div><div><br></div><div>Hope this helps!</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 10, 2013 at 5:14 PM, Joli Martinez <span dir="ltr">&lt;<a href="mailto:mrjoli021@gmail.com" target="_blank">mrjoli021@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello,<div><br></div><div>I am writing a Lua script that will get the callerId info.  I need 1 to be able to get the callerID and also to print any messages to the FS_CLI for debugging purpose.   By itself the session:execute does transfer to the correct conference, but it does not work with the callerID.  And the consoleLog doesnt work it give me an error on the screen. </div>

<div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(77,44,220);background-color:rgb(254,244,156)">#!/usr/bin/lua</div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px">

<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">session:answer();</div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px">

<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">callerID = session:getVariable(<span style="color:#bc321c">&quot;caller_id_number&quot;</span>);</div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px">

<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px"><br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">freeswitch.consoleLog(<span style="color:#bc321c">&quot;Hello World&quot;</span>);</div>

<div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)"><span style="color:rgb(77,44,220)">--session:execute(&quot;conference&quot;,&quot;</span>4567<font color="#4d2cdc">&quot;);</font></div>

<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(77,44,220);background-color:rgb(254,244,156)">--while (session:ready() == true) do </div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(77,44,220);background-color:rgb(254,244,156)">

<span style="color:#000000">  </span>--session:setAutoHangup(false);</div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px"><br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">

<span style="color:#a6a519">if</span> (callerID == <font color="#bc321c">1234567890</font>)  <span style="color:#a6a519">then</span></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">

    session:execute(<span style="color:#bc321c">&quot;conference&quot;</span>,<span style="color:#bc321c">&quot;</span>4567<span style="color:#bc321c">&quot;</span>);</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(77,44,220);background-color:rgb(254,244,156)">

--else</div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)"><span style="color:rgb(77,44,220)"><span style="color:#000000">  </span>--  session:execute(&quot;transfer&quot;,&quot;</span>7890<font color="#4d2cdc">&quot;);</font></div>

<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(166,165,25);background-color:rgb(254,244,156)">end</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(77,44,220);background-color:rgb(254,244,156)">

-- end</div></div><div><br></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Kind regards,<br>/Areski<br><br>----<br>Arezqui Belaid, &lt;<a href="mailto:areski@gmail.com" target="_blank">areski@gmail.com</a>&gt;<br>Founder at Star2Billing (<a href="http://www.star2billing.com" target="_blank">www.star2billing.com</a>)<br>

<br>Tel: +34650784355<br>Twitter: <a href="http://twitter.com/areskib" target="_blank">http://twitter.com/areskib</a> <br>LinkedIn: <a href="http://www.linkedin.com/in/areski" target="_blank">http://www.linkedin.com/in/areski</a>
</div>