From d53bac7f55879fb6f18305fc4e53a5af844e5390 Mon Sep 17 00:00:00 2001 From: demonspork Date: Tue, 6 Apr 2021 15:35:40 -0500 Subject: [PATCH] Dialplan Fix for Feature Key Sync Race This is a dialplan approach to fix the feature key sync loop/race with yealink phones. This aproach may also need to be extended to the Call Forward dialplans as well. It limits the number of simultaneous calls for a particular user to change their DND/Forwarding status to a single call at a time. This prevents the infinite loops that the yealinks can get into if the user presses the DND button too quickly with feature key sync enabled. I am also reverting the lua fix because it was not reliable and can still easily allow the loop to occur. --- .../resources/switch/conf/dialplan/490_do-not-disturb.xml | 4 ++++ .../resources/functions/feature_event_notify.lua | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/dialplans/resources/switch/conf/dialplan/490_do-not-disturb.xml b/app/dialplans/resources/switch/conf/dialplan/490_do-not-disturb.xml index 9abee17d50..032952d038 100644 --- a/app/dialplans/resources/switch/conf/dialplan/490_do-not-disturb.xml +++ b/app/dialplans/resources/switch/conf/dialplan/490_do-not-disturb.xml @@ -1,18 +1,22 @@ + + + + diff --git a/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua b/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua index 3cc4c1b34c..060ab54558 100644 --- a/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua +++ b/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua @@ -94,7 +94,6 @@ function feature_event_notify.dnd(user, host, sip_profiles, do_not_disturb) event:addHeader("Feature-Event", "DoNotDisturbEvent") event:addHeader("doNotDisturbOn", do_not_disturb) --freeswitch.consoleLog("notice","[events] " .. event:serialize("xml") .. "\n"); - freeswitch.msleep(200); event:fire() end end @@ -111,7 +110,6 @@ function feature_event_notify.forward_immediate(user, host, sip_profiles, forwar event:addHeader("forward_immediate_enabled", forward_immediate_enabled) event:addHeader("forward_immediate", forward_immediate_destination); freeswitch.consoleLog("notice","[events] " .. event:serialize("xml") .. "\n"); - freeswitch.msleep(200); event:fire() end end @@ -127,7 +125,6 @@ function feature_event_notify.forward_busy(user, host, sip_profiles, forward_bus event:addHeader("Feature-Event", "ForwardingEvent") event:addHeader("forward_busy", forward_busy_destination) event:addHeader("forward_busy_enabled", forward_busy_enabled) - freeswitch.msleep(200); event:fire() end end @@ -144,7 +141,6 @@ function feature_event_notify.forward_no_answer(user, host, sip_profiles, forwar event:addHeader("forward_no_answer", forward_no_answer_destination) event:addHeader("forward_no_answer_enabled", forward_no_answer_enabled) event:addHeader("ringCount", ring_count) - freeswitch.msleep(200); event:fire() end end @@ -168,7 +164,6 @@ function feature_event_notify.init(user, host, sip_profiles, forward_immediate_e event:addHeader("ringCount", ring_count) event:addHeader("Feature-Event", "DoNotDisturbEvent") event:addHeader("doNotDisturbOn", do_not_disturb) - freeswitch.msleep(200); event:fire() end end