From a14b7fa83a85f986cb63406287decd1907b79d73 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 7 Oct 2016 14:54:02 -0600 Subject: [PATCH] Update do_not_disturb.lua Add do not disturb toggle. --- resources/install/scripts/do_not_disturb.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/install/scripts/do_not_disturb.lua b/resources/install/scripts/do_not_disturb.lua index 9cf853de80..80528e8702 100644 --- a/resources/install/scripts/do_not_disturb.lua +++ b/resources/install/scripts/do_not_disturb.lua @@ -16,7 +16,7 @@ -- -- The Initial Developer of the Original Code is -- Mark J Crane --- 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 \ No newline at end of file + end