Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide
2-6
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(1)
Chapter 2 CTI OS Client Interface Library Architecture
CIL Object Model
Agent Object Lifetime
In Agent Mode, the client programmer must create an Agent object (which causes its reference count to
be incremented to one) and must pass it to the Session in the SetAgent method.
be incremented to one) and must pass it to the Session in the SetAgent method.
Note
In C++, the object must be created on the heap memory store so that it can exist beyond the scope of the
method creating it. For clients using other CILs, this is handled automatically.
method creating it. For clients using other CILs, this is handled automatically.
The Session will hold a reference to the Agent object as long as it is in use, but the client programmer
must release the last reference to the object to prevent a memory leak.
must release the last reference to the object to prevent a memory leak.
In Monitor Mode, objects are created at the CIL when the CIL receive an event for that agent for first
time (e.g in an OnAgentStateChange event). When the Session receives an event for an unrecognized
Agent, that new Agent is added to the Session’s collection of agents.
time (e.g in an OnAgentStateChange event). When the Session receives an event for an unrecognized
Agent, that new Agent is added to the Session’s collection of agents.
During application clean-up, the Session object will release its references to all agents in the Agent
collection. To ensure proper memory clean-up, the programmer must release all reference to Agent
objects.
collection. To ensure proper memory clean-up, the programmer must release all reference to Agent
objects.
SkillGroup Object Lifetime
A SkillGroup object is created at the CIL the first time an OnNewSkillGroupStatisticsEvent event occurs
for that SkillGroup. It is added to the SkillGroup collection, and it is subsequently updated by follow-on
OnNewSkillGroupStatisticsEvent events.
for that SkillGroup. It is added to the SkillGroup collection, and it is subsequently updated by follow-on
OnNewSkillGroupStatisticsEvent events.
During application clean-up, the Session object releases its references to all skill groups in the
SkillGroup collection. To ensure proper memory clean-up, the programmer must release all reference to
SkillGroup objects.
SkillGroup collection. To ensure proper memory clean-up, the programmer must release all reference to
SkillGroup objects.
Methods that Call AddRef()
The following tables detail the various methods that call
AddRef(). To prevent memory leaks, C++
and COM application developers that call these methods in their applications must be aware of the
impact of these methods on the reference count and must appropriately release the reference when no
longer using the object:
impact of these methods on the reference count and must appropriately release the reference when no
longer using the object:
Table 2-1
SessionLib (C++)
Object Name
Method Name
Explanation
CAgent
GetSkillGroups(),
GetMonitoredCall()
The client application must call
Release() on the returned object
when the object is no longer
needed.
Release() on the returned object
when the object is no longer
needed.
CILRefArg
CreateInstance(),
GetValue()
The client application must call
Release() on the returned object
when the object is no longer
needed.
Release() on the returned object
when the object is no longer
needed.