Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 490
   
A-3
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Appendix A      CTI OS Keywords and Enumerated Types
Enumerated Types
Java Interfaces
The Java CIL handles the C++ CIL enums through the use of interfaces. The custom application can then 
either implement those interfaces and use the static data members without referencing them with the 
interface name first, or it can access those members through referencing.  By convention, the name of 
the Java interface is the same as the enum tag but with the “enumCTIOS_”  prefix substituted with 
“CtiOs_I”. So for example, the following C++ CIL enum
enum enumCTIOS_AgentState
{
eLogin = 0,
eLogout = 1,
eNotReady = 2,
eAvailable = 3,
eTalking = 4,
eWorkNotReady = 5,
eWorkReady = 6,
eBusyOther = 7,
eReserved = 8,
eUnknown = 9,
eHold=10
 };
is implemented in the Java CIL as follows:
public interface CtiOs_IAgentState
{
public static final inteLogin = 0,
eLogout = 1,
eNotReady = 2,
eAvailable = 3,
eTalking = 4,
eWorkNotReady = 5,
eWorkReady = 6,
eBusyOther = 7,
eReserved = 8,
eUnknown = 9,
eHold=10;
}
A Java CIL application can access those defined values in one of two ways; either by implementing the 
interface, as shown:
public class MyAgent extends CtiOsObject implements CtiOs_IAgentState
{
 
      .................................................
      
      public int MyLogin(Arguments rArguments)
     {
..................................
               //Access eLogin directly
rArguments.AddItemInt( "agentstate", eLogin );
..................................
     }
}