Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 506
   
3-2
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(1)
Chapter 3      CIL Coding Conventions
Asynchronous Program Execution
SHORT: A 16-bit wide short integer. 
UNSIGNED SHORT: A 16-bit wide unsigned short integer. 
BOOL: A logical true or false variable. Different implementations will use variables of different 
sizes to represent this type. In COM, the VARIANT_BOOL is used. Tests of variables of this data 
type must be against VARIANT_TRUE and VARIANT_FALSE and not simply against 0 or 1.
ARGUMENTS: A custom data structure used by CTI OS, which holds a variable-length set of 
key-value pairs.
ARG: An individual element (value), which can be stored in an ARGUMENTS structure.
 describes the appropriate language specific types to which the documented type are associated.
Asynchronous Program Execution 
Synchronous execution is the most common programming approach used by most applications. In a 
synchronous execution mode, a method call will execute all of the code required to complete the request 
and provide return values as well as error codes. Client-server programming can be synchronous (the 
client application will make a blocking request and will continue execution when the request is 
completed) or asynchronous (the client application makes a request, and continues processing 
immediately, with the result of the request to follow at a later time). 
CTI programming is unique in that requests are often serviced by third-party servers or applications, 
such as a PBX/ACD in the contact center. The asynchronous nature of CTI programming requires 
developers to note the distinction between an error code and the response to a request. In non-CTI 
programming, developers test the error codes (return values from method calls) to determine whether a 
method request succeeded or failed. However, in a distributed architecture such as CTI OS, success or 
failure is often determined by some external server or component such as the PBX/ACD. 
The CTI OS Client Interface Library API specifies error codes, which are return values for method calls. 
These error codes relate to the success or failure of the method call, but not the success or failure of the 
underlying operation. By the success of the method call, we mean that the parameters sent were of the 
correct format, that internal memory allocations were successful, and that the request was put on the send 
queue to be transmitted to the CTI OS Server. Generally, the CIL error code returned from method calls 
will be 
CIL_OK, indicating that the method call was made successfully. However, this does not indicate 
that the request was actually serviced by the CTI OS Server or successfully completed at the PBX/ACD. 
Table 3-1
CTI OS CIL Data Type
Documented 
Data Type
STRING
INT
UNSIGNED 
INT
SHORT
UNSIGNED 
SHORT
BOOL
ARGUMENTS
ARG
C++ Type
std::string 
or 
const char 
long
or 
int
unsigned int
short
unsigned 
short
bool
Arguments
Arg
Visual Basic 
6.0 Type
String
Long
None
Integer
Integer
Boolean
Arguments
Arg
COM Type
BSTR
long
or 
int
unsigned int
short
unsigned 
short
VARIANT
_BOOL
IArguments *
IArg*
Java Type
String
int
long
short
int
Boolean
Arguments
Arg
.NET Type
System.String System
.Int32
System.Int64
System.Int16
System.Int32
System.
Boolean
Arguments
Arg