Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 508
   
4-71
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 8.0(1)
Chapter 4      Building Your Application
Building Supervisor Applications
OnNewAgentTeamMember
OnNewAgentTeamMember events should be processed as follows. 
The OnNewAgentTeamMember event is received for two possible reasons.  They are as follows.
1.
After the application calls Agent.RequestAgentTeamList(), OnNewAgentTeamMember events are 
sent for each member of the supervisor’s team.
2.
An agent has been added or removed from the supervisor’s team.
To address point 2 above, the field “ConfigOperation” in the payload of the OnNewAgentTeamMember 
event must be examined.  If this flag does not exist or exists and is set to 
TeamConfigFlag.CONFIG_OPERATION_ADDAGENT (1), the agent should be added to the grid.  If 
the flag exists and is not set to TeamConfigFlag.CONFIG_OPERATION_ADDAGENT, the agent should 
be removed from the grid.
In supervisor applications, use the value in the UniqueObjectID field of the event to uniquely 
reference/track each agent in the supervisor’s team.  This ID uniquely identifies each agent cached on 
the CIL.
OnNewAgentTeamMember Events and Supervisors
Note
Since the supervisor is considered part of the team, an OnNewAgentTeamMember event is sent for the 
supervisor logged into the application.  If the developer does not want to include the supervisor in the 
agent team grid, compare the current agent ID to the ID of the agent carried in the 
OnNewAgentTeamMember event.  If the values are equal, do not add the supervisor to the grid.
If the developer does not want to add primary supervisors to the grid, retrieve the Agent object stored in 
the CIL using the Session.GetObjectFromObjectID() method.  When calling 
Session.GetObjectFromObjectID(), set the value in the “UniqueObjectID” 
(Enum_CtiOs.CTIOS_UNIQUEOBJECTID) field of the OnNewAgentTeamMember event as the key 
(first parameter to this method).  This method will return an Agent object.  Check the properties of the 
Agent object for the field “AgentFlags” (Enum_CtiOs.CTIOS_AGENTFLAGS).  If the field exists with 
the TeamConfigFlag.AGENT_FLAG_PRIMARY_SUPERVISOR (0x01) bit set, the agent is a primary 
supervisor and should not be added to the grid.
It is possible for an agent to be a team’s supervisor while not being a member of the team.  Some 
supervisor applications, including the combo desktop, may not want to add this type of supervisor to the 
agent select grid.  This is tricky because supervisors that are not part of the team will generate 
OnMonitoredAgentStateChange events.  The agent select grid normally updates when the 
OnMonitoredAgentStateChangeevent is received.  In order to prevent this, supervisors who are not 
members of the team that they are supervising will need to be marked as such.  This information can be 
used to avoid updates when an OnMonitoredAgentStateChange event is received for a supervisor that is 
not part of the team.  In order to accomplish this, the application leverages the following.
1.
OnNewAgentTeamMember events will not be received for supervisors that are not part of the team.
2.
The CIL keeps a cache of all the agents and supervisors that it knows about.  Agents in this cache 
have properties that can be modified by applications built on top of the CIL.
Knowing this, the application will mark every agent that is included in a OnNewAgentTeamMember 
event as a member of this supervisor's team.  When OnMonitoredAgentStateChange events are received, 
the agent select grid will only update when the agent that is represented by the event is marked as a