mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-02 10:03:49 +00:00
Update do_not_disturb.lua
Add do not disturb toggle.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user