NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.stack
Class SIPClientTransaction

java.lang.Object
  |
  +--gov.nist.javax.sip.stack.MessageChannel
        |
        +--gov.nist.javax.sip.stack.SIPTransaction
              |
              +--gov.nist.javax.sip.stack.SIPClientTransaction
All Implemented Interfaces:
ClientTransaction, SIPServerResponseInterface, Transaction

public class SIPClientTransaction
extends SIPTransaction
implements SIPServerResponseInterface, ClientTransaction

Represents a client transaction.

Version:
JAIN-SIP-1.1 This code is in the public domain.

 Implements the following state machines. (From RFC 3261)

                               |INVITE from TU
             Timer A fires     |INVITE sent
             Reset A,          V                      Timer B fires
             INVITE sent +-----------+                or Transport Err.
               +---------|           |---------------+inform TU
               |         |  Calling  |               |
               +-------->|           |-------------->|
                         +-----------+ 2xx           |
                            |  |       2xx to TU     |
                            |  |1xx                  |
    300-699 +---------------+  |1xx to TU            |
   ACK sent |                  |                     |
resp. to TU |  1xx             V                     |
            |  1xx to TU  -----------+               |
            |  +---------|           |               |
            |  |         |Proceeding |-------------->|
            |  +-------->|           | 2xx           |
            |            +-----------+ 2xx to TU     |
            |       300-699    |                     |
            |       ACK sent,  |                     |
            |       resp. to TU|                     |
            |                  |                     |      NOTE:
            |  300-699         V                     |
            |  ACK sent  +-----------+Transport Err. |  transitions
            |  +---------|           |Inform TU      |  labeled with
            |  |         | Completed |-------------->|  the event
            |  +-------->|           |               |  over the action
            |            +-----------+               |  to take
            |              ^   |                     |
            |              |   | Timer D fires       |
            +--------------+   | -                   |
                               |                     |
                               V                     |
                         +-----------+               |
                         |           |               |
                         | Terminated|<--------------+
                         |           |
                         +-----------+

                 Figure 5: INVITE client transaction


                                   |Request from TU
                                   |send request
               Timer E             V
               send request  +-----------+
                   +---------|           |-------------------+
                   |         |  Trying   |  Timer F          |
                   +-------->|           |  or Transport Err.|
                             +-----------+  inform TU        |
                200-699         |  |                         |
                resp. to TU     |  |1xx                      |
                +---------------+  |resp. to TU              |
                |                  |                         |
                |   Timer E        V       Timer F           |
                |   send req +-----------+ or Transport Err. |
                |  +---------|           | inform TU         |
                |  |         |Proceeding |------------------>|
                |  +-------->|           |-----+             |
                |            +-----------+     |1xx          |
                |              |      ^        |resp to TU   |
                | 200-699      |      +--------+             |
                | resp. to TU  |                             |
                |              |                             |
                |              V                             |
                |            +-----------+                   |
                |            |           |                   |
                |            | Completed |                   |
                |            |           |                   |
                |            +-----------+                   |
                |              ^   |                         |
                |              |   | Timer K                 |
                +--------------+   | -                       |
                                   |                         |
                                   V                         |
             NOTE:           +-----------+                   |
                             |           |                   |
         transitions         | Terminated|<------------------+
         labeled with        |           |
         the event           +-----------+
         over the action
         to take

                 Figure 6: non-INVITE client transaction


Author:
Jeff Keyser, M. Ranganathan (Modified Jeff's code and aligned with JAIN SIP 1.1)

Field Summary
 
Fields inherited from class gov.nist.javax.sip.stack.SIPTransaction
CALLING_STATE, COMPLETED_STATE, CONFIRMED_STATE, INITIAL_STATE, PROCEEDING_STATE, TERMINATED_STATE, TRYING_STATE
 
Method Summary
 Via getOutgoingViaHeader()
          get the via header for an outgoing request.
 String getProcessingInfo()
          Get auxiliary information that is generated while logging for the purpose of writing out the log file.
 MessageChannel getRequestChannel()
          Returns this transaction.
 String getViaHost()
          Get the host of the recipient.
 int getViaPort()
          Get the port of the recipient.
 boolean isMessagePartOfTransaction(gov.nist.javax.sip.message.SIPMessage messageToTest)
          Deterines if the message is a part of this transaction.
 boolean isSecure()
          Return true if this is a secure channel.
 void processResponse(gov.nist.javax.sip.message.SIPResponse transactionResponse, MessageChannel sourceChannel)
          Process a new response message through this transaction.
 void sendMessage(gov.nist.javax.sip.message.SIPMessage messageToSend)
          Send a request message through this transaction and onto the client.
 void setResponseInterface(SIPServerResponseInterface newRespondTo)
          Sets the real ResponseInterface this transaction encapsulates.
 
Methods inherited from class gov.nist.javax.sip.stack.SIPTransaction
addEventListener, close, doesCancelMatchTransaction, getBranch, getBranchId, getDialog, getHost, getKey, getLastResponse, getMessageChannel, getOriginalRequest, getPeerAddress, getPeerName, getPeerPort, getPort, getRequest, getResponse, getRetransmitTimer, getSIPStack, getState, getTransactionId, getTransport, getUser, getViaHeader, getWrapper, handleException, isReliable, removeEventListener, setBranch, setDialog, setOriginalRequest, setRetransmitTimer, setState, setWrapper
 
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel
getHostPort, getKey, getMessageProcessor, getPeerHostPort, getRawIpSourceAddress, getViaHostPort, logResponse, sendMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sip.Transaction
getBranchId, getDialog, getRequest, getRetransmitTimer, getState, setRetransmitTimer
 

Method Detail

setResponseInterface

public void setResponseInterface(SIPServerResponseInterface newRespondTo)
Sets the real ResponseInterface this transaction encapsulates.

Parameters:
newRespondTo - ResponseInterface to send messages to.

getProcessingInfo

public String getProcessingInfo()
Description copied from interface: SIPServerResponseInterface
Get auxiliary information that is generated while logging for the purpose of writing out the log file.

Specified by:
getProcessingInfo in interface SIPServerResponseInterface

getRequestChannel

public MessageChannel getRequestChannel()
Returns this transaction.

Specified by:
getRequestChannel in interface SIPServerResponseInterface
Returns:
the MessageChannel through which you can send a new request to the responder.

isMessagePartOfTransaction

public boolean isMessagePartOfTransaction(gov.nist.javax.sip.message.SIPMessage messageToTest)
Deterines if the message is a part of this transaction.

Specified by:
isMessagePartOfTransaction in class SIPTransaction
Parameters:
messageToTest - Message to check if it is part of this transaction.
Returns:
True if the message is part of this transaction, false if not.

sendMessage

public void sendMessage(gov.nist.javax.sip.message.SIPMessage messageToSend)
                 throws IOException
Send a request message through this transaction and onto the client.

Specified by:
sendMessage in class SIPTransaction
Parameters:
messageToSend - Request to process and send.
IOException

processResponse

public void processResponse(gov.nist.javax.sip.message.SIPResponse transactionResponse,
                            MessageChannel sourceChannel)
                     throws SIPServerException
Process a new response message through this transaction. If necessary, this message will also be passed onto the TU.

Specified by:
processResponse in interface SIPServerResponseInterface
Parameters:
transactionResponse - Response to process.
sourceChannel - Channel that received this message.
Throws:
SIPServerException - Exception that gets thrown by this processor when an exception is encountered in the message processing.

getViaPort

public int getViaPort()
Get the port of the recipient.

Overrides:
getViaPort in class SIPTransaction

getViaHost

public String getViaHost()
Get the host of the recipient.

Overrides:
getViaHost in class SIPTransaction

getOutgoingViaHeader

public Via getOutgoingViaHeader()
get the via header for an outgoing request.


isSecure

public boolean isSecure()
Description copied from class: MessageChannel
Return true if this is a secure channel.

Overrides:
isSecure in class SIPTransaction

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.