Add dsn_callcenter and improve the indentation.

This commit is contained in:
markjcrane
2016-01-12 01:48:11 -07:00
parent 8ac40de88f
commit 2a04a88b69
@@ -44,6 +44,7 @@
--get the variables --get the variables
dsn = trim(api:execute("global_getvar", "dsn")); dsn = trim(api:execute("global_getvar", "dsn"));
dsn_callcenter = trim(api:execute("global_getvar", "dsn_callcenter"));
--start the xml array --start the xml array
local xml = {} local xml = {}
@@ -52,9 +53,13 @@
table.insert(xml, [[ <section name="configuration">]]); table.insert(xml, [[ <section name="configuration">]]);
table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]); table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]);
table.insert(xml, [[ <settings>]]); table.insert(xml, [[ <settings>]]);
if (dsn_callcenter) then
table.insert(xml, [[ <param name="odbc-dsn" value="]]..dsn_callcenter..[["/>]]);
else
if (string.len(dsn) > 0) then if (string.len(dsn) > 0) then
table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]); table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]);
end end
end
--table.insert(xml, [[ <param name="dbname" value="/usr/local/freeswitch/db/call_center.db"/>]]); --table.insert(xml, [[ <param name="dbname" value="/usr/local/freeswitch/db/call_center.db"/>]]);
table.insert(xml, [[ </settings>]]); table.insert(xml, [[ </settings>]]);