[asterisk-bugs] [Asterisk 0018960]: error loading module 'luasql.postgres'

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 31 12:29:35 CDT 2011


The following issue has been CLOSED 
====================================================================== 
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:                     closed
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:              
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2011-03-11 18:27 CST
Last Modified:              2011-03-31 12:29 CDT
====================================================================== 
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"};
    };
}

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-31 12:29 lmadsen        Status                   new => closed       
======================================================================




More information about the asterisk-bugs mailing list