hp.opencall.media.ccapi
Interface TrunkLeg


public interface TrunkLeg

This interface allows the application (oclet) to access information about a trunk leg, e.g. calling and called addresses, etc.. A trunk leg represents the connection of a CallParty to the telephony network.

Since:
OCMP 2.0

Field Summary
static int ALERTING
          The trunk is alerting (ringing) at the remote end
static int BLIND_TRANSFER
          The trunk has been disconnected, this is the final state
static int CONNECTED
          The trunk is connected
static int DISCONNECTED
          The trunk has been disconnected, this is the final state
static int IDLE
          The trunk is in its initial state
static int INPROGRESS
          The trunk is being connected by the network
 
Method Summary
 void connectCall()
          Causes the trunk leg to connect the call associated with it.
 Address getCalledAddress()
          Deprecated. Replaced by getCallSpec() and CallSpec.getCalledAddress()
 Address getCallerAddress()
          Deprecated. Replaced by getCallSpec() and CallSpec.getCallingAddress()
 CallSpec getCallSpec()
          Returns the CallSpec associated to the trunk leg.
 BasicConnection getConnectionIF()
          get a BasicConnection proxy object to access or manage the call signalling getConnection() is equivalent to getConnection(ConnectionIF.class)
 Object getConnectionIF(Class aClass)
          get a proxy object to access or manage the call signalling
 Object getConnectionIF(Class[] aInterTab)
          get a proxy object to access or manage the call signalling
 int getState()
          Returns the state of the trunk leg.
 String getStateString()
          Returns the state of the trunk leg as a string.
 String getStateString(int aState)
          Returns the given state as a string.
 void hold()
          Causes the trunk leg to hold the current call.
 void receiveCall()
          Causes the trunk leg to validate the call associated with it.
 void resume()
          Causes the trunk leg to hold the current call.
 void sendMessage()
          The Signalling Message will be takeb from the corresponding SignallingInfo subclasses
 void setTrunkLegListener(TrunkLegEventListener aListener)
           
 void setTrunkLegListener(TrunkLegListener aListener)
          Sets aListener as an event listener for trunk leg state changes.
 void transfer(int XferType, String transferTarget)
           
 

Field Detail

IDLE

public static final int IDLE
The trunk is in its initial state.*

See Also:
Constant Field Values

INPROGRESS

public static final int INPROGRESS
The trunk is being connected by the network. *

See Also:
Constant Field Values

ALERTING

public static final int ALERTING
The trunk is alerting (ringing) at the remote end. *

See Also:
Constant Field Values

CONNECTED

public static final int CONNECTED
The trunk is connected. *

See Also:
Constant Field Values

DISCONNECTED

public static final int DISCONNECTED
The trunk has been disconnected, this is the final state. *

See Also:
Constant Field Values

BLIND_TRANSFER

public static final int BLIND_TRANSFER
The trunk has been disconnected, this is the final state. *

See Also:
Constant Field Values
Method Detail

getCalledAddress

public Address getCalledAddress()
Deprecated. Replaced by getCallSpec() and CallSpec.getCalledAddress()

Returns:
hp.opencall.media.common.Address

getCallerAddress

public Address getCallerAddress()
Deprecated. Replaced by getCallSpec() and CallSpec.getCallingAddress()

Returns:
hp.opencall.media.common.Address

getState

public int getState()
Returns the state of the trunk leg.

Returns:
int

getStateString

public String getStateString()
Returns the state of the trunk leg as a string.

Returns:
java.lang.String

getStateString

public String getStateString(int aState)
Returns the given state as a string.

Parameters:
aState -
Returns:
java.lang.String

connectCall

public void connectCall()
                 throws AccessControlException
Causes the trunk leg to connect the call associated with it.

The call can be an incoming or outgoing call.
When an incoming call is received from the telephony network (setup message) and passed to the application (oclet) via a session (see CCSession), the call has to be connected locally by the application by invoking this method.
This causes the platform to send the appropriate signalling message (connect) to the remote party over the telephony network.

For outgoing calls, this causes the trunk leg to establish a call with the remote party.
This causes the platform to send the appropriate signalling message (setup) over the telephony network.

This method call is asynchronous. When the call is established, the trunk leg goes to the CONNECTED state. This state change can be detected by a TrunkLegListener.

Throws:
AccessControlException

receiveCall

public void receiveCall()
                 throws AccessControlException
Causes the trunk leg to validate the call associated with it.

The call must be an incoming call.
When the call is received from the telephony network (setup message) and passed to the application (oclet) via a session (see CCSession), the call has to be validated locally by the application by invoking this method.
This causes the platform to send the appropriate signalling message (Address Compete Message - ACM in case of ISUP) to the remote party over the telephony network.

This method call is asynchronous. It doesn't changes the state of the call.

Throws:
AccessControlException

getConnectionIF

public BasicConnection getConnectionIF()
                                throws AccessControlException
get a BasicConnection proxy object to access or manage the call signalling

getConnection() is equivalent to getConnection(ConnectionIF.class)

Returns:
hp.opencall.media.ccapi.BasicConnection
Throws:
AccessControlException

getConnectionIF

public Object getConnectionIF(Class aClass)
                       throws AccessControlException,
                              CCBadParamsException
get a proxy object to access or manage the call signalling

Parameters:
aClass -
Returns:
java.lang.Object
Throws:
AccessControlException
CCBadParamsException

hold

public void hold()
          throws AccessControlException
Causes the trunk leg to hold the current call. This causes the platform to send the appropriate signalling message (connect) to the remote party over the telephony network. This method call is asynchronous. When the call is held, the trunk leg goes to the HELD state. Holding a SIP call correspond to hold the remote party (he will not be able to speak, but still be able to listen). TunkLeg must be connected before calling this method. This state change can be detected by a TrunkLegListener.

Throws:
an - AccessControlException if not supported by current implementation or called in a bad state.
AccessControlException

resume

public void resume()
            throws AccessControlException
Causes the trunk leg to hold the current call. This causes the platform to send the appropriate signalling message (connect) to the remote party over the telephony network. This method call is asynchronous. When the call is resumed, the trunk leg goes to the CONNECTED state. TunkLeg must be held before calling this method. This state change can be detected by a TrunkLegListener.

Throws:
an - AccessControlException if not supported by current implementation or called in a bad state.
AccessControlException

transfer

public void transfer(int XferType,
                     String transferTarget)
              throws AccessControlException
Throws:
an - AccessControlException if not supported by current implementation or called in a bad state.
AccessControlException

getCallSpec

public CallSpec getCallSpec()
Returns the CallSpec associated to the trunk leg.

Returns:
hp.opencall.media.ccapi.CallSpec

setTrunkLegListener

public void setTrunkLegListener(TrunkLegListener aListener)
Sets aListener as an event listener for trunk leg state changes.

Only supports one listener at a time. Some uses case may be send severals times the same state (SIP call with RE-INVITE while connection established), but with some oclets this might cause probleme if it was not written to receive several time a state CONNECTED. By default if aListener isinstanceof TrunkLegListener state change notification will be send once, but if aListener isinstanceof HoldableTrunkLegListener or TransferableConnectionListener notifications can be send several time to signal that a change in the Connection have been done.

Parameters:
aListener -

setTrunkLegListener

public void setTrunkLegListener(TrunkLegEventListener aListener)
Parameters:
aListener -

getConnectionIF

public Object getConnectionIF(Class[] aInterTab)
                       throws AccessControlException,
                              CCBadParamsException
get a proxy object to access or manage the call signalling

Parameters:
aInterTab -
Returns:
java.lang.Object
Throws:
AccessControlException
CCBadParamsException

sendMessage

public void sendMessage()
                 throws AccessControlException
The Signalling Message will be takeb from the corresponding SignallingInfo subclasses

Throws:
AccessControlException