Merge pull request #5864 from demonspork/Fix-Yealink-feature-key-race-dnd

Dialplan Fix for Feature Key Sync Race
This commit is contained in:
FusionPBX
2021-04-06 22:17:31 -06:00
committed by GitHub
2 changed files with 4 additions and 5 deletions

View File

@@ -1,18 +1,22 @@
<context name="{v_context}">
<extension name="do-not-disturb" number="*77,*78,*79" continue="false" app_uuid="df32d982-e39e-4ae5-a46d-aed1893873f2" enabled="true" order="490">
<condition field="destination_number" expression="^\*77$" break="on-true">
<action application="limit" data="hash dnd ${sip_from_uri} 1 !USER_BUSY"/>
<action application="set" data="enabled=toggle"/>
<action application="lua" data="do_not_disturb.lua"/>
</condition>
<condition field="destination_number" expression="^\*78$|\*363$" break="on-true">
<action application="limit" data="hash dnd ${sip_from_uri} 1 !USER_BUSY"/>
<action application="set" data="enabled=true"/>
<action application="lua" data="do_not_disturb.lua"/>
</condition>
<condition field="destination_number" expression="^\*79$" break="on-true">
<action application="limit" data="hash dnd ${sip_from_uri} 1 !USER_BUSY"/>
<action application="set" data="enabled=false"/>
<action application="lua" data="do_not_disturb.lua"/>
</condition>
<condition field="destination_number" expression="^dnd\+${caller_id_number}$" break="on-true">
<action application="limit" data="hash dnd ${sip_from_uri} 1 !USER_BUSY"/>
<action application="set" data="enabled=toggle"/>
<action application="lua" data="do_not_disturb.lua"/>
</condition>

View File

@@ -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