Handle Do Not Disturb set on the extension for ring groups.

This commit is contained in:
Mark Crane
2015-05-16 23:38:07 +00:00
parent 830724f368
commit d6c4267243
@@ -1,4 +1,3 @@
-- ring_groups.lua
-- Part of FusionPBX -- Part of FusionPBX
-- Copyright (C) 2010-2015 Mark J Crane <markjcrane@fusionpbx.com> -- Copyright (C) 2010-2015 Mark J Crane <markjcrane@fusionpbx.com>
-- All rights reserved. -- All rights reserved.
@@ -154,13 +153,22 @@
cmd = "user_exists id ".. row.destination_number .." "..leg_domain_name; cmd = "user_exists id ".. row.destination_number .." "..leg_domain_name;
user_exists = api:executeString(cmd); user_exists = api:executeString(cmd);
if (user_exists == "true") then if (user_exists == "true") then
row['user_exists'] = "true"; --add user_exists true or false to the row array
row['user_exists'] = "true";
--handle do_not_disturb
cmd = "user_data ".. row.destination_number .."@" ..leg_domain_name.." var do_not_disturb";
if (api:executeString(cmd) ~= "true") then
--add the row to the destinations array
destinations[x] = row;
end
else else
external = "true"; --set the values
row['user_exists'] = "false"; external = "true";
row['user_exists'] = "false";
--add the row to the destinations array
destinations[x] = row;
end end
row['domain_name'] = leg_domain_name; row['domain_name'] = leg_domain_name;
destinations[x] = row;
x = x + 1; x = x + 1;
end)); end));
--freeswitch.consoleLog("NOTICE", "[ring_group] external "..external.."\n"); --freeswitch.consoleLog("NOTICE", "[ring_group] external "..external.."\n");