mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Fix. Use api show channels like did not work on fusion with BDR.
This commit is contained in:
@@ -38,7 +38,7 @@ local log = require "resources.functions.log".ring_group
|
||||
require "resources.functions.explode";
|
||||
require "resources.functions.base64";
|
||||
require "resources.functions.file_exists";
|
||||
require "resources.functions.explode";
|
||||
require "resources.functions.channel_utils"
|
||||
|
||||
--get the variables
|
||||
domain_name = session:getVariable("domain_name");
|
||||
@@ -439,34 +439,10 @@ local log = require "resources.functions.log".ring_group
|
||||
extension_uuid = trim(api:executeString(cmd));
|
||||
--send to user
|
||||
local dial_string_to_user = "[sip_invite_domain="..domain_name..","..group_confirm.."leg_timeout="..destination_timeout..","..delay_name.."="..destination_delay..",dialed_extension=" .. row.destination_number .. ",extension_uuid="..extension_uuid .. row.record_session .. "]user/" .. row.destination_number .. "@" .. domain_name;
|
||||
if (ring_group_skip_active ~= nil) then
|
||||
if (ring_group_skip_active == "true") then
|
||||
cmd = "show channels like "..destination_number;
|
||||
reply = trim(api:executeString(cmd));
|
||||
--freeswitch.consoleLog("notice", "[ring group] reply "..cmd.." " .. reply .. "\n");
|
||||
exploded_reply = {};
|
||||
exploded_reply = explode(",",reply);
|
||||
|
||||
if (reply == "0 total.") then
|
||||
dial_string = dial_string_to_user
|
||||
else
|
||||
idle_extension=true;
|
||||
|
||||
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;
|
||||
end
|
||||
end
|
||||
else
|
||||
--look inside the reply to check for the correct domain_name
|
||||
dial_string = dial_string_to_user;
|
||||
if (ring_group_skip_active == "true") then
|
||||
local channels = channels_by_number(destination_number, domain_name)
|
||||
if (not channels) or #channels == 0 then
|
||||
dial_string = dial_string_to_user
|
||||
end
|
||||
else
|
||||
dial_string = dial_string_to_user;
|
||||
|
||||
Reference in New Issue
Block a user