<div dir="ltr"><div>I highly recommend using FreeSWITCH&#39;s built in dbh, you can see it in action here: <a href="https://confluence.freeswitch.org/display/FREESWITCH/Lua+freeswitch+dbh">https://confluence.freeswitch.org/display/FREESWITCH/Lua+freeswitch+dbh</a><br><br></div>you would be able to use ODBC still as you are, without the trouble of trying to include the library... i had some severe issues getting any sort of progress with luasql manually being included.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 11:36 AM, Aqs Younas <span dir="ltr">&lt;<a href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@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 dir="ltr"><div><div>Hi, All<br><br></div>I am unable to connect to mysql for querying some data that I could use in my lua script.<br></div><div>Here is my lua script.<br><br> #!/usr/bin/lua<br><br>require &quot;luasql.odbc&quot;<br><br><br>env = assert (luasql.mysql())<br>con = assert (env:connect(&quot;gvt&quot;,&quot;root&quot;,&quot;hammer&quot;,&quot;localhost&quot;))<br><br>session:answer();<br><br>-- sleep a second<br>session:sleep(1000);<br><br>Caller_number = session:getVariable(&quot;caller_id_number&quot;)<br>session:consoleLog(&quot;info&quot;, Caller_number)<br><br><br>session:streamFile(&quot;/opt/song.wav&quot;);<br><br><br>session:setVariable(&quot;nibble_rate&quot;, &quot;0.03&quot;);<br><br>session:setVariable(&quot;nibble_account&quot;, &quot;4712296279&quot;);<br>-- play a file<br><br>-- hangup<br>session:hangup();<br><br></div><div>When i run this i got this error.<br><br>2014-09-16 04:59:43.423380 [ERR] mod_lua.cpp:203 /usr/local/freeswitch/scripts/test.lua:3: module &#39;luasql.odbc&#39; not found:<br>        no field package.preload[&#39;luasql.odbc&#39;]<br>        no file &#39;/usr/local/share/lua/5.2/luasql/odbc.lua&#39;<br>        no file &#39;/usr/local/share/lua/5.2/luasql/odbc/init.lua&#39;<br>        no file &#39;/usr/local/lib/lua/5.2/luasql/odbc.lua&#39;<br>        no file &#39;/usr/local/lib/lua/5.2/luasql/odbc/init.lua&#39;<br>        no file &#39;./luasql/odbc.lua&#39;<br>        no file &#39;/usr/local/lib/lua/5.2/luasql/odbc.so&#39;<br>        no file &#39;/usr/local/lib/lua/5.2/loadall.so&#39;<br>        no file &#39;./luasql/odbc.so&#39;<br>        no file &#39;/usr/local/lib/lua/5.2/luasql.so&#39;<br>        no file &#39;/usr/local/lib/lua/5.2/loadall.so&#39;<br>        no file &#39;./luasql.so&#39;<br>stack traceback:<br>        [C]: in function &#39;require&#39;<br>        /usr/local/freeswitch/scripts/test.lua:3: in main chunk<br><br></div><div><br><br></div><div>My odbc.ini<br><br>[freeswitch]<br>Driver          = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so<br>SERVER          = localhost<br>PORT            = 3306<br>DATABASE        = gvt<br>OPTION          = 67108864<br>USER            = root<br>PASSWORD        = hammer<br></div><div><br><br>and odbcinst.ini<br><br>[MySQL]<br>Description     = MySQL driver<br>Driver          = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so<br>Setup           = /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so<br>UsageCount      = 1<br>FileUsage       = 1<br>Threading       = 0<br></div><div><br></div><div>Could someone please help me out how to connect freeswitch to mysql for querying data..:)<br></div>Thanks in Advance</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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.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>
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></div>