Cisco Cisco Computer Telephony Integration Option 9.0 Guia Do Programador

Página de 490
   
4-46
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 4      Building Your Application
Working with Agent Statistics
Step 3
Set connection parameters, as described on page 4-21.
Step 4
Connect the desktop application to the CTI OS Server, as described on page 4-22.
Step 5
Set a String variable to store the ID of the agent for which you want statistics.
Note
The application must be aware of the Agent ID and the agent’s Peripheral ID for any agent 
to monitor; the application cannot dynamically get these values from CTI OS Server.
Step 6
Set the message filter as described on page 4-26.
a.
Create String for the filter using the keyword 
CTIOS_MESSAGEID
 as the name, and “*;agentID” as the 
value. 
Note
The “*;” indicates all events for that agent.
b.
Create an instance of the Arguments class.
c.
Set the value in the filter for the CTIOS_FILTER keyword to the String created in Step a.
d.
Use the SetMessageFilter() method in the Session class to set the filter for the session, using the 
Arguments instance you created in Step b as a parameter.
Step 7
Wait for any event for the agent, to ensure that the Agent instance exists for the Session.
Caution
The application must wait for the first event for this agent before continuing, to ensure that 
the Agent instance is part of the current session.
Note
This example uses a Wait object to wait. 
Step 8
Get the Agent instance from the Session using GetObjectFromObjectID() method.
Step 9
Enable agents statistics using the EnableAgentStatistics() method. 
Note
Although the EnableAgentStatistics() method requires an Arguments parameter, there are no 
parameters to set for agent statistics; you can therefore use an empty Arguments instance as 
a parameter.
Caution
The agent must be logged in before you can use the EnableAgentStatistics() method.
Step 10
To disable agents statistics, use the DisableAgentStatistics() method.