Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] pbx_lua module with luasql.mysql


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
ovoshlook at gmail.com
Guest





PostPosted: Fri Jul 25, 2014 5:10 am    Post subject: [asterisk-users] pbx_lua module with luasql.mysql Reply with quote

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 
Quote:
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
_________________________________________________________________


How I must install lua to my server gor wotrking with luasql.mysql at extensions.lua?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services