diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-06-29 14:40:14 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-06-29 14:40:14 +0000 |
commit | e47c4e42241aa14906b9d5106515abced41e97e3 (patch) | |
tree | 7143c152c552a915a429e626557285a41b224289 /kamailio-model.lua | |
parent | 9a12670325767c6b7ddcb2950a3538f2f8cce519 (diff) | |
download | acf-kamailio-e47c4e42241aa14906b9d5106515abced41e97e3.tar.bz2 acf-kamailio-e47c4e42241aa14906b9d5106515abced41e97e3.tar.xz |
Pass function to dbmodelfunctions rather than calling first
Fixes exception when fail to create db object
Diffstat (limited to 'kamailio-model.lua')
-rw-r--r-- | kamailio-model.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kamailio-model.lua b/kamailio-model.lua index 587f7ad..1d54f82 100644 --- a/kamailio-model.lua +++ b/kamailio-model.lua @@ -55,6 +55,7 @@ local databasecreate = function() -- connect to data source dbkam = db.create(engine, config.DBNAME or "openser", config.DBRWUSER or "openser", config.DBRWPW or "openserrw", config.DBHOST, config.DBPORT) end + return dbkam end local databaseconnect = function() @@ -332,8 +333,7 @@ end for n,f in pairs(dbmodelfunctions) do mymodule[n] = function(...) - databasecreate() - return f(dbkam, ...) + return f(databasecreate, ...) end end |