Genesys CTI User Forum > Genesys-related Development

Collect statistic data from Genesys Stat server

<< < (2/2)

terry:
You will need to specify proper masks when you define statistic.
And you really will need to have access to logs.

callmevijayc:
My Code will be similar like below.. Using Platform SDK version 8.1.

        StatisticObject object = StatisticObject.create();
        object.setObjectId("name_of_virtual_queue@switch_name");
        object.setObjectType(StatisticObjectType.Queue);
        object.setTenantName("Resources");
 
        DnActionsMask mainMask = new DnActionsMask();
        mainMask.setBit(DnActions.CallEntered);

        DnActionsMask relMask = new DnActionsMask();

        StatisticMetricEx metric = StatisticMetricEx.create();
        metric.setCategory(StatisticCategory.TotalNumber);
        metric.setMainMask(mainMask);
        metric.setRelativeMask(relMask);
        metric.setSubject(StatisticSubject.DNAction);
        metric.setTimeProfile("Default");
        metric.setIntervalType(StatisticInterval.GrowingWindow);

        Notification notification = Notification.create();
        notification.setMode(NotificationMode.Periodical);
        notification.setFrequency(5);

        I am not getting any response from the api.. Tried different StatisticCategory values also.
Please someone help if i am missing anything in the StatisticMetricEx object like timeprofile/time range etc..

Kubig:
I do not see any fragment of code where you connect to the StatServer, send the request and consume the response.

PeteHoyle:
I think one issue is that you are using a DnActions.CallEntered mask for stats from a Queue

mainMask.setBit(DnActions.CallEntered);

If you look at a successful OpenStat request for Total Entered  for a Queue the MainMask is 10 (CallEntered)

2015-07-27 11:55:45.328> Client: Message 'OpenStat'
                'CREATE_SUSPENDED'  'no'
                'FILTER' 'VoiceCall'
                'DistByConnID'  0
                'TM_NOTIFICATION_FREQ'        10
                'NOTIFICATION_MODE'                'TimeBasedNotification' (1)
                'INSENS_PERCENTAGE' 1
                'INTERVAL'          'Growing' (0)
                'TIME_PROFILE'                'Default'
                'STAT_TYPE'        'Total_Entered'
                'USER_REQ_ID' 47
                'REQ_ID'              61
                'SUBJECT'            'DNAction' (0)
                'CATEGORY'        'TotalNumber' (1)
                'TENANT_ID'      'Environment'
                'OBJECT_ID'        'Gold@SIP_Switch'
                'OBJECT'              'Queue' (5)
                'VOID_VALUE'  TKVList Length 60
                                'Insens' 1
                                'Filter'    'VoiceCall'
                                'TimeProfile'      'Default'
                'MainMask'        all actions clear except for
                                                'CallEntered' (10)
                'RelMask'            all actions clear

But if you look at the definition for DnActions.CallEntered, this is equal to 80.

Try using the following code that uses the RoutePointActionsMask and RoutePointActions.CallEntered as below:

[code]           
            RequestOpenStatisticEx req = RequestOpenStatisticEx.Create();
            StatisticObject obj = StatisticObject.Create();
            obj.ObjectId = "Gold@SIP_Switch";
            obj.TenantName = "Environment";
            obj.ObjectType = StatisticObjectType.Queue;
            StatisticMetricEx metric = StatisticMetricEx.Create();
            RoutePointActionsMask mainMask = new RoutePointActionsMask();
            mainMask.SetBit(RoutePointActions.CallEntered);
            RoutePointActionsMask relMask = new RoutePointActionsMask();
            metric.MainMask = mainMask;
            metric.RelativeMask = relMask;
            metric.Subject = StatisticSubject.DNAction;

            metric.Category = StatisticCategory.TotalNumber;
            metric.TimeProfile = "Default";
            metric.IntervalType = StatisticInterval.GrowingWindow;


            Notification notification = Notification.Create();
            notification.Mode = NotificationMode.Periodical;
            notification.Frequency = 30;
           

            req.StatisticObject = obj;
            req.StatisticMetricEx = metric;
            req.ReferenceId = 1;
            req.Notification = notification;

            var response = protocolManagementService["Stat_Server_App"].Request(req);[/code]

Navigation

[0] Message Index

[*] Previous page

Go to full version