<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello. I successfully installed lua and use lua_pbx with my dialplan, but I need to use mysql.</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">I installed luasql.mysql and without extensions.lua it work fine (woth external scripts)</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">I tested it with my little script:</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">______________________________</span><span style="font-family:arial,sans-serif;font-size:13px">______________________________</span><span style="font-family:arial,sans-serif;font-size:13px">__</span><br style="font-family:arial,sans-serif;font-size:13px">
<div style="font-family:arial,sans-serif;font-size:13px">function mysqltest()</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">local driver = require "luasql.mysql"</div>
<div style="font-family:arial,sans-serif;font-size:13px">local env = assert(driver.mysql())</div><div style="font-family:arial,sans-serif;font-size:13px">local con = assert(env:connect("mydb", "root", "mypass", "localhost", 3306));</div>
<div style="font-family:arial,sans-serif;font-size:13px">local cur = assert(con:execute("SELECT version()"));</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
print("<mysql> MYSQL driver version is: "..driver._MYSQLVERSION);</div><div style="font-family:arial,sans-serif;font-size:13px">print("<mysql> "..driver._COPYRIGHT);</div><div style="font-family:arial,sans-serif;font-size:13px">
print("<mysql> "..driver._DESCRIPTION);</div><div style="font-family:arial,sans-serif;font-size:13px">print("<mysql> "..driver._VERSION);</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">cur:close()</div><div style="font-family:arial,sans-serif;font-size:13px">con:close()</div><div style="font-family:arial,sans-serif;font-size:13px">env:close()</div>
<div style="font-family:arial,sans-serif;font-size:13px">end;</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">mysqltest()</div><div style="font-family:arial,sans-serif;font-size:13px">
____________________________________________________________</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
when I called it as <br>>lua mysqltest.lua <br><br>I see response:<br><div><br></div><div><mysql> MYSQL driver version is: 5.5.37</div><div><mysql> Copyright (C) 2003-2012 Kepler Project</div><div><mysql> LuaSQL is a simple interface from Lua to a DBMS</div>
<div><mysql> LuaSQL 2.3.0</div><div><br></div><div><br></div><div>when I tried require driver from extensions.lua, I see this when reload module pbx_lua.so:<br><br><br><div>module reload pbx_lua.so</div><div><br></div>
<div>________________________________________________________________</div><div>No such module 'pbx_lua.so'</div><div> -- Reloading module 'pbx_lua.so' (Lua PBX Switch)</div><div>[Jul 24 11:41:27] ERROR[3512]: pbx_lua.c:1635 load_or_reload_lua_stuff: Error loading extensions.lua:</div>
<div>error loading module 'luasql.mysql' from file '/usr/local/lib/lua/5.1/luasql/mysql.so':</div><div> /usr/local/lib/lua/5.1/luasql/mysql.so: undefined symbol: lua_settop</div><div>stack traceback:</div>
<div> [C]: ?</div><div> [C]: in function 'require'</div><div> [string "extensions.lua"]:1: in main chunk</div><div>_________________________________________________________________</div>
<br></div>How I must install lua to my server gor wotrking with luasql.mysql at extensions.lua?</div></div>