Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 668
 
3-11
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1)
 
Chapter 3      CIL Coding Conventions
Generic Interfaces
Generic Interfaces 
One of the main design goals of CTI OS was to enable future enhancements to the 
CTI OS feature set without breaking existing interfaces. To accomplish this, a 
parameter for almost every method and event will be an Arguments array 
containing the actual parameters needed. Therefore, parameters may be added or 
deleted in future versions without affecting the signature of the method or event. 
This provides the benefit to developers that code developed to work with one 
version of the CTI OS developer’s toolkit 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. 
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.
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”);