Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 490
   
3-9
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 3      CIL Coding Conventions
Generic Interfaces
Java example:
Arguments args = new Arguments();
args.SetValue(CtiOs_IkeywordIDs.CTIOS_DIALEDNUMBER, “12345”);
args.SetValue(CtiOs_IkeywordIDs.CTIOS_CALLVARIABLE1, “MyData”);
int iRet = m_Agent.MakeCall(args);
The Arguments structure can store and retrieve all native C/C++, Visual Basic, and .NET and Java types, 
as well as nested Arguments structures. 
Accessing Properties and Parameters with GetValue
CTI OS makes extensive use of generic data abstraction. The CTI OS CIL objects, as well as the 
Arguments structure, store all data by key-value pair. Properties and data values in CTI OS are accessible 
through a generic mechanism called GetValue. For a list of the different GetValue methods, see 
 The GetValue mechanism provides for the 
retrieval of any data element based on its name. This enables the future enhancement of the data set 
provided for event parameters and object properties without requiring any interface changes to support 
new parameters or properties. GetValue supports use of string keywords, as shown in the following 
examples:
// C++
string sAgentID;
args.GetValueString(“AgentID”, &sAgentID);
‘Visual Basic
Dim sAgentID As String
sAgentID = args.GetValueString “AgentID”
//Java
String  sID     = args.GetValueString(CtiOs_IkeywordIDs.CTIOS_AGENTID);
Integer IPeriph = args.GetValueIntObj(CtiOs_IkeywordIDs.CTIOS_PERIPHERALID);
if (IPeriph == null)
// Error accessing Peripheral ID! Handle Error here
else
iPeriph = IPeriph.intValue();
CTI OS defines a set of well-known keywords for event parameters and properties. The well-known 
keywords are of type string and are listed throughout this document with the methods and events for 
which they are valid. The complete set of valid keywords are listed in the C++ header file, 
ctioskeywords.h, and are provided in the COM (Visual Basic) type library as well. Java CIL keywords 
are listed in the Javadoc in the description of the CtiOs_IKeywordIDs interface.
Setting Object Properties and Request Parameters with SetValue
The CIL also provides an extensible mechanism to set properties on CTI OS Client Interface Objects. 
The SetValue mechanism, available on the CIL Interface Objects (as well as the CTI OS Arguments 
class), enables setting properties of any known type to the object as a key-value pair. 
SetValue, similar to GetValue and AddItem, supports string keywords and enumerated names:
// C++
Agent a;
a.SetValue(“AgentID”, “22866”);
a.SetValue(CTIOS_AGENTID, “22866”); // alternative