Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: MTM on June 24, 2009, 08:58:40 AM

Title: CCpulse query
Post by: MTM on June 24, 2009, 08:58:40 AM
I'm trying to build a very simple view but it's driving me nuts!  :-\
The requirement is to allow the supervisor to view a list of agents in an agent group.
They want to see who's on a call and highlight them as follows:
Up to 3 mins: Green
3-6 mins: Yellow
6+ mins: Red
In my view I have just one statistic: Agent State. (Shows agent state and time in that state)
However when I try to set a threshold against Agent State I can only do so against the 'state' itself, not the time the agent has been in this state. When I look at the other 'time' statistics they all seem to be cumulative or average totals.
Can anyone tell me how to set a threshold against the time an agent has been in any give state or where I can find a statistic of 'time in current state'?

Thanks, y'all  :)
Title: Re: CCpulse query
Post by: bounty on June 24, 2009, 09:26:49 AM
You cannot set threshold on the native "AgentStatus" statistic. You will have to separate the Status an the Time in 2 differents statistics :

[code][AG_CurrStatusTime]
Category=CurrentTime
Description=Time in current state for an agent
MainMask=WaitForNextCall, NotReadyForNextCall, AfterCallWork, CallInbound, CallOutbound, CallInternal, CallOnHold, CallConsult
Objects=Agent, GroupAgents, GroupPlaces, Place, RegDN
Subject=DNStatus
[/code]

and

[code][CurrentExtendedAgentState]
Category=CurrentState
Description=Agent Extended Status
MainMask=*
Objects=Agent
Subject=DNAction[/code]

Hope this helps
Title: Re: CCpulse query
Post by: MTM on June 24, 2009, 10:12:07 AM
Where do I go to enter this code? (I'm using 7.5)
If I go into the properties for CurrentAgentState these fields are greyed out.
If I add a new 'Formula' and go into properties it's looking for some code in an 'ActiveX
Scripting Expression' box.
Title: Re: CCpulse query
Post by: bounty on June 24, 2009, 11:02:51 AM
These definitions have to be entered in the options TAB of your StatServer Reporting via Configuration Manager
Then restart CCPulse+, and you will be able to see them by creating a new Agent view.
The formula uses VBS scripting language : Here is an example to show my own text rather than Genesys agent states (in french):

[code]a = StatVoix();
if (a!="") {
result.text = a;
} else {
if (ccpulse.group("Etats (à masquer)").PretVoix==1) result.text = "Prêt"
if (ccpulse.group("Etats (à masquer)").RetraitVoix==1) result.text = "Retrait"
if (ccpulse.group("Etats (à masquer)").PostTraitementVoix==1) result.text = "Post-Traitement"
if (ccpulse.group("Etats (à masquer)").AppelEntrant==1) result.text = "Conv entrante"
if (ccpulse.group("Etats (à masquer)").AppelSortant==1) result.text = "Conv sortante"
}

function StatVoix() {
etat = ccpulse.group("Etats (à masquer)").statistic("Etat Voix")
if (etat == 4 && ccpulse.group("Etats (à masquer)").PretVoix==1) {
return "Prêt"
} else if (etat == 5) {
return "Conv (décroché)"
} else if (etat == 0) {
return "Non Monitoré"
} else if (etat == 1) {
return "Monitoré"
} else if (etat == 6) {
return "Conv (numérotation)"
} else if (etat == 7) {
return "Conv (sonnerie)"
} else if (etat == 8 && ccpulse.group("Etats (à masquer)").RetraitVoix==1) {
if (ccpulse.group("Etat Courant").statistic("Tps RT1")>0) { return "Retrait 1" }
else if (ccpulse.group("Etat Courant").statistic("Tps RT2")>0) { return "Retrait 2" }
else if (ccpulse.group("Etat Courant").statistic("Tps RT3")>0) { return "Retrait 3" }
else if (ccpulse.group("Etat Courant").statistic("Tps RT4")>0) { return "Retrait 4" }
else if (ccpulse.group("Etat Courant").statistic("Tps RT5")>0) { return "Retrait 5" }
else if (ccpulse.group("Etat Courant").statistic("Tps RT6")>0) { return "Retrait 6" }
else { return "Retrait" }
} else if (etat == 9 && ccpulse.group("Etats (à masquer)").PostTraitementVoix==1) {
return "Post-Traitement"
} else if (etat == 13 && ccpulse.group("Etats (à masquer)").AppelEntrant==1) {
return "Conv (garde)"
} else if (etat == 19 && ccpulse.group("Etats (à masquer)").AppelEntrant==1) {
return "Conv (double appel)"
} else if (etat == 20 && ccpulse.group("Etats (à masquer)").AppelEntrant==1) {
return "Conv (interne)"
} else if (etat == 21 && ccpulse.group("Etats (à masquer)").AppelSortant==1) {
return "Conv (sortante)"
} else if (etat == 22 && ccpulse.group("Etats (à masquer)").AppelEntrant==1) {
return "Conv (entrante)"
} else if (etat == 23) {
return  "Délogué"
} else if (etat == -1) {
return ""
} else {
return ""
}
}[/code]


Title: Re: CCpulse query
Post by: Dionysis on June 24, 2009, 12:17:07 PM
There is an easier way.

In the threshold examples that Genesys provides there is a threshold which shows status with a delay.  Simply edit the example to wait x seconds before applying for a particular status.

:)
Title: Re: CCpulse query
Post by: Sylvainsjc on June 25, 2009, 06:44:58 AM
Example for Inbound calls

[u]Up to 3 mins: Green[/u]
if Threshold.StatValue = StatAction.SDNACallInbound then
  Threshold.Result = true
end if

[u]3-6 mins: Yellow[/u]
if Threshold.StatValue = StatAction.SDNACallInbound then
  Threshold.ActionDelay = 180
  Threshold.Result = true
end if

[u]6+ mins: Red[/u]
if Threshold.StatValue = StatAction.SDNACallInbound then
  Threshold.ActionDelay = 360
  Threshold.Result = true
end if

;)
Title: Re: CCpulse query
Post by: MTM on June 25, 2009, 10:02:47 AM
I like this option, Sylvainsjc, because it means I don't have to configure new stats and stop/start Stat server.

However, CurrentAgentState always stays green.
I assume this is because all 3 'if' statements and, consequently, all 3 thresholds return true eventually.
I.e. - For the first 3 mins only the first threshold is true so field is Green
        For the next 3 mins both the first and second threshold are true (but 1st seems to override 2nd)
        After 6 minutes all three thresholds are true (and 1st still overrides the other 2)

Is there any way I can set the 1st threshold to false in the second threshold
and the 1st & 2nd to false in the 3rd threshold?