Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide

Page of 668
 
3-17
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1)
 
Chapter 3      CIL Coding Conventions
Using Button Enablement Masks
}
Visual Basic 6.0 example:
Public Sub m_Session_OnCallDeliveredEvent(ByVal pArguments as 
CTIOSClientLib.Arguments)
Dim nBitMask as Integer
If pArguments.IsValid “EnablementMask” Then
nBitMask = pArguments.GetValueInt “EnablementMask”
End If
‘ do bitwise comparison
If nBitMask And ENABLE_ANSWER Then
m_AnswerButton.Enable
End If
End Sub
Java example:
void OnCallDeliveredEvent(Arguments args)
{
Long LMask = 
args.GetValueUIntObj(CtiOs_IKeywordIDs.CTIOS_ENABLEMENTMASK);
if (null!=LMask)
{
long lMask = LMask.longValue();
if ((lMask & CtiOs_Enums.ButtonEnablement.ENABLE_ANSWER) == 0)
m_AnswerButton.setEnabled(false);
else
m_AnswerButton.setEnabled(true);
}
The advantage of using this approach is that all of the peripheral-specific details 
of enabling and disabling buttons is determined in a central location – at the CTI 
OS Server. This allows future new features to be enabled, and software bugs to be 
corrected in a central location, which is a great benefit for deploying future 
releases. 
Warning
The button enablement feature is intended to be used in agent mode 
applications and not for monitor mode applications.