[asterisk-bugs] [Asterisk 0018960]: error loading module 'luasql.postgres'
Asterisk Bug Tracker
noreply at bugs.digium.com
Fri Mar 11 21:29:08 CST 2011
A NOTE has been added to this issue.
======================================================================
https://issues.asterisk.org/view.php?id=18960
======================================================================
Reported By: vfabi
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 18960
Category: PBX/pbx_lua
Reproducibility: always
Severity: minor
Priority: normal
Status: new
Asterisk Version: 1.6.2.17
JIRA:
Regression: No
Reviewboard Link:
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2011-03-11 18:27 CST
Last Modified: 2011-03-11 21:29 CST
======================================================================
Summary: error loading module 'luasql.postgres'
Description:
Get this error trying to execute extensions.lua:
ERROR[12282]: pbx_lua.c:1090 lua_get_state: Error loading extensions.lua:
error loading module 'luasql.postgres' from file
'/usr/local/lib/lua/5.1/luasql/postgres.so':
dynamic libraries not enabled; check your Lua installation
or
call*CLI> reload
call*CLI> [Mar 12 03:29:07] ERROR[22058]: pbx_lua.c:1434
load_or_reload_lua_stuff: Error loading extensions.lua: error loading
module 'luasql.postgres' from file
'/usr/local/lib/lua/5.1/luasql/postgres.so':
dynamic libraries not enabled; check your Lua installation
If extensions.lua run from console it's ok, but from asterisk get this
error.
extensions.lua:
--
--
--
require "luasql.postgres"
DBNAME = "dbtest"
DBUSER = "tsetuser"
DBPASSWORD = "testpass"
DBHOST = "100.100.100.34"
function get_numbers(did, ip)
env = assert (luasql.postgres())
con = assert (env:connect('dbname='..DBNAME..' user='..DBUSER..'
password='..DBPASSWORD..' host='..DBHOST))
cur = assert (con:execute("SELECT cr.numbers FROM dids d INNER
JOIN trunks t ON t.id = d.id_trunks INNER JOIN companies c ON c.id =
d.id_companies INNER JOIN companies_redirects cr ON cr.id =
d.id_companies_redirects WHERE d.did = '"..did.."' AND c.status = 'active'
AND cr.status = 'active' AND t.status = 'active' AND t.ip_address =
'"..ip.."' "))
row = assert (cur:fetch())
cur:close()
con:close()
env:close()
return row
end
function do_some_fun()
local ext = get_numbers("1234567890","100.100.100.33")
app.dial("SIP/" .. ext)
end
extensions = {
dbtest = {
["_X."] = function()
app.background("you-entered")
do_some_fun()
end;
};
default = {
include = {"dbtest"};
};
}
======================================================================
----------------------------------------------------------------------
(0132874) vfabi (reporter) - 2011-03-11 21:29
https://issues.asterisk.org/view.php?id=18960#c132874
----------------------------------------------------------------------
Lua and libs installed from rpms:
lua-5.1.4-4.el5
lua-filesystem-1.4.2-1.el5
lua-devel-5.1.4-4.el5
lua-posix-5.1.7-1.el5
lua-sql-postgresql-2.1.1-7.el5
Issue History
Date Modified Username Field Change
======================================================================
2011-03-11 21:29 vfabi Note Added: 0132874
======================================================================
More information about the asterisk-bugs
mailing list