Fix call center xml handler domain.

This commit is contained in:
Mark Crane 2015-06-18 20:08:54 +00:00
parent 7cec657e76
commit 6252e5bfb0
1 changed files with 8 additions and 2 deletions

View File

@ -149,13 +149,16 @@
--get the agents --get the agents
table.insert(xml, [[ <agents>]]); table.insert(xml, [[ <agents>]]);
sql = "select * from v_call_center_agents "; sql = "select * from v_call_center_agents as a, v_domains as d ";
sql = sql .. "where d.domain_uuid = a.domain_uuid; ";
if (debug["sql"]) then if (debug["sql"]) then
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n"); freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
end end
x = 0; x = 0;
dbh:query(sql, function(row) dbh:query(sql, function(row)
--get the values from the database and set as variables --get the values from the database and set as variables
domain_uuid = row.domain_uuid;
domain_name = row.domain_name;
agent_name = row.agent_name; agent_name = row.agent_name;
agent_type = row.agent_type; agent_type = row.agent_type;
agent_call_timeout = row.agent_call_timeout; agent_call_timeout = row.agent_call_timeout;
@ -239,13 +242,16 @@
table.insert(xml, [[ </agents>]]); table.insert(xml, [[ </agents>]]);
--get the tiers --get the tiers
sql = "select * from v_call_center_tiers "; sql = "select * from v_call_center_tiers as t, v_domains as d ";
sql = sql .. "where d.domain_uuid = t.domain_uuid; ";
if (debug["sql"]) then if (debug["sql"]) then
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n"); freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
end end
table.insert(xml, [[ <tiers>]]); table.insert(xml, [[ <tiers>]]);
dbh:query(sql, function(row) dbh:query(sql, function(row)
--get the values from the database and set as variables --get the values from the database and set as variables
domain_uuid = row.domain_uuid;
domain_name = row.domain_name;
agent_name = row.agent_name; agent_name = row.agent_name;
queue_name = row.queue_name; queue_name = row.queue_name;
tier_level = row.tier_level; tier_level = row.tier_level;