Genesys CTI User Forum > Genesys-related Development
Statistics PSDK CurrentState for Agent
Kubig:
Statistic PSDK is not deprecated - may be you are using old version of specific library.
gstkein:
Iīve fixed it, what was marked as deprecated was "DnActionMask mainMask = ActionsMask.createDNActionsMask(); "
I just replaced that for itīs parent class since there was no difference between both and it worked.
RequestOpenStatisticEx request =
RequestOpenStatisticEx.create();
StatisticObject object = StatisticObject.create();
object.setObjectId(agentEmployeId);
object.setObjectType(StatisticObjectType.Agent);
object.setTenantName(tenantName);
object.setTenantPassword("");
Notification notification = Notification.create();
notification.setMode(NotificationMode.Immediate);
DnActionsMask mainMask = new DnActionsMask();
mainMask.setBit(DnActions.WaitForNextCall);
mainMask.setBit(DnActions.CallDialing);
mainMask.setBit(DnActions.CallRinging);
mainMask.setBit(DnActions.OffHook);
mainMask.setBit(DnActions.NotReadyForNextCall);
mainMask.setBit(DnActions.CallOnHold);
mainMask.setBit(DnActions.CallUnknown);
mainMask.setBit(DnActions.CallConsult);
mainMask.setBit(DnActions.CallInternal);
mainMask.setBit(DnActions.CallOutbound);
mainMask.setBit(DnActions.CallInbound);
mainMask.setBit(DnActions.LoggedOut);
DnActionsMask relMask = new DnActionsMask();
StatisticMetricEx metric = StatisticMetricEx.create();
metric.setCategory(StatisticCategory.CurrentState);
metric.setMainMask(mainMask);
metric.setRelativeMask(relMask);
metric.setSubject(StatisticSubject.DNAction);
metric.setTimeProfile("Default");
metric.setIntervalType(StatisticInterval.GrowingWindow);
request.setStatisticMetricEx(metric);
request.setNotification(notification);
request.setStatisticObject(object);
callmevijayc:
Any have idea how to get the statistics for statistics category CurrentTargetState. I am getting result for statistics category currentState but not for CurrentStatetrager
RobertH:
You need to open stat and subscribe for updates. "StatisticCategory.CurrentTargetState" is different from others, you can't peek it.
Reason is that, if you will query long list of objects, it may cause stat server performance HIT.
So use of this stat is:
- open
- it gets current values for all objects (HIT)
- it is getting deltas on each objects on state change
your application must add stat server event handler and handle updates for this stats.
On Open:
Message= 'EventStatisticOpened' (22) attributes:
TM_LENGTH [int] = 0
LONG_VALUE [int] = 0
USER_REQ_ID [int] = -1
TM_SERVER [int] = 1438869600
REQ_ID [int] = 1
Message= 'EventCurrentTargetStateSnapshot' (17) attributes:
TM_LENGTH [int] = 0
USER_REQ_ID [int] = -1
LONG_VALUE [int] = 0
CURRENT_TARGET_STATE_INFO [CurrentTargetState] = CurrentTargetStateSnapshot (size=1) [
[0] CurrentTargetStateInfo {
On change state (be aware: Not Ready to NotReady - Reason is not change state for this stat)
Message= 'EventCurrentTargetStateTargetUpdated' (19) attributes:
CURRENT_TARGET_STATE_DELTA [CurrentTargetState] = CurrentTargetStateDelta
[code]
RequestGetStatisticEx req = RequestGetStatisticEx.create();
StatisticObject object = StatisticObject.create();
object.setObjectId("agentusername");
object.setObjectType(StatisticObjectType.Agent);
object.setTenantName("Environment");
object.setTenantPassword("");
StatisticMetricEx statisticMetricEx = StatisticMetricEx.create();
statisticMetricEx.setCategory(StatisticCategory.CurrentTargetState);
statisticMetricEx.setSubject(StatisticSubject.AgentStatus);
ActionsMask actMask = ActionsMask.createDNActionsMask();
ActionsMask relMask = ActionsMask.createDNActionsMask();
statisticMetricEx.setMainMask(actMask);
statisticMetricEx.setRelativeMask(relMask);
statisticMetricEx.setIntervalLength(10);
statisticMetricEx.setIntervalType(StatisticInterval.GrowingWindow);
req.setStatisticObject(object);
req.setStatisticMetricEx(statisticMetricEx);
Notification notification = Notification.create();
notification.setMode(NotificationMode.Immediate);
RequestOpenStatisticEx reqo = RequestOpenStatisticEx.create();
reqo.setNotification(notification);
reqo.setStatisticObject(object);
reqo.setStatisticMetricEx(statisticMetricEx);
try {
statServerProtocol.send(reqo);
} catch (ProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
[code][/code]
escarneiro:
How do someone find the Tenant Name ? What is it at all ?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version