Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 508
   
3-11
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 8.0(1)
Chapter 3      CIL Coding Conventions
Obtaining Objects from UniqueObjectIDs
queued or targeted (by the ACD) for a specific agent, the application can match the saved record (object) 
with the incoming call by the ICMEnterpriseUniqueID field. The following events will contain the 
ICMEnterpriseUniqueID that can be used to associate a call with the saved call information:
eCallBeginEvent 
eCallDataUpdateEvent
eSnapshotCallConf
eCallEndEvent
Obtaining Objects from UniqueObjectIDs
Client applications written to take advantage of the CIL can use the UniqueObjectID to obtain a pointer 
(in C++ or COM for C++) or a reference (in other languages) to the underlying object.
The CIL Session object provides easy access to the object collections via several methods, including 
GetObjectFromObjectID. GetObjectFromObjectID takes as a parameter the string UniqueObjectID of 
the desired object, and returns a pointer to the object. Since this mechanism is generic, and does not 
contain specific information about the object type retrieved, the pointer (or reference) returned is a 
pointer or reference to the base class: a CCtiosObject* in C++, an Object in Visual Basic, an IDispatch* 
in COM for C++, or CtiOsObject in .NET and Java. 
Note
The GetObjectFromObjectID method will perform an AddRef() on the pointer before it is returned to 
the programmer. 
C++ example:
string sUniqueObjectID = “call.5000.101.23901”;
Ccall * pCall = NULL;
m_pSession->GetObjectFromObjectID(sUniqueObjectID, 
                        (CCtiOsObject**)&pCall);
pCall->Clear();
pCall->Release(); // release our reference to this object
pCall = NULL;
Java example:
String  sUID = “call.5000.101.23901”;
Call rCall = (Call) m_Session.GetObjectFromObjectID(sUID);
Using Button Enablement Masks
The CTI OS Server provides a rich object-level interface to the CTI interactions of the contact center. 
One of the features the CTI OS Server provides is to evaluate all of the telephony events, and map them 
to the features permitted by the Cisco CallManager implementation. The CTI OS Server provides a 
peripheral-independent mechanism for clients to determine which requests are valid at any given time 
by using a bitmask to indicate which requests are permitted. 
For example, the only time when it is valid to answer a call is when the ENABLE_ANSWER bit in the 
enablement mask is set to the on position. The following C++ example depicts this case:
void EventSink::OnCallDeliveredEvent(Arguments& args)
{