The Java CTICisco Application Programming Interface

The Java CTICisco Application Programming Interface (API) is accessed through the Java class CTICiscoICM. To access a Java environment from which to call the methods, it is necessary to use the eventToCode bean. A DTConnectionItem is needed for the call.

By carrying out a getConnectionItem() method on the actionStatusEvent object, this will return a ConnectionItem object, which needs to be cast to a DTConnectionItem. The DTConnectionItem is passed into this environment to create a new CTICiscoICM object. The CTICiscoICM object is then used to call the required methods. Here is some example code for a DTConnectionItem:
DTConnectionItem myConnectionItem = (DTConnectionItem) myActionStatusEvent.getConnectionItem(); 
Note: Unlike a state table application, it is not necessary to obtain a CallID or DialogueID when interacting with the ICM.
Here is an example of how a new CiscoICM object is created:
CTICiscoICM icm = new CTICiscoICM (myConnectionItem);
CTICiscoReturn ret;
// Issue an 'eventReport' to the ICM
Integer MyEventCode = New Integer(7); // An example eventCode to use
ret = icm.eventReport (MyEventCode, null);
// NOTE: Passing in 'null' for optional parms if not required
// Check the returned status equals zero
Integer Status = ret.getStatus();
if (!(Status.equals (New Integer(0)))) {
  // Something has gone wrong! Return the value of status
  return Status;
}
// Continue with next Cisco method.....