Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-37
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
What is the Current Call?
The CIL maintains a concept of a Current Call, which is the call for which the last 
OnButtonEnablementChange() event was fired. Knowing which call is the Current Call is useful when 
there are multiple components which set and act on the Current Call, such as telephony ActiveX 
Controls. 
The CTI OS ActiveX controls included in the CTI OS Toolkit use the concept of the Current Call. The 
CallAppearance grid control sets the Current Call when the user clicks on a particular call in the grid. 
Then when the user clicks the Answer control, this control must get the Current Call in order to call the 
Answer() method on the correct call. 
The Current Call is set according to the following rules:
  •
When there is only 1 call on a device, the CIL sets it to the Current Call.
  •
When there are multiple calls on a device and an application wants to act on a call that is not the 
Current Call, it sets a different call to the Current Call with the SetCurrentCall() method.
  •
When the call which is the Current Call ends, leaving multiple calls on the device, the application 
must set another call to be the Current Call. 
  •
Whenever the Current Call is set to a different call, OnCurrentCallChanged() event is fired as well 
as an OnButtonEnablementChange() event.
How to Get a Call Object
You can get the Call object from the session using the GetObjectFromObjectID() method. 
The following code fragment, which assumes that existing Call Unique Identifiers are stored in an array 
called UIDArray, shows how to get a specific Call object in Java:
String sThisUID = UIDArray[Index];
Call ThisCall =  (Call) m_Session.GetObjectFromObjectID(sThisUID);
How to Set the Current Call for the Session
To set the current call you use the SetCurrentCall() method for the Session. The following code 
fragment, which assumes you retrieved the Call object as described in the previous section, shows how 
to set the current call.
The following line shows this in Java:
m_Session.SetCurrentCall(ThisCall);
Call Wrapup
The agent/supervisor desktop will need to behave differently at the end of a call depending on factors 
including:
  •
the direction of the call (inbound or outbound)
  •
configuration of IPCC or the ACD (whether wrapup data is required, optional, or not allowed)
  •
configuration of CTIOS server