[quote author=merve.ugursac link=topic=12271.msg54748#msg54748 date=1649058412]
Hi,
I appreciate the effort you've put in to help me! Thank you very much! I can get the count now on a sample project that represents mine.
The problem now is, I need the count in an immediate call since on protocol received I read the call count waiting on each virtual queue. Inside this function I need an immediate request-response of this agent-break counts. That was why I had tried to read the response immediately afterwards. I have adjusted my code to read both queries on statProtocol.received but the response of the agentcount is not available when I need that since its not immediate this way.
Do you think there is a way to accomplish this?
For the following :
907 is my virtual queue and result : 1 because I am on the line and the agent of this queue is on break (AUX_RC_3 which will be queried with a referanceId of 10002), so I need the count of agents who are under this virtQueue.
2022-04-04 10:26:56,579: [ INFO] OnWaitingCallsEventInfo()- result : 1 referanceId : 907
2022-04-04 10:26:56,579: [ INFO] OnWaitingCallsEventInfo()- referanceId (queue.DbId) : 907 için result : 1, queue.QueueName :VQ_TestCampaign, queue.QueueMaxAgent :0.
2022-04-04 10:26:56,583: [ INFO] GetCampaingNameFromVirtualQueueId() - QueueId : 907 , VQ_TestCampaign - virtualQueue.Switch.Name : SIPSwitch_DR , AgentGroupName Found : TestCampaign
2022-04-04 10:26:56,886: [ INFO] - OnWaitingCallsEventInfo - Agents on break : [] [b] I needed the count here [/b]
2022-04-04 10:26:56,886: [ INFO] - OnWaitingCallsEventInfo - -- ResultValues , IsCallFirstCall false , FirstCallTime: 4.04.2022 10:26:56
2022-04-04 10:26:56,886: [ INFO] OnWaitingCallsEventInfo()- result : 0 referanceId : 10000 [b] --> AUX_RC_1[/b]
2022-04-04 10:26:56,886: [ INFO] OnWaitingCallsEventInfo()- result : 0 referanceId : 10001 [b]--> AUX_RC_2[/b]
2022-04-04 10:26:56,886: [ INFO] OnWaitingCallsEventInfo()- result : 1 referanceId : 10002 [b] --> AUX_RC_3 --> but I got it here[/b]
2022-04-04 10:26:56,889: [ INFO] OnWaitingCallsEventInfo()- result : 0 referanceId : 10003 [b]--> AUX_RC_4[/b]
Long story short, I need the reponse here :
[code]
switch (response.Name)
{
case "EventStatisticOpened":
Console.WriteLine($"{methodName} - Registered statistic for object {agentGroupName} and filter {agentGroupAndFilter}"); [b]--> here [/b]
break;
case "EventError":
Console.WriteLine($"{methodName} - Error opening statistic for object {agentGroupName} and filter {agentGroupAndFilter}");
break;
default:
Console.WriteLine($"{methodName} - response.Name : {agentGroupName} and filter {agentGroupAndFilter}");
break;
}
[/code]
[/quote]
Getting the Statistic Values is always assyncronous either through Notification or through using the RequestPeekStatistic (note that you cant even use the StatServerProtocol.Request to get it synchronously).
That means that you will always receive the values on the EventInfo as part of the MessageEventArgs on the Method that you set as handler on StatServerProtocol.Received event.
When you use Immediate notification and Insensitivity = 1, you receive an assyncronous EventInfo whenever the statistical value changes.
If you need to do something in your code upon receiving the data, use that handler.