<div dir="ltr"><div>I highly recommend using FreeSWITCH'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"><<a href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@gmail.com</a>></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 "luasql.odbc"<br><br><br>env = assert (luasql.mysql())<br>con = assert (env:connect("gvt","root","hammer","localhost"))<br><br>session:answer();<br><br>-- sleep a second<br>session:sleep(1000);<br><br>Caller_number = session:getVariable("caller_id_number")<br>session:consoleLog("info", Caller_number)<br><br><br>session:streamFile("/opt/song.wav");<br><br><br>session:setVariable("nibble_rate", "0.03");<br><br>session:setVariable("nibble_account", "4712296279");<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 'luasql.odbc' not found:<br> no field package.preload['luasql.odbc']<br> no file '/usr/local/share/lua/5.2/luasql/odbc.lua'<br> no file '/usr/local/share/lua/5.2/luasql/odbc/init.lua'<br> no file '/usr/local/lib/lua/5.2/luasql/odbc.lua'<br> no file '/usr/local/lib/lua/5.2/luasql/odbc/init.lua'<br> no file './luasql/odbc.lua'<br> no file '/usr/local/lib/lua/5.2/luasql/odbc.so'<br> no file '/usr/local/lib/lua/5.2/loadall.so'<br> no file './luasql/odbc.so'<br> no file '/usr/local/lib/lua/5.2/luasql.so'<br> no file '/usr/local/lib/lua/5.2/loadall.so'<br> no file './luasql.so'<br>stack traceback:<br> [C]: in function 'require'<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>