Fixed a couple of typos and changed the way the DSN is inserted.

This commit is contained in:
Digital Daz 2015-02-25 20:35:22 +00:00
parent 4d3e4cb815
commit 2cef65a708
1 changed files with 252 additions and 251 deletions

View File

@ -68,7 +68,7 @@
table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]);
table.insert(xml, [[ <settings>]]);
if (string.len(dsn) > 0) then
table.insert(xml, [[ <param name="odbc-dsn" value="$${dsn}"/>]]);
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, [[ </settings>]]);
@ -163,7 +163,7 @@
--not found
if (string.find(agent_contact, 'sofia/gateway') == nil) then
--add the call_timeout
agent_contact = "{call_timeout="..agent_call_timeout."}"..agent_contact;
agent_contact = "{call_timeout="..agent_call_timeout.."}"..agent_contact;
else
--add the call_timeout and confirm
tmp_pos = string.find(agent_contact, "}");
@ -191,9 +191,9 @@
pos = string.find(agent_contact, "}");
first = string.sub(agent_contact, 0, pos);
last = string.sub(agent_contact, pos);
if (stristr(agent_contact, 'call_timeout') === FALSE) then
if (stristr(agent_contact, 'call_timeout') == FALSE) then
--add the call_timeout and confirm
agent_contact = first.','..confirm.',call_timeout='..agent_call_timeout..last;
agent_contact = first..','..confirm..',call_timeout='..agent_call_timeout..last;
else
--add confirm
agent_contact = tmp_first..','..confirm..tmp_last;
@ -249,9 +249,9 @@
--close the database connection
dbh:release();
freeswitch.consoleLog("notice", "thing is:"..api:execute("eval ${dsn}"));
--set the cache
result = trim(api:execute("memcache", "set configuration:callcenter.conf:" .. hostname .." '"..XML_STRING:gsub("'", "&#39;").."' "..expire["callcenter.conf"]));
result = trim(api:execute("memcache", "set configuration:callcenter.conf:" .. hostname .." '"..XML_STRING:gsub("'", "&#39;").."' ".."expire['callcenter.conf']"));
--send the xml to the console
if (debug["xml_string"]) then
@ -267,9 +267,10 @@
else
--replace the &#39 back to a single quote
XML_STRING = XML_STRING:gsub("&#39;", "'");
freeswitch.consoleLog("notice", "XML STRING "..XML_STRING.."\n");
--send to the console
if (debug["cache"]) then
freeswitch.consoleLog("notice", "[xml_handler] configuration:callcenter.conf source: memcache\n");
end
end --if XML_STRING