" /> Agent Status Per Media Channel - Genesys CTI User Forum

Author Topic: Agent Status Per Media Channel  (Read 2584 times)

Offline raza990

  • Full Member
  • ***
  • Posts: 214
  • Karma: 5
Agent Status Per Media Channel
« on: November 21, 2014, 03:44:30 PM »
Advertisement
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.

Offline raza990

  • Full Member
  • ***
  • Posts: 214
  • Karma: 5
Re: Agent Status Per Media Channel
« Reply #1 on: November 24, 2014, 07:23:29 AM »
Need help.