This should do a better job detection active calls per extension in the ring group with skip_active
This commit is contained in:
parent
ced5f29a87
commit
f234e765b1
|
|
@ -38,6 +38,7 @@ local log = require "resources.functions.log".ring_group
|
||||||
require "resources.functions.explode";
|
require "resources.functions.explode";
|
||||||
require "resources.functions.base64";
|
require "resources.functions.base64";
|
||||||
require "resources.functions.file_exists";
|
require "resources.functions.file_exists";
|
||||||
|
require "resources.functions.explode";
|
||||||
|
|
||||||
--get the variables
|
--get the variables
|
||||||
domain_name = session:getVariable("domain_name");
|
domain_name = session:getVariable("domain_name");
|
||||||
|
|
@ -443,12 +444,23 @@ local log = require "resources.functions.log".ring_group
|
||||||
cmd = "show channels like "..destination_number;
|
cmd = "show channels like "..destination_number;
|
||||||
reply = trim(api:executeString(cmd));
|
reply = trim(api:executeString(cmd));
|
||||||
--freeswitch.consoleLog("notice", "[ring group] reply "..cmd.." " .. reply .. "\n");
|
--freeswitch.consoleLog("notice", "[ring group] reply "..cmd.." " .. reply .. "\n");
|
||||||
|
exploded_reply = {};
|
||||||
|
exploded_reply = explode(",",reply);
|
||||||
|
|
||||||
if (reply == "0 total.") then
|
if (reply == "0 total.") then
|
||||||
dial_string = dial_string_to_user
|
dial_string = dial_string_to_user
|
||||||
else
|
else
|
||||||
if (string.find(reply, domain_name)) then
|
idle_extension=true;
|
||||||
--active call
|
|
||||||
else
|
if (exploded_reply ~= nil) then
|
||||||
|
for i,v in ipairs(exploded_reply) do
|
||||||
|
if(v==destination_number.."@"..domain_name) then
|
||||||
|
idle_extension=false;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if(idle_extension) then
|
||||||
dial_string = dial_string_to_user;
|
dial_string = dial_string_to_user;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue