Hello!
I have tried to read all the development guide and googled a bunch but I must admit defeat!
We have a CC pulse stat server running and I want to get some of the same stats as visible in CC pulse but it does not seem to work as intended.
I am using the C# SDK
I want to get total number of CallsAnswered, the stat server automatically resets this stat at midnight, so I just want to peek/get the statistic from the same server
I tried to do this:
StatServerProtocol protocol = new StatServerProtocol(new Endpoint("host", port));
protocol.Open();
// Create Request
RequestGetStatistic req = RequestGetStatistic.Create();
//Request object
StatisticObject statobj = StatisticObject.Create();
statobj.ObjectId = "agent001";
statobj.ObjectType = StatisticObjectType.Agent;
statobj.TenantName = "Resources";
statobj.TenantPassword = "";
req.StatisticObject = statobj;
// Metrics
StatisticMetric statmet = StatisticMetric.Create("CallsAnswered");
req.StatisticMetric = statmet;
var response = protocol.Request(req);
Console.WriteLine(response);
This is the statistic defined on the server:
[CallsAnswered]
Category=TotalNumber
Description=Total number of inbound and outbound calls answered by agents.
MainMask=CallAnsweredInbound, CallAnsweredOutbound
Objects=Agent, Place, GroupAgents, GroupPlaces
Subject=DNAction
Out of our ~50 agents it only works for like 5 agents. Is my code correct? Maybe issue is on stat server? Some other statistics work fine such as (AgentExtendedStatus)
I also tried RequestGetStatisticEx with defining my own masks etc like so:
RequestGetStatisticEx reqex = RequestGetStatisticEx.create();
var mainMask = new DNActionsMask();
mainMask.SetBit(DnActions.CallAnsweredInbound);
mainMask.SetBit(DnActions.CallAnsweredOutbound);
var relmask = new DNActionsMask();
relmask.ClearAll();
reqex.StatisticObject = StatisticObject.Create();
reqex.StatisticObject.ObjectId = "agent001";
reqex.StatisticObject.ObjectType = StatisticObjectType.Agent;
reqex.StatisticObject.TenantName = "Resources";
reqex.StatisticObject.TenantPassword = "";
reqex.StatisticMetricEx = StatisticMetrixEx.Create();
reqex.StatisticMetricEx.TimeProfile = "Default";
reqex.StatisticMetrixEx.Category = StatisticCategory.TotalNumber;
reqex.StatisticMetrixEx.Subject = StatisticSubject.DNAction;
reqex.StatisticMetricEx.MainMask = mainMask;
reqex.StatisticMetricEx.RelativeMask = relmask;
regex.StatisticMetricEx.IntervalType = StatisticInterval.SinceLogin;
protocol.Send(reqex);
while(true)
{
var response = protocol.Receive();
Console.WriteLine(response);
}
In both examples I get back Eventinfo but the value is incorrect.
Additional info:
We got a main server and backup server in CC pulse idk if it has any influence.