Update intercept.lua
Account for core.db in intercept.lua
This commit is contained in:
parent
295e63c704
commit
38c43217ce
|
|
@ -247,6 +247,13 @@
|
||||||
|
|
||||||
--connect to FS database
|
--connect to FS database
|
||||||
--local dbh = Database.new('switch')
|
--local dbh = Database.new('switch')
|
||||||
|
if (file_exists(database_dir.."/core.db")) then
|
||||||
|
--dbh = freeswitch.Dbh("core:core"); -- when using sqlite
|
||||||
|
dbh = freeswitch.Dbh("sqlite://"..database_dir.."/core.db");
|
||||||
|
else
|
||||||
|
dofile(scripts_dir.."/resources/functions/database_handle.lua");
|
||||||
|
dbh = database_handle('switch');
|
||||||
|
end
|
||||||
|
|
||||||
--check the database to get the uuid of a ringing call
|
--check the database to get the uuid of a ringing call
|
||||||
call_hostname = "";
|
call_hostname = "";
|
||||||
|
|
@ -280,9 +287,6 @@
|
||||||
log.notice("sql "..sql);
|
log.notice("sql "..sql);
|
||||||
end
|
end
|
||||||
local is_child
|
local is_child
|
||||||
|
|
||||||
require "resources.functions.database_handle";
|
|
||||||
local dbh = database_handle('switch');
|
|
||||||
dbh:query(sql, function(row)
|
dbh:query(sql, function(row)
|
||||||
-- for key, val in pairs(row) do
|
-- for key, val in pairs(row) do
|
||||||
-- log.notice("row "..key.." "..val);
|
-- log.notice("row "..key.." "..val);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue