Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide

Page of 500
   
4-39
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4      Building Your Application
Working with Calls
When Does the Application Receive the OnButtonEnablementChange() Event?
An application receives an OnButtonEnablementChange() event in the following situations:
  •
When the Current Call is changed.
  •
When the call which is the Current Call receives an event which includes a 
CTIOS_ENABLEMENTMASK argument. Usually the included enablement mask is changed from 
what it was set to, but occasionally it is the same. This mask is used to indicate which functions are 
allowed for this Call in its current state. 
For example, when a Call receives an OnCallDelivered() event with a Connection State of 
LCS_ALERTING, its enablement mask is changed to set the Answer bit. When this Call is 
answered, and it receives the OnCallEstablished() event, the mask no longer sets the Answer bit, but 
instead enables the Hold, Release, TransferInit and ConferenceInit bits.
What to do in the OnButtonEnablementChange() Event
To see if a button should be enabled, simply do a bitwise "AND" with the appropriate value listed in the 
Table included under the OnButtonEnablementChange event in Chapter 6.
The following examples shows this in Java:
Integer IMask = rArgs.GetValueIntObj(CTIOS_ENABLEMENTMASK);
if (null != IMask) {
 int iMask = IMask.intValue();
 if (iMask & ENABLE_ANSWER) {
 
 
//Enable the AnswerCall button
 }
 else {
  //Disable 
the 
AnswerCall 
button
 }
}
// else do nothing
Checking Not Ready Bitmasks in OnButtonEnablementChange() Event
A client application receiving the OnButtonEnablementChange() event must check both the 
ENABLE_NOTREADY and ENABLE_NOTREADY_WITH_REASON bitmasks in the event.
Caution
Failure to check both the ENABLE_NOTREADY and ENABLE_NOTREADY_WITH_REASON 
bitmasks may lead to problems properly displaying a NotReady control to the agent.