Hello All,
I want to show the current agent status on each media channel. For this I created the below formulas in CCPulse.
[u][b]FOR VOICE:[/b][/u]
result.Text = GetAgentVoiceState();
function GetAgentVoiceState()
{
if(state.type != "AgentState")
return "n/a";
var r = "";
var n = 0;
for(var e = new Enumerator(state.DNs); !e.atEnd(); e.moveNext())
{
if (e.item().DNType == "Extension" || e.item().DNType == "Position" || e.item().DNType == "ACDPosition")
{
if (isLogged(e.item())==1)
{ r = (r == "" ? e.item().Status : r+" / "+e.item().Status); }
}
}
return r;
}
function isLogged(dn)
{
var r = 0;
for(var e = new Enumerator(dn.Actions); !e.atEnd(); e.moveNext())
{ r = (e.item().Action == "LoggedIn" ? 1 : r); }
return r;
}
[u][b]FOR EMAIL:[/b][/u]
result.Text = GetAgentEmailState();
function GetAgentEmailState()
{
if(state.type != "AgentState")
return "n/a";
for(var e = new Enumerator(state.DNs); !e.atEnd(); e.moveNext())
{
if (e.item().DNType == "Unknown" && e.item().DN == "email")
{ return e.item().Status; }
}
return "";
}
The Email status is being updated in CCPulse as the status changes but the Voice status change in CCPulse only for 1 second and then automatically show the previous status

.. When press the “Peak Statistics” button then CCPulse shows the updated status.

I’ve taken a look at the scripts behind the two stats but I can’t really see a reason why it shouldn’t be working :-(
Can you please help me guys.