public class CstaConnection
extends java.lang.Object
A CstaConnection Object must include the following information:
One CstaConnection Object is identified by CallID+DeviceID. These information are updated automatically when a CSTA Event for this Connection is received.
The instance of a CstaConnection object is always stored in the ConnectionList of a CstaMonitor. When a CSTA Event with LocalConnectionInfo=null is received, this CstaConnection becomes null object, and is also removed from the connection list of the Monitor.
The CstaConnection class also provides all the methods that can be performed on a Connection, e.g. AnswerCall, HoldCall, RetrieveCall, etc.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
callID
The CallID in the Connection.
|
CstaCause |
cause
The current Cause of this Connection.
|
CstaCall |
cstaCall
The CstaCall that contains the information of this Connection.
|
CstaDeviceID |
deviceID
The DeviceID in the Connection.
|
CstaLocalConnectionInfo |
localState
LocalConnectionInfo of this Connection.
|
java.lang.String |
relatedCLD
The RelatedCallID in the Connection.
|
CstaServicesPermitted |
servicesPermitted
The servicesPermitted of this Connection.
|
Constructor and Description |
---|
CstaConnection(CstaSystem cstaSystem)
CstaConnection Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
AcceptCall()
Accept the call.
|
boolean |
AcceptCallWithNameProvider(java.lang.String appCallbackName)
Accept the call with Name Provider option.
|
boolean |
AlternateCall(CstaConnection activeConnection)
Alternate the call.
|
boolean |
AnswerCall()
Answer the call.
|
boolean |
AssociateData()
AssociateData without deviceInfo.
|
boolean |
AssociateData(CstaDeviceIdentifier deviceInfo)
AssociateData with deviceInfo.
|
boolean |
AssociateData(CstaDeviceIdentifier deviceInfo,
java.lang.String altDestination)
AssociateData with deviceInfo & altDestination.
|
boolean |
AssociateData(java.lang.String altDestination)
AssociateData with alternate destination.
|
CstaRequestedConnectionInfo |
ChangeConnectionInformation(CstaFlowDirection flowDirection,
java.lang.String mediaSessionInfo)
ChangeConnectionInformation.
|
boolean |
ClearConnection()
Clear the Connection.
|
boolean |
ClearConnection(CstaReason reason)
Clear the Connection.
|
CstaConnection |
ConferenceCall(CstaConnection activeConnection)
Make a Conference Call.
|
CstaConnection |
ConsultationCall(java.lang.String consultedDevice)
ConsultationCall to new Destination with default options.
|
CstaConnection |
ConsultationCall(java.lang.String consultedDevice,
java.lang.String consultOptions,
boolean voice,
boolean image,
boolean im)
Consult Call to new Destination with all options.
|
boolean |
DeflectCall(java.lang.String dest)
Deflect the call to new destination.
|
boolean |
HoldCall()
Hold the current connection.
|
CstaConnection |
JoinCall(java.lang.String joiningDevice,
CstaJoinCallParticipationType type)
Join Call with default options.
|
CstaConnection |
JoinCall(java.lang.String joiningDevice,
CstaJoinCallParticipationType type,
CstaAutoOriginate autoOriginate)
Join Call with all options, autoOriginate as enumeration.
|
CstaConnection |
JoinCall(java.lang.String joiningDevice,
CstaJoinCallParticipationType type,
java.lang.String autoOriginate)
Join Call with all options.
|
boolean |
RetrieveCall()
Retrieve the current connection.
|
CstaConnection |
SingleStepTransfer(java.lang.String newDest)
Single Step Transfer the call to new destination.
|
CstaCall |
SnapshotCall()
Snapshot the Call.
|
CstaCall |
SnapshotCall(boolean silmTag)
Snapshot the Call.
|
CstaConnection |
TransferCall(CstaConnection activeConnection)
Transfer the call.
|
CstaConnection |
TransferToVM(java.lang.String newDest)
Transfer the Call to the destination's Voice Mail.
|
public java.lang.String callID
public CstaDeviceID deviceID
public CstaLocalConnectionInfo localState
public CstaCause cause
public CstaServicesPermitted servicesPermitted
public java.lang.String relatedCLD
public CstaCall cstaCall
public CstaConnection(CstaSystem cstaSystem)
A CstaConnection Object is always instantiated internally by CSTA SDK when a CSTA Event with brand new Connection is received from CSTA Server. This CstaConnection instance is also added to the connection list of CstaMonitor. The Application shall never try to instantiate a new CstaConnection object. The Application is able to retrieve the Connection from a CstaMonitor object.
cstaSystem
- the CstaSystem that is used internally.public boolean HoldCall() throws CstaException
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean RetrieveCall() throws CstaException
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean DeflectCall(java.lang.String dest) throws CstaException
In the scenario that Calling party D1 calls Called party D2, the call C1 is offered or delivered at D2. This Connection D2C1 can be deflected to another device D3. The current Connection D2C1 will become null if the deflection is successful and a DivertedEvent with null localConnectionInfo is received. The new Connection will be D3C1.
dest
- the new Destination D3.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AcceptCall() throws CstaException
With OpenScape Voice Server, when a call to D2 is offered, Application may send AcceptCall request, so the call will be delivered to D2 device immediately.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AcceptCallWithNameProvider(java.lang.String appCallbackName) throws CstaException
With OpenScape Voice Server, when a call to D2 is offered, the application may send AcceptCall request with a provided name. The call will be delivered to D2 device immediately, and the OSV will apply the name provided to the call. The application provided name will be presented in CSTA events and on the phone interface.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AnswerCall() throws CstaException
When D2 is alerting, Application can send AnswerCall request to make the device D2 answer the call automatically. Device D2 must support auto answer, or allow talk event.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean ClearConnection() throws CstaException
A call can be cleared at any time. After the ClearConnection request, the OSV server will try to release the call(tear down all the connections in this call). CSTA Event ConnectionClearedEvent with null LocalConnectionInfo indicate the connection is cleared successfully.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean ClearConnection(CstaReason reason) throws CstaException
A call can be cleared at any time. After the ClearConnection request, the OSV server will try to release the call(tear down all the connections in this call). CSTA Event ConnectionClearedEvent with null LocalConnectionInfo indicate the connection is cleared successfully.
reason
- The reason for the ClearConnection request. Currently only "busy" is supported.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection ConsultationCall(java.lang.String consultedDevice) throws CstaException
D1 is already connected with D2 on call C1. D1 can consults to new Destination D3. If the consultation is successful, D1C1 holds D2 and D2C1 is held. It also results in a new Connection D1C2, so D1 has 2 Connections D1C1 and D1C2. The default options are:
consultedDevice
- D3's number, must be dialable digits.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection ConsultationCall(java.lang.String consultedDevice, java.lang.String consultOptions, boolean voice, boolean image, boolean im) throws CstaException
D1 is already connected with D2 on call C1. D1 can consults to new Destination D3. If the consultation is successful, D1C1 holds D2 and D2C1 is held. It also results in a new Connection D1C2, so D1 has 2 Connections D1C1 and D1C2.
consultedDevice
- D3's number, must be dialable digits.consultOptions
- currently it is defined as String, available options: unrestricted, consultOnly, transferOnly, conferenceOnly.voice
- support voice or not.image
- support image or not.im
- support im or not.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection JoinCall(java.lang.String joiningDevice, CstaJoinCallParticipationType type) throws CstaException
JoiningDevice D3 wants to join a existing D1&D2's call. If the join is successful, D1, D2 and D3 will be in a conference
After Join, the CallID remains the same as original D1&D2's call C1, and it results in 3 Connections, D1C1, D2C1 and D3C1.
joiningDevice
- the device that wants to join, Device D3.type
- the participationType, could be active or silent.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection JoinCall(java.lang.String joiningDevice, CstaJoinCallParticipationType type, java.lang.String autoOriginate) throws CstaException
JoiningDevice D3 wants to join a existing D1&D2's call. If the join is successful, D1, D2 and D3 will be in a conference
After Join, the CallID remains the same as original D1&D2's call C1, and it results in 3 Connections, D1C1, D2C1 and D3C1.
joiningDevice
- the device that wants to join, Device D3type
- the participationType, could be active or silentautoOriginate
- currently is defined as String type, available options: doNotPrompt, promptCstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection JoinCall(java.lang.String joiningDevice, CstaJoinCallParticipationType type, CstaAutoOriginate autoOriginate) throws CstaException
JoiningDevice D3 wants to join a existing D1&D2's call. If the join is successful, D1, D2 and D3 will be in a conference
After Join, the CallID remains the same as original D1&D2's call C1, and it results in 3 Connections, D1C1, D2C1 and D3C1.
joiningDevice
- the device that wants to join, Device D3type
- the participationType, could be active or silentautoOriginate
- defined as enum types: doNotPrompt, prompt.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AlternateCall(CstaConnection activeConnection) throws CstaException
Device D1 must have 2 Connections, one(D1C1) is in hold state, the other(D1C2) is connected. The AlternateCall request can be performed only on the connection that is hold(D1C1). If AlternateCall is successful, this hold connection(D1C1) becomes connected while the other(D1C2) becomes on hold.
activeConnection
- the connection that is in connected state, D1C2.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection TransferCall(CstaConnection activeConnection) throws CstaException
Transferring Device D1 must have 2 Connections, one(D1C1) is in hold state with D2, the other(D1C2) is connected with D3. The TransferCall request can be performed only on the connection that is hold(D1C1). If TransferCall is successful, the 2 connections D1C1 and D1C2 become null, and are removed from D1's CstaMonitor's connection list. Connection D2C1 and D3C2 also become null, replaced by D2C3 and D3C3. The new connection on D3(D3C3) is returned.
activeConnection
- the connection in connected state, D1C2.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection ConferenceCall(CstaConnection activeConnection) throws CstaException
Conferencing Device D1 must have 2 Connections, one(D1C1) is in hold state with D2, the other(D1C2) is connected with D3. The ConferenceCall request can be performed only on the connection that is hold(D1C1). If ConferenceCall is successful, D1, D2 and D3 are in a Conference. D1's original two connections D1C1 and D1C2 become null, and are removed from D1's CstaMonitor's connection list, Connection D1C3 is added. Connection D2C1 and D3C2 also become null, replaced by D2C3 and D3C3. The new connection on D1(D1C3) is returned.
activeConnection
- the connection in connected state, D1C2.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection SingleStepTransfer(java.lang.String newDest) throws CstaException
Transferring Device D1 is connected with D2. Application can send SingleStepTransfer request on behave of D1 to transfer its call to D3. If SingleStepTransfer is successful, D1C1 and D2C1 becomes null. D2 has new Connection D2C3 while D3 has new Connection D3C3. The new connection on D3(D3C3) is returned.
newDest
- the destination D3.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaConnection TransferToVM(java.lang.String newDest) throws CstaException
Transferring Device D1 is connected with D2. D3 has VM feature provisioned, and the VoiceMail device is D4. D1 transfers its call to D3's Voice Mail, so that D2 can leave a message on D4 for D3. If SingleStepTransfer is successful, D1C1 and D2C1 becomes null. D2 has new Connection D2C3 and the new Connection D4C3 is returned.
newDest
- the destination D3 and it must have VM feature provisioned.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaCall SnapshotCall() throws CstaException
It is recommended to the Application that when Application starts.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaCall SnapshotCall(boolean silmTag) throws CstaException
It is recommended to the Application that when Application starts.
silmTag
- true: "SILM" tag will be presented, All Monitored and Monitoring/Recording device information is presented in SnapshotCallResponse
false: No "SILM" tag in request, Only Monitored Device information is presented in SnapshotCallResponse, CSTA SM removes Monitoring/Recording device informationCstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AssociateData() throws CstaException
When an Originated (or Offered) Event has been received on an endpoint monitor, which has Name Provider option active (servicesPermitted = AssociateData), Application can send AssociateData request, with or without deviceInfo, to provide Name Information to the OSV.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AssociateData(CstaDeviceIdentifier deviceInfo) throws CstaException
When an Originated (or Offered) Event has been received on an endpoint monitor, which has Name Provider option active (servicesPermitted = AssociateData), Application can send AssociateData request, with or without deviceInfo, to provide Name Information to the OSV.
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AssociateData(java.lang.String altDestination) throws CstaException
When an Originated (or Offered) Event has been received on an endpoint monitor, which has Name Provider option active (servicesPermitted = AssociateData), Application can send AssociateData request, with or without altDestination, to provide alternate destination data to the OSV.
altDestination
- The alternate destination.CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public boolean AssociateData(CstaDeviceIdentifier deviceInfo, java.lang.String altDestination) throws CstaException
When an Originated (or Offered) Event has been received on an endpoint monitor, which has Name Provider option active (servicesPermitted = AssociateData), Application can send AssociateData request, with or without deviceInfo, to provide Name Information to the OSV.
deviceInfo
- altDestination
- CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.public CstaRequestedConnectionInfo ChangeConnectionInformation(CstaFlowDirection flowDirection, java.lang.String mediaSessionInfo) throws CstaException
ChangeConnectionInformation is used to change the media type of an established call or change the flowDirection/participationType from silent to active in the case where we have a silent monitor session and we want to barge-in the call
CstaException
- An CstaException is thrown if 1) a negative response(e.g. CSTAErrorCode) is received, 2) no response is received within 9 seconds.