org.echarts.servlet.sip.machines
Class B2buaFSM

java.lang.Object
  extended by org.echarts.Machine
      extended by org.echarts.StateMachine
          extended by org.echarts.TransitionMachine
              extended by org.echarts.servlet.sip.machines.B2buaFSM
All Implemented Interfaces:
java.io.Serializable


public class B2buaFSM
extends TransitionMachine

Back-to-back User Agent machine Receives INVITE on BoxPort. Uses optional RequestModifier object to change Request-URI for outgoing INVITE. In CONNECTED state, INFO messages are passed transparently between caller and callee. Similar to the RI/TCK sample B2BUA application (version 1.0.9), there are two unhandled protocol level race conditions: 1) CANCEL to callee and 200 OK to INVITE from callee crossed: (RFC3261 sec 15) Because the container has already sent 487 to caller, the application should send ACK then BYE to callee to terminate the callee side. 2) CANCEL from caller and 200 OK to INVITE to caller crossed: (JSR116 sec 7.2.3) In the case where container receives CANCEL before application tries to send 200 OK to INVITE to caller side, the send() will throw IllegalStateException. This exception should be caught, and the application sends ACK then BYE to callee side to terminate the callee side dialog. See TODO items in this file for places where additional handling should be added.

See Also:
Serialized Form

Field Summary
 TransparentFSM CONNECTED
           
static java.lang.String FAILURE_RESPONSE
           
static java.lang.String PENDING_REQUEST
           
 SipServletRequest pendingAck
          Pending ACK message to be sent on receipt of success response.
static java.lang.String SUCCESS_RESPONSE
           
 
Constructor Summary
B2buaFSM(FeatureBox box, java.util.Properties servletProps, javax.servlet.ServletContext context)
          Used when this FSM is specified as machineClassName by EChartsSipServlet.
B2buaFSM(FeatureBox box, SipPort caller, SipPort callee)
          Used when this FSM is invoked by a parent FSM.
B2buaFSM(FeatureBox box, SipPort caller, SipPort callee, RequestModifier reqModifier)
          Used when this FSM is invoked by a parent FSM.
 
Method Summary
 SipServletResponse getFailureResponse()
          Get received failure response to original INVTE.
 SipServletRequest getPendingRequest()
          Get any pending request that may have been sent.
 SipServletResponse getSuccessResponse()
          Get received success response to original INVTE.
 
Methods inherited from class org.echarts.TransitionMachine
addMessagelessTransition, addMessageTransition, globalStateString, globalStateString, initializeMessagelessTransitions, initializeMessageTransitions, initializeRoot, localStateString, localStateString, removePort, run, run, runNoQueueing
 
Methods inherited from class org.echarts.StateMachine
setMachineDebugging, setMachineMonitor, setMachineMonitoring
 
Methods inherited from class org.echarts.Machine
getDefaultMachineDebugging, getDefaultMachineDebuggingGlobalStateOutput, getDefaultMachineMonitor, getDefaultMachineMonitorFilter, getDefaultMachineMonitoring, getMachineDebugging, getMachineDebuggingGlobalStateOutput, getMachineID, getMachineIndex, getMachineMonitor, getMachineMonitoring, getParentMachine, getRootMachine, getSystemDebugging, getSystemMonitoring, putEvent, setDebugging, setDefaultMachineDebugging, setDefaultMachineDebuggingGlobalStateOutput, setDefaultMachineMonitor, setDefaultMachineMonitorFilter, setDefaultMachineMonitoring, setMachineDebuggingGlobalStateOutput, setSystemDebugging, setSystemMonitoring, statePathString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PENDING_REQUEST

public static final java.lang.String PENDING_REQUEST
See Also:
Constant Field Values

SUCCESS_RESPONSE

public static final java.lang.String SUCCESS_RESPONSE
See Also:
Constant Field Values

FAILURE_RESPONSE

public static final java.lang.String FAILURE_RESPONSE
See Also:
Constant Field Values

pendingAck

public SipServletRequest pendingAck
Pending ACK message to be sent on receipt of success response.


CONNECTED

public TransparentFSM CONNECTED
Constructor Detail

B2buaFSM

public B2buaFSM(FeatureBox box,
                SipPort caller,
                SipPort callee)
         throws java.lang.Exception
Used when this FSM is invoked by a parent FSM. Outgoing requests are based on incoming requests.

Parameters:
box - FeatureBox which contains this Machine
caller - SipPort to be associated with incoming call
callee - SipPort to be associated with outgoing call
Throws:
java.lang.Exception

B2buaFSM

public B2buaFSM(FeatureBox box,
                SipPort caller,
                SipPort callee,
                RequestModifier reqModifier)
         throws java.lang.Exception
Used when this FSM is invoked by a parent FSM. Outgoing requests are based on incoming requests, modified by reqModifier.

Parameters:
box - FeatureBox which contains this Machine
caller - SipPort to be associated with incoming call
callee - SipPort to be associated with outgoing call
reqModifier - contains code for modifying initial request as it is relayed; may be null.
Throws:
java.lang.Exception

B2buaFSM

public B2buaFSM(FeatureBox box,
                java.util.Properties servletProps,
                javax.servlet.ServletContext context)
         throws java.lang.Exception
Used when this FSM is specified as machineClassName by EChartsSipServlet.

Throws:
java.lang.Exception
Method Detail

getPendingRequest

public SipServletRequest getPendingRequest()
Get any pending request that may have been sent. May be null.


getSuccessResponse

public SipServletResponse getSuccessResponse()
Get received success response to original INVTE. May be null.


getFailureResponse

public SipServletResponse getFailureResponse()
Get received failure response to original INVTE. May be null.