A Connection represents a link between a Call object and an Address object. There are two types of Connection objects in the IBM CallPath Enterprise Toolkit for Java:
The Connection/CallControlConnection type of Connection object implements the core Connection interface (included in the javax.telephony package) and the CallControlConnection interface (included in the javax.telephony.callcontrol package).
The Connection/ACDConnection type of Connection object implements the core Connection interface (included in the javax.telephony package) and the ACDConnection interface (included in the javax.telephony.callcenter package). This type of Connection is always associated with an ACDAddress.
Both types of connections can be returned by the Call .getConnections() method, as well as other methods that return Connection objects. To determine if a Connection object is of the Connection/CallControlConnection type or the Connection/ACDConnection type, an application can use the "instanceof" Java operator. The application then appropriately casts the object to any of the interfaces that object supports.
Table 14, Table 15, and Table 16 list the methods (and provide comments about those methods, where appropriate) included in the core Connection class, the CallControlConnection class, and the ACDConnection class, respectively:
Table 14. javax.telephony.Connection methods
| Method | Comments |
|---|---|
|
void disconnect()
|
|
|
Address getAddress()
|
|
|
Call getCall()
|
|
|
ConnectionCapabilities getCapabilities()
| Returns only the default ConnectionCapabilities. |
|
ConnectionCapabilities getConnectionCapabilities(Terminal,
Address)
| Deprecated. Returns only the default ConnectionCapabilities. |
|
int getState()
| See Table 17 for a list of supported states. |
|
TerminalConnection[] getTerminalConnections()
|
|
Table 15. javax.telephony.callcontrol.CallControlConnection methods
| Method | Comments |
|---|---|
|
void accept()
| This method is not supported. It throws MethodNotSupportedException. |
|
void addToAddress(String)
| This method is not supported. It throws MethodNotSupportedException. |
|
int getCallControlState()
| See Table 18 for a list of supported states. |
|
Connection park(String)
| This method is not supported. It throws MethodNotSupportedException. |
|
Connection redirect(String)
| This method is not supported. It throws MethodNotSupportedException. |
|
void reject()
| This method is not supported. It throws MethodNotSupportedException. |
Table 16. javax.telephony.callcenter.ACDConnection method
| Method | Comments |
|---|---|
|
ACDManagerConnection getACDManagerConnection()
| This method is not supported. It throws MethodNotSupportedException. |
For more information, refer to the JavaSoft JTAPI 1.2 documentation.
Connection objects always have states associated with them. There are different Connection states, each of which identify a specific stage in the Call and Address relationship. For example, the Connection is in the ALERTING state when there is an incoming call to an Address. When the Address is actively part of a telephone call, the Connection state becomes CONNECTED.
The Connection/CallControlConnection type of Connection object has both a core state and a CallControl state. The Connection/ACDConnection only has a core state.
Table 17 and Table 18 list all the states (and provide comments
about those states, where appropriate) for the core Connection class and the
CallControl Connection class, respectively:
Table 17. javax.telephony.Connection states
| State | Comments |
|---|---|
|
Connection.IDLE
|
|
|
Connection.DISCONNECTED
|
|
|
Connection.INPROGRESS
|
|
|
Connection.ALERTING
|
|
|
Connection.CONNECTED
|
|
|
Connection.UNKNOWN
|
|
|
Connection.FAILED
|
|
Table 18. javax.telephony.callcontrol.CallControlConnection states
| States | Comments |
|---|---|
|
CallControlConnection.IDLE
|
|
|
CallControlConnection.OFFERED
|
|
|
CallControlConnection.QUEUED
|
|
|
CallControlConnection.NETWORK_REACHED
|
|
|
CallControlConnection.NETWORK_ALERTING
|
|
|
CallControlConnection.ALERTING
|
|
|
CallControlConnection.INITIATED
|
|
|
CallControlConnection.DIALING
| State not supported. |
|
CallControlConnection.ESTABLISHED
|
|
|
CallControlConnection.DISCONNECTED
|
|
|
CallControlConnection.FAILED
|
|
|
CallControlConnection.UNKNOWN
|
|
When a JTAPI application decides to end a Connection, it invokes Connection.disconnect() on one of the Connections associated with the call (it can be either Connection, there is no concept of originating or terminating Connections in JTAPI).
In many environments, implementations may limit the application's ability to disconnect every Connection in the call, based on the user's permissions. Many JTAPI applications invoke canDisconnect() to make sure they are disconnecting the correct connection.
Connection.disconnect() advances the Connection's state to DISCONNECTED and advances the state of all TerminalConnections associated with this Connection to DROPPED. When Connection.disconnect() returns control to the application, this action is complete. The application can then ignore events associated with this invocation of this method.