org.siprop.v2.stack.sip.transaction.impl
Class InviteClientTransaction

java.lang.Object
  extended by org.siprop.v2.stack.sip.transaction.impl.InviteClientTransaction
All Implemented Interfaces:
TransactionEntry

public class InviteClientTransaction
extends java.lang.Object
implements TransactionEntry

The state machine for INVITE Client Transaction
According to RFC3261 Figure 5: INVITE client transaction

                                |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|<--------------+
                          |           |
                          +-----------+
 

Author:
masaxmasa

Constructor Summary
InviteClientTransaction(TransactionController parent, boolean isReliable)
          Constructor.
 
Method Summary
 Context createACK(Context response, gov.nist.javax.sip.message.SIPRequest origReq)
          create SIP ACK request message from SIP response message and original SIP request messsage
 void doProcess(Context context)
          Process transaction, if need.
 void fireTimer()
          The timer is expired, then start expired process
 TransactionController getParentTransaction()
          Get parent Transaction object of this entry
 TransactionInfo getTransactionInfo()
          get TransactionInfo.
 TransactionState getTransactionState()
          Get current transaction status
 TransactionType getTransactionType()
          Get type of transaction
 boolean isTimerExpired(long currentTime)
          Check the timer is expired or not.
 void onError()
          An error is happend, then start error handling process
 void setTransactionInfo(TransactionInfo transactionInfo)
          set TransactionInfo.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InviteClientTransaction

public InviteClientTransaction(TransactionController parent,
                               boolean isReliable)
Constructor. Set Initial Transation State

Parameters:
isReliable - Using reliable transport or not.
Method Detail

doProcess

public void doProcess(Context context)
Description copied from interface: TransactionEntry
Process transaction, if need.

Specified by:
doProcess in interface TransactionEntry

fireTimer

public void fireTimer()
Description copied from interface: TransactionEntry
The timer is expired, then start expired process

Specified by:
fireTimer in interface TransactionEntry

onError

public void onError()
Description copied from interface: TransactionEntry
An error is happend, then start error handling process

Specified by:
onError in interface TransactionEntry

isTimerExpired

public boolean isTimerExpired(long currentTime)
Description copied from interface: TransactionEntry
Check the timer is expired or not.

Specified by:
isTimerExpired in interface TransactionEntry
Parameters:
currentTime - Current Time (msec)
Returns:
true: The timer is expired, false: The timer isn't expired

getTransactionState

public TransactionState getTransactionState()
Description copied from interface: TransactionEntry
Get current transaction status

Specified by:
getTransactionState in interface TransactionEntry
Returns:
current transaction status

getTransactionType

public TransactionType getTransactionType()
Description copied from interface: TransactionEntry
Get type of transaction

Specified by:
getTransactionType in interface TransactionEntry

getParentTransaction

public TransactionController getParentTransaction()
Description copied from interface: TransactionEntry
Get parent Transaction object of this entry

Specified by:
getParentTransaction in interface TransactionEntry

createACK

public Context createACK(Context response,
                         gov.nist.javax.sip.message.SIPRequest origReq)
                  throws SIPropException
create SIP ACK request message from SIP response message and original SIP request messsage

Parameters:
response - SIP response message
origReq - the original SIP Request message
Returns:
SIP ACK request message
Throws:
SIPropException

getTransactionInfo

public TransactionInfo getTransactionInfo()
Description copied from interface: TransactionEntry
get TransactionInfo.

Specified by:
getTransactionInfo in interface TransactionEntry
Returns:
transaction information

setTransactionInfo

public void setTransactionInfo(TransactionInfo transactionInfo)
Description copied from interface: TransactionEntry
set TransactionInfo.

Specified by:
setTransactionInfo in interface TransactionEntry