[asterisk-bugs] [JIRA] (ASTERISK-24148) Can not use mysql at extensions.lua
Yuriy Gorlichenko (JIRA)
noreply at issues.asterisk.org
Thu Jul 31 08:20:56 CDT 2014
Yuriy Gorlichenko created ASTERISK-24148:
--------------------------------------------
Summary: Can not use mysql at extensions.lua
Key: ASTERISK-24148
URL: https://issues.asterisk.org/jira/browse/ASTERISK-24148
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: PBX/pbx_lua
Reporter: Yuriy Gorlichenko
Hello. I successfully installed lua and use lua_pbx with my dialplan, but I need to use mysql.
I installed luasql.mysql and without extensions.lua it work fine (woth external scripts)
I tested it with my little script:
______________________________________________________________
function mysqltest()
local driver = require "luasql.mysql"
local env = assert(driver.mysql())
local con = assert(env:connect("mydb", "root", "mypass", "localhost", 3306));
local cur = assert(con:execute("SELECT version()"));
print("<mysql> MYSQL driver version is: "..driver._MYSQLVERSION);
print("<mysql> "..driver._COPYRIGHT);
print("<mysql> "..driver._DESCRIPTION);
print("<mysql> "..driver._VERSION);
cur:close()
con:close()
env:close()
end;
mysqltest()
____________________________________________________________
when I called it as
>lua mysqltest.lua
I see response:
<mysql> MYSQL driver version is: 5.5.37
<mysql> Copyright (C) 2003-2012 Kepler Project
<mysql> LuaSQL is a simple interface from Lua to a DBMS
<mysql> LuaSQL 2.3.0
when I tried require driver from extensions.lua, I see this when reload module pbx_lua.so:
module reload pbx_lua.so
________________________________________________________________
No such module 'pbx_lua.so'
-- Reloading module 'pbx_lua.so' (Lua PBX Switch)
[Jul 24 11:41:27] ERROR[3512]: pbx_lua.c:1635 load_or_reload_lua_stuff: Error loading extensions.lua:
error loading module 'luasql.mysql' from file '/usr/local/lib/lua/5.1/luasql/mysql.so':
/usr/local/lib/lua/5.1/luasql/mysql.so: undefined symbol: lua_settop
stack traceback:
[C]: ?
[C]: in function 'require'
[string "extensions.lua"]:1: in main chunk
_________________________________________________________________
I uses this issue for fixing problem, but it does not
https://issues.asterisk.org/jira/browse/ASTERISK-17279
How I must install lua to my server gor wotrking with luasql.mysql at extensions.lua?
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list