Cisco Cisco Computer Telephony Integration OS 8.5 Guía Del Desarrollador
3-8
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 7.5(1)
Chapter 3 CIL Coding Conventions
Generic Interfaces
will work with future versions without requiring any code changes on the client’s side (except to take
advantage of new features). For example, CTI OS will automatically send a new parameter in the
Arguments array for an event, without requiring an interface or library code change. The dilemma of
creating a generic interface is solved by using generic mechanisms to send parameters with events and
request, and to access properties.
advantage of new features). For example, CTI OS will automatically send a new parameter in the
Arguments array for an event, without requiring an interface or library code change. The dilemma of
creating a generic interface is solved by using generic mechanisms to send parameters with events and
request, and to access properties.
Arguments
The CTI OS developer’s toolkit makes extensive use of a new data structure (class) called Arguments.
Arguments is a structure of key-value pairs that supports a variable number of parameters and accepts
any user-defined parameter names. For any given event, the arguments structure allows the CTI OS
Server to send the CIL any new parameters without requiring client side changes. Similarly, for any
request, the programmer can send any new parameters, without any changes to the underlying layers.
Arguments is a structure of key-value pairs that supports a variable number of parameters and accepts
any user-defined parameter names. For any given event, the arguments structure allows the CTI OS
Server to send the CIL any new parameters without requiring client side changes. Similarly, for any
request, the programmer can send any new parameters, without any changes to the underlying layers.
Example of using Arguments in a Visual Basic MakeCall request:
Dim args As New Arguments
args.AddItem "DialedNumber", dialthis.Text
If Not 0 = Len(callvar1.Text) Then
' set callvar1
args.AddItem "CallVariable1", callvar1.Text
End If
' send makecall request
m_Agent.MakeCall args, errorcode
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.
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
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
or
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:
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