Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide
4-22
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 7.5(1)
Chapter 4 Building Your Application
Connecting to the CTI OS Server
The following line shows this in
Java:
int returnCode = session.Connect(rArgs);
For more information on the possible values and meanings of the int value returned by the Connect()
method in the Java CIL, see page 4-22.
method in the Java CIL, see page 4-22.
When successful, the Connect() method generates the OnConnection() event. Code within the
OnConnection() event should set the connection mode, as described in the next section.
OnConnection() event should set the connection mode, as described in the next section.
Dealing with Connection Failures
This section contains the following information:
•
•
•
•
Also see
Connection Failure Events
If the Connect() method does not succeed, one of the following events is generated:
•
OnConnectionRejected() event indicates that an unsupported version mismatch has been found.
•
OnCTIOSFailure() indicates that the CTI OS Server requested in the Connect() method is down. If
an OnConnectionFailure() event is generated, the application is in Failover and the CIL continues
to attempt to connect until the connection succeeds or until the application calls Disconnect(). The
Arguments parameter for the event includes the following keywords:
an OnConnectionFailure() event is generated, the application is in Failover and the CIL continues
to attempt to connect until the connection succeeds or until the application calls Disconnect(). The
Arguments parameter for the event includes the following keywords:
–
FailureCode
–
SystemEventID
–
SystemEventArg1
–
ErrorMessage
For more information on the contents of the OnConnectionFailure() event, see the description in
Chapter 6.
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.
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.
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.
method. The connection failed. No events are fired.