From cf39ea04d93e506ecb8e2e214dbf6a1bfa528016 Mon Sep 17 00:00:00 2001 From: DigiDaz Date: Wed, 14 Sep 2016 03:06:26 +0100 Subject: [PATCH] Moved the display update to the end (#1913) Moved the UPDATE sip request to the end as it was sending the UPDATE request sometimes before the ACK had been received to the 200OK. This was sometimes causing it to fail. Also removed a couple of commented out lines. --- .../scripts/app/agent_status/index.lua | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/resources/install/scripts/app/agent_status/index.lua b/resources/install/scripts/app/agent_status/index.lua index bd333d1721..230c59785b 100644 --- a/resources/install/scripts/app/agent_status/index.lua +++ b/resources/install/scripts/app/agent_status/index.lua @@ -166,6 +166,16 @@ status = "Invalid ID or Password"; end +--set the status and presence + if (session:ready()) then + if (action == "login") then + session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_in.wav"); + end + if (action == "logout") then + session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_out.wav"); + end + end + --send the status to the display if (status ~= nil) then reply = api:executeString("uuid_display "..uuid.." '"..status.."'"); @@ -175,15 +185,3 @@ if (session:ready()) then session:execute("sleep", "2000"); end - ---set the status and presence - if (session:ready()) then - if (action == "login") then - session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_in.wav"); - --session:execute("playback", "tone_stream://%(500,0,300,200,100,50,25)"); - end - if (action == "logout") then - session:execute("playback", sounds_dir.."/ivr/ivr-you_are_now_logged_out.wav"); - --session:execute("playback", "tone_stream://%(200,0,500,600,700)"); - end - end