Dialplan - Feature code to control agent Break status.
This commit is contained in:
parent
9a565cdb14
commit
c41121a00f
|
|
@ -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>
|
||||
|
|
@ -131,6 +131,14 @@
|
|||
action = "login";
|
||||
status = 'Available';
|
||||
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
|
||||
action = "login";
|
||||
status = 'Available';
|
||||
|
|
@ -168,7 +176,7 @@
|
|||
end
|
||||
|
||||
--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:addHeader("proto", "sip");
|
||||
event:addHeader("event_type", "presence");
|
||||
|
|
@ -224,6 +232,9 @@
|
|||
if (action == "logout") then
|
||||
session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_out.wav");
|
||||
end
|
||||
if (action == "break") then
|
||||
session:execute("playback", sounds_dir.."/ivr/ivr-thank_you.wav");
|
||||
end
|
||||
end
|
||||
|
||||
--send the status to the display
|
||||
|
|
|
|||
Loading…
Reference in New Issue