From 38c43217ceba3ec4e3623cc79739ba9d3a6c9de9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 12 May 2016 23:06:45 -0600 Subject: [PATCH] Update intercept.lua Account for core.db in intercept.lua --- resources/install/scripts/intercept.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/install/scripts/intercept.lua b/resources/install/scripts/intercept.lua index 0322a731de..689dc79b9b 100644 --- a/resources/install/scripts/intercept.lua +++ b/resources/install/scripts/intercept.lua @@ -247,6 +247,13 @@ --connect to FS database --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 call_hostname = ""; @@ -280,9 +287,6 @@ log.notice("sql "..sql); end local is_child - - require "resources.functions.database_handle"; - local dbh = database_handle('switch'); dbh:query(sql, function(row) -- for key, val in pairs(row) do -- log.notice("row "..key.." "..val);