From 9ab10fd1d4864e4a20e5ab775e7cd5c563ebcbcb Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 21 Apr 2022 22:02:42 -0600 Subject: [PATCH] Used to prevent a race condition for feature key Sync --- .../resources/functions/feature_event_notify.lua | 5 +++++ 1 file changed, 5 insertions(+) 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 060ab54558..44b630451c 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,6 +94,7 @@ 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(300); event:fire() end end @@ -110,6 +111,7 @@ 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(300); event:fire() end end @@ -125,6 +127,7 @@ 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(300); event:fire() end end @@ -141,6 +144,7 @@ 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(300); event:fire() end end @@ -164,6 +168,7 @@ 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(300); event:fire() end end