Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 490
   
3-8
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 3      CIL Coding Conventions
Generic Interfaces
ErrorCode = pCall.Answer
If ErrorCode = CIL_FAILED
Debug.print “An error has occurred.”
The complete set of HRESULT values is defined by Microsoft in the header file winerror.h. The most 
common HRESULT values that CTI OS developers see are listed in 
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 
is an Arguments array containing the actual parameters needed. Therefore, parameters can 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
Table 3-3
COM Error Codes
COM Error Code
Numeric Value
Description
S_OK
0x00000000
The method succeeded.
S_FALSE
0x00000001
The method succeeded, but something 
unusual happened.
E_FAILED
0x80000008
The method failed.
REG_DB_E_ 
CLASSNOTREG
0x80040143
The class was not found in the registry. 
You will need to run regsvr32.exe on the 
DLL file to register it.