mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-21 10:26:30 +00:00
Merge branch 'master' of https://github.com/fusionpbx/fusionpbx
This commit is contained in:
@@ -46,8 +46,13 @@
|
||||
assert(dbh:connected());
|
||||
|
||||
--get the variables
|
||||
dsn = trim(api:execute("global_getvar", "dsn"));
|
||||
dsn_callcenter = trim(api:execute("global_getvar", "dsn_callcenter"));
|
||||
dsn = trim(api:execute("global_getvar", "dsn")) or '';
|
||||
dsn_callcenter = trim(api:execute("global_getvar", "dsn_callcenter")) or '';
|
||||
|
||||
if dsn:find("INVALID COMMAND", nil, true) then
|
||||
freeswitch.consoleLog('err', '[xml_handler] Can not correctly load mod_callcenter becase mod_commands not loaded\n')
|
||||
dsn, dsn_callcenter = '', ''
|
||||
end
|
||||
|
||||
--start the xml array
|
||||
local xml = {}
|
||||
@@ -56,14 +61,12 @@
|
||||
table.insert(xml, [[ <section name="configuration">]]);
|
||||
table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]);
|
||||
table.insert(xml, [[ <settings>]]);
|
||||
if (dsn_callcenter) then
|
||||
if #dsn_callcenter > 0 then
|
||||
table.insert(xml, [[ <param name="odbc-dsn" value="]]..dsn_callcenter..[["/>]]);
|
||||
else
|
||||
if (string.len(dsn) > 0) then
|
||||
table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]);
|
||||
end
|
||||
elseif #dsn > 0 then
|
||||
table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]);
|
||||
end
|
||||
--table.insert(xml, [[ <param name="dbname" value="/usr/local/freeswitch/db/call_center.db"/>]]);
|
||||
-- table.insert(xml, [[ <param name="dbname" value="]]..database_dir..[[/call_center.db"/>]]);
|
||||
table.insert(xml, [[ </settings>]]);
|
||||
|
||||
--write the queues
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -391,7 +391,7 @@ function save_module_xml() {
|
||||
$xml .= "<configuration name=\"modules.conf\" description=\"Modules\">\n";
|
||||
$xml .= " <modules>\n";
|
||||
|
||||
$sql = "select * from v_modules order by module_category = 'Languages' OR module_category = 'Loggers' DESC, module_category ";
|
||||
$sql = "select * from v_modules order by module_name='mod_commands' OR module_category = 'Languages' OR module_category = 'Loggers' DESC, module_category ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$prev_module_cat = '';
|
||||
|
||||
Reference in New Issue
Block a user