Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: molkemon on November 18, 2016, 09:03:43 PM
-
Hi,
I made a formula to translate NotReady reasons to (hh:mm:ss) Reason. However, I also want to make a condition that if the agent isn't NotReady, the formula should output what is basically "ExtendedCurrentState".
[img]http://imgur.com/jG5YTg6.jpg[/img]
I tried with "return ccpulse.group("MyAgentStateGroup").statistic("ExtendedCurrentState").
However when I do this, it only returns weird numbers, like 4 or 22. How can I get the output of the Status column for agents that are not NotReady exactly as it is in the "StatusAlt" column on the screenshot?
Alternatively, I tried with state.Status. This returns the correct state as text, but how can I get the current time in the state with it?
-
is this in pulse or ccpulse ?
-
Use this statistic for reasons + time output
[CurrentStateReasons]
Category=CurrentStateReasons
MainMask=*
Objects=Agent
ReasonStartOverridesStatusStart=yes
Subject=DNAction
-
@Tambo: This is ccpulse.
@Jones: I cannot create statisctics, I have only full privilege to the ccpulse client, not server administration rights.
-
http://www.sggu.com/smf/index.php/topic,9896.0.html
if you use search you may find the answer
-
Solution to this: use the state object with state.StartTime and state.Status
After evaluating for all reason codes, if the current status is NOT NotReadyForNextCall(Reason) then do this:
var startzeit = state.StartTime;
var datumob = new Date(startzeit);
var datumobtoms = datumob.valueOf();
var datumob2 = new Date();
var differenz = (datumob2.getTime() - datumobtoms) / 1000;
var d = differenz
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? (h < 10 ? "0" : "") + h + ":" : "00:") + (m > 0 ? (m < 10 ? "0" : "") + m + ":" : "00:") + (s < 10 ? "0" : "") + s);
return "(" + f + ") " + state.Status;