Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide

Page of 546
 
3-17
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
 
Chapter 3      CIL Coding Conventions
Using Button Enablement Masks
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 vendor-specific 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)
{
unsigned int unBitMask = 0;
if (args.IsValid(“EnablementMask”))
{
args.GetValueInt(“EnablementMask”, & unBitMask) 
//do bitwise comparison
If(unBitMask & ENABLE_ANSWER)
m_AnswerButton.Enable();
}
}
Visual Basic example:
Public Sub m_Session_OnCallDeliveredEvent(ByVal pArguments as 
CTIOSClientLib.Arguments)
Dim nBitMask as Integer
If pArguments.IsValid “EnablementMask” Then