Update do_not_disturb.lua

Add do not disturb toggle.
This commit is contained in:
FusionPBX
2016-10-07 14:54:02 -06:00
committed by GitHub
parent b09e17e892
commit a14b7fa83a

View File

@@ -16,7 +16,7 @@
--
-- The Initial Developer of the Original Code is
-- Mark J Crane <markjcrane@fusionpbx.com>
-- Copyright (C) 2010-2014
-- Copyright (C) 2010-2016
-- the Initial Developer. All Rights Reserved.
--
-- Contributor(s):
@@ -85,10 +85,20 @@
number_alias = row.number_alias or '';
accountcode = row.accountcode;
follow_me_uuid = row.follow_me_uuid;
do_not_disturb = row.do_not_disturb;
--freeswitch.consoleLog("NOTICE", "[do_not_disturb] extension "..row.extension.."\n");
--freeswitch.consoleLog("NOTICE", "[do_not_disturb] accountcode "..row.accountcode.."\n");
end);
--toggle do not disturb
if (enabled == "toggle") then
if (do_not_disturb == "true") then
enabled = "false";
else
enabled = "true";
end
end
--set the dial string
if (enabled == "true") then
local user = (number_alias and #number_alias > 0) and number_alias or extension;
@@ -189,4 +199,4 @@
--end the call
session:hangup();
end
end