Fix ring group enterprise confirm

This commit is contained in:
Mark Crane 2014-08-30 18:22:06 +00:00
parent 818d5a2012
commit abd8c89f99
1 changed files with 21 additions and 6 deletions

View File

@ -377,19 +377,26 @@
end
end
--use a delimiter between dialstrings
--add a delimiter between destinations
if (dial_string ~= nil) then
--freeswitch.consoleLog("notice", "[ring group] dial_string: " .. dial_string .. "\n");
if (x == 0) then
app_data = "{ignore_early_media=true}"..dial_string;
if (ring_group_strategy == "enterprise") then
app_data = dial_string;
else
app_data = "{ignore_early_media=true}"..dial_string;
end
else
if (app_data == nil) then
app_data = "{ignore_early_media=true}"..dial_string;
if (ring_group_strategy == "enterprise") then
app_data = dial_string;
else
app_data = "{ignore_early_media=true}"..dial_string;
end
else
app_data = app_data .. delimiter .. dial_string;
end
end
--freeswitch.consoleLog("notice", "[ring group] app_data: " .. app_data .. "\n");
end
--increment the value of x
@ -463,10 +470,18 @@
end
end
--execute the bridge
if (app_data ~= nil) then
if (ring_group_strategy == "enterprise") then
app_data = app_data:gsub("%[", "{");
app_data = app_data:gsub("%]", "}");
end
freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n");
session:execute("bridge", app_data);
end
--timeout destination
if (app_data ~= nil) then
--freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n");
session:execute("bridge", app_data);
if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
or session:getVariable("originate_disposition") == "NO_ANSWER"
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE"