Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-22
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4      Building Your Application
Connecting to the CTI OS Server
  –
SystemEventID
  –
SystemEventArg1
  –
ErrorMessage
For more information on the contents of the OnConnectionFailure() event, see the description in 
Chapter 6.
Connection Attempt Error Codes in Java and .NET CIL
The following field values may 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 will either fire the 
OnConnection() event to indicate that the CIL successfully connected or will fire the 
OnConnectionFailure() event and go into failover mode. If the latter occurs, the CIL will continue 
to attempt to connect, alternating between hosts CTIOS_CTIOSA and CTIOS_CTIOSB, until the 
connection succeeds, at which point the CIL will fire 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 will fire an OnConnection() event indicating that the previous Connect() 
method has 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 should 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 IPCC Enterprise environment, you can configure the agent to 
automatically log in again 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-29.