<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">got it working thanks, but now I need to have my script read the info from a mysql db. When I run the script manually my script works, but when I run it from FS I get the error message below:<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);">[ERR] mod_lua.cpp:199 /usr/local/freeswitch/scripts/callerID.lua:6: module 'luasql.mysql' not found:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no field package.preload['luasql.mysql']</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file './luasql/mysql.lua'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/share/lua/5.1/luasql/mysql.lua'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/share/lua/5.1/luasql/mysql/init.lua'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/luasql/mysql.lua'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/luasql/mysql/init.lua'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file './luasql/mysql.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file './libluasql/mysql51.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/luasql/mysql.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/libluasql/mysql51.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/loadall.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file './luasql.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file './libluasql51.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/luasql.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/libluasql51.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>no file '/usr/local/lib/lua/5.1/loadall.so'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);">stack traceback:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>[C]: in function 'require'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/local/freeswitch/scripts/callerID.lua:6: in main chunk</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(188, 50, 28); background-color: rgb(254, 244, 156);"><br></div><div><div>On Dec 10, 2013, at 12:44 PM, Saugort Dario Garcia Tovar <<a href="mailto:dgarcia@anew.com.ve">dgarcia@anew.com.ve</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Joli<br>
<br>
The answer are already in your hands... in: <br>
<a class="moz-txt-link-freetext" href="https://wiki.freeswitch.org/wiki/Mod_lua">https://wiki.freeswitch.org/wiki/Mod_lua</a> <br>
<a class="moz-txt-link-freetext" href="http://phrogz.net/lua/LearningLua_FromJS.html">http://phrogz.net/lua/LearningLua_FromJS.html</a><br>
<a class="moz-txt-link-freetext" href="http://www.lua.org/">http://www.lua.org/</a><br>
<br>
With "freeswitch.consoleLog" you get info in the console. You
should change your code to:<br>
<br>
freeswitch.consoleLog("info", "Got
-------------------------------> caller_id_number<span style="color: #bc321c"></span>: " .. callerID .. "\n");<br>
<br>
Also, try:<br>
<br>
<span style="color: #a6a519">if</span> (callerID == "<font color="#bc321c">1234567890</font>")<br>
<br>
<br>
<br>
On 12/10/2013 11:44 AM, Joli Martinez wrote:<br>
</div>
<blockquote cite="mid:461E1D38-CB91-4849-8A15-EA97DFD09DFD@gmail.com" type="cite">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">"caller_id_number"</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">"Hello World"</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("conference","</span>4567<font color="#4d2cdc">");</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=""> </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">"conference"</span>,<span style="color: #bc321c">"</span>4567<span style="color:
#bc321c">"</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=""> </span>--
session:execute("transfer","</span>7890<font color="#4d2cdc">");</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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com/">http://www.freeswitchsolutions.com</a>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com/">http://www.cudatel.com</a>
Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org/">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com/">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org/">http://www.freeswitch.org</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
Atentamente,
<br>
<b>Dario García</b>
<br>
Consultor.
<br>
<br>
CCCT, Nivel C2, Sector Yarey, Mz, <br>
Ofc. MZ03a. <br>
Caracas-Venezuela.
<br>
Teléfono: +58 212 9081842
<br>
Cel: +58 412 2221515
<br>
<a class="moz-txt-link-abbreviated" href="mailto:dgarcia@anew.com.ve">dgarcia@anew.com.ve</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.anew.com.ve/">http://www.anew.com.ve</a></div>
</div>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>http://www.freeswitchsolutions.com<br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>http://www.cudatel.com<br><br>Official FreeSWITCH Sites<br>http://www.freeswitch.org<br>http://wiki.freeswitch.org<br>http://www.cluecon.com<br><br>FreeSWITCH-users mailing list<br>FreeSWITCH-users@lists.freeswitch.org<br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></body></html>