[asterisk-users] extensions.lua with luasql.mysql.
Rodrigo Lang
rodrigoferreiralang at gmail.com
Thu Feb 24 14:31:26 CST 2011
Hi to all!
I'm trying to create a context for integration with extensions.lua and
libsql.mysql, but I'm not getting to run. When I reload the module
pbx_lua.so the following error appears:
[Feb 24 16:59:29] ERROR[30749]: pbx_lua.c:1249 exec: Error executing lua
extension: error loading module 'luasql.mysql' from file
'/usr/lib/lua/5.1/luasql/mysql.so':
/usr/lib/lua/5.1/luasql/mysql.so: undefined symbol: lua_getfield
stack traceback:
[C]: ?
[C]: in function 'require'
[string "extensions.lua"]:205: in function <[string
"extensions.lua"]:204>
I tested my script with a file.lua and works ok and the extensions.lua works
fine too. My extensions.lua:
extensions = {
luatest = {
["302"] = function()
require("luasql.mysql")
app.Answer()
app.Log("NOTICE", "Trying to connect in MySQL")
app.Wait("2")
env = assert(luasql.mysql())
sql = assert
(env:connect("asterisk_teste","root","*********","localhost",3306))
sel = sql:execute('SELECT * FROM cdr;')
sel:fetch(Fetcharray)
app.Noop(Fetcharray[1])
end;
h = function()
app.Hangup()
end;
};
}
Does anyone know what is happening?
Thansk in advance,
--
Rodrigo Lang
Opening your mind - Just another Open Source
site<http://openingyourmind.wordpress.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110224/f19699bb/attachment.htm>
More information about the asterisk-users
mailing list