Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 506
   
4-38
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(1)
Chapter 4      Building Your Application
Working with Calls
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 Unified CC or the ACD (whether wrapup data is required, optional, or not allowed)
configuration of CTI OS server
The CTI Toolkit Combo Desktop .NET sample shows how to use this information to display a wrapup 
dialog that allows the agent to select from a set of pre-configured wrapup strings after an inbound call 
goes into wrapup state. (See ProcessOnAgentStateEvent in SoftphoneForm.cs) On an agent state change 
event, if the state changes to WorkReady or WorkNotready state, this indicates that the agent has 
transitioned to call wrapup state. The CTI OS server will provide the following key/value pairs in the 
event arguments to aid in determining whether wrapup data may be associated with the call and whether 
that data is required or optional.
CTIOS_INCOMINGOROUTGOING indicates the direction of the call. The defined values are
0 = the direction of the call is unknown
1 = the call is an incoming call and the agent may enter wrapup data
2 = the call is an outgoing call and the agent may not enter wrapup data