Add dsn_callcenter and improve the indentation.

This commit is contained in:
markjcrane 2016-01-12 01:48:11 -07:00
parent 9396d788b0
commit 352a630f42
1 changed files with 121 additions and 116 deletions

View File

@ -44,6 +44,7 @@
--get the variables
dsn = trim(api:execute("global_getvar", "dsn"));
dsn_callcenter = trim(api:execute("global_getvar", "dsn_callcenter"));
--start the xml array
local xml = {}
@ -52,9 +53,13 @@
table.insert(xml, [[ <section name="configuration">]]);
table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]);
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
table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]);
end
end
--table.insert(xml, [[ <param name="dbname" value="/usr/local/freeswitch/db/call_center.db"/>]]);
table.insert(xml, [[ </settings>]]);