Cisco Cisco Computer Telephony Integration Option 9.0 開発者ガイド

ページ / 640
 
4-31
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.0(0)
 
Chapter 4      Building Your Application
Connecting to the CTI OS Server
The following example demonstrates this task in 
Java:
/* 1. Create Arguments object.*/
Arguments rArgs = new Arguments();
/* 2. Set Connection values.*/
rArgs.SetValue(CTIOS_enums.CTIOS_CTIOSA, “CTIOSServerA”);
rArgs.SetValue(CTIOS_enums.CTIOS_PORTA, 42408);
rArgs.SetValue(CTIOS_enums.CTIOS_CTIOSB, “CTIOSServerB”);
rArgs.SetValue(CTIOS_enums.CTIOS_PORTB, 42408);
rArgs.SetValue(CTIOS_enums.CTIOS_HEARTBEAT, 100);
Note
The Arguments.setValue() methods return a boolean value to indicate whether 
the method succeeded (true) or not (false).
How to Connect the Session to the CTI OS Server
After you successfully create the Session instance, you must connect it to the CTI 
OS Server using the Session.Connect() method, using the Arguments instance you 
constructed when setting connection parameters, as described in the previous 
section.
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-32.
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.
Dealing with Connection Failures
This section contains the following information:
  •
  •
  •