Dialplan - Feature code to control agent Break status.

This commit is contained in:
fusionate 2023-03-16 20:23:39 +00:00
parent 9a565cdb14
commit c41121a00f
No known key found for this signature in database
2 changed files with 147 additions and 119 deletions

View File

@ -0,0 +1,17 @@
<context name="{v_context}">
<extension name="agent-status-break" number="*24" continue="false" app_uuid="17a937f4-82f1-4a0f-b3a8-213db15127cf" order="215">
<condition field="destination_number" expression="^\*24$" break="on-true">
<action application="set" data="agent_id=${sip_from_user}" enabled="true"/>
<action application="set" data="agent_authorized=true" enabled="false"/>
<action application="set" data="agent_action=break" enabled="true"/>
<action application="lua" data="app.lua agent_status" enabled="true"/>
</condition>
<condition field="destination_number" expression="^(?:agent\+|\*24)(.+)$">
<action application="set" data="agent_id=$1" enabled="true"/>
<action application="set" data="agent_name=$1" enabled="false"/>
<action application="set" data="agent_authorized=true" enabled="false"/>
<action application="set" data="agent_action=break" enabled="true"/>
<action application="lua" data="app.lua agent_status" enabled="true"/>
</condition>
</extension>
</context>

View File

@ -131,6 +131,14 @@
action = "login"; action = "login";
status = 'Available'; status = 'Available';
end end
elseif (agent_action == "break") then
if (user_status == "On Break") then
action = "login";
status = 'Available';
else
action = "break";
status = 'On Break';
end
elseif (agent_action == "login") then elseif (agent_action == "login") then
action = "login"; action = "login";
status = 'Available'; status = 'Available';
@ -168,7 +176,7 @@
end end
--set the presence to terminated - turn the lamp off: --set the presence to terminated - turn the lamp off:
if (action == "logout") then if (action == "logout" or action == "break") then
event = freeswitch.Event("PRESENCE_IN"); event = freeswitch.Event("PRESENCE_IN");
event:addHeader("proto", "sip"); event:addHeader("proto", "sip");
event:addHeader("event_type", "presence"); event:addHeader("event_type", "presence");
@ -224,6 +232,9 @@
if (action == "logout") then if (action == "logout") then
session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_out.wav"); session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_out.wav");
end end
if (action == "break") then
session:execute("playback", sounds_dir.."/ivr/ivr-thank_you.wav");
end
end end
--send the status to the display --send the status to the display