Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 490
   
4-23
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 4      Building Your Application
Connecting to the CTI OS Server
Connection Attempt Error Codes in Java and .NET CIL
The following field values can be returned by the Connect() method. See the documentation for the 
CtiOs_Enums.CilError interface in the CIL JavaDoc for information on these fields.
CIL_OK - The connection process has successfully begun. The CIL either fires the OnConnection() 
event to indicate that the CIL successfully connected or fires the OnConnectionFailure() event and 
go into failover mode. If the latter occurs, the CIL continues to attempt to connect, alternating 
between hosts CTIOS_CTIOSA and CTIOS_CTIOSB, until the connection succeeds, at which point 
the CIL fires the OnConnection() event. 
E_CTIOS_INVALID_ARGUMENT - A null Arguments parameter was passed to the Connect() 
method. The connection failed. No events are fired. 
E_CTIOS_MISSING_ARGUMENT - The Arguments parameter did not contain values for both 
CTIOS_CTIOSA and CTIOS_CTIOSB. At least one of these values must be provided. The 
connection failed. No events are fired.
E_CTIOS_IN_FAILOVER - A previous connection attempt failed and the CIL is currently in 
failover and attempting to establish a connection. This continues until a connection is established, 
at which point the CIL fires an OnConnection() event indicating that the previous Connect() method 
succeeded. To attempt to connect again with different parameters, the application must first use the 
Disconnect() method.
E_CTIOS_SESSION_NOT_DISCONNECTED - The Session is not disconnected (i.e. a previous 
Connect() method is in progress, or the Session is already connected). The application must call the 
Disconnect() method before attempting to establish another connection. The CIL may fire an 
OnConnection() event for the to previous call to the Connect() method if the connection was in 
progress, but will not fire one corresponding to this method call. 
E_CTIOS_UNEXPECTED - There was an unanticipated error. The connection failed. No events 
are fired. 
Note
Once the application receives a Connect return code of CIL_OK, it does not call Connect again on that 
session until it receives an OnConnectionClosed event after a call to Disconnect.
Configuring the Agent to Automatically Log In after Failover
If you are using CTI OS in an Unified Contact Center Enterprise (Unified CCE) environment, you can 
configure the agent to automatically relogin in the event of a failover.
To configure the agent to log back in automatically, add the CTIOS_AUTOLOGIN keyword with the 
value “1” to the Arguments instance used to configure the agent:
rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_AUTOLOGIN, “1”);
For more information on logging in an agent, see page 4-30.
Stopping the Failover Procedure
To stop the failover procedure, call the Disconnect(args) method, with the Arguments instance 
containing the CTIOS_FORCEDDISCONNECT keyword as a parameter.