NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.stack
Class SIPTransactionStack

java.lang.Object
  |
  +--gov.nist.javax.sip.stack.SIPStack
        |
        +--gov.nist.javax.sip.stack.SIPTransactionStack
All Implemented Interfaces:
EventListener, SIPTransactionEventListener
Direct Known Subclasses:
SipStackImpl

public abstract class SIPTransactionStack
extends SIPStack
implements SIPTransactionEventListener

Adds a transaction layer to the SIPStack class. This is done by replacing the normal MessageChannels returned by the base class with transaction-aware MessageChannels that encapsulate the original channels and handle the transaction state machine, retransmissions, etc.

Version:
JAIN-SIP-1.1
Author:
Jeff Keyser (original)
M. Ranganathan
(Added Dialog table). This code is in the public domain.

Field Summary
static int BASE_TIMER_INTERVAL
          Number of milliseconds between timer ticks (500).
 
Fields inherited from class gov.nist.javax.sip.stack.SIPStack
DEFAULT_PORT
 
Method Summary
 void addExtensionMethod(String extensionMethod)
          Add an extension method.
 void addTransaction(SIPClientTransaction clientTransaction)
          Add a new client transaction to the set of existing transactions.
 SIPClientTransaction createClientTransaction(MessageChannel encapsulatedMessageChannel)
          Creates a client transaction that encapsulates a MessageChannel.
 DialogImpl createDialog(SIPTransaction transaction)
           
 MessageChannel createMessageChannel(Hop nextHop)
          Creates a client transaction to handle a new request.
 MessageChannel createMessageChannel(MessageChannel rawChannel)
          Create a client transaction from a raw channel.
 MessageChannel createMessageChannel(SIPTransaction transaction)
          Create a client transaction from a raw channel.
 MessageChannel createRawMessageChannel(Hop hop)
          Creates a raw message channel.
 SIPServerTransaction createServerTransaction(MessageChannel encapsulatedMessageChannel)
          Creates a server transaction that encapsulates a MessageChannel.
 SIPTransaction findCancelTransaction(gov.nist.javax.sip.message.SIPRequest cancelRequest, boolean isServer)
          Get the transaction to cancel.
 SIPTransaction findTransaction(gov.nist.javax.sip.message.SIPMessage sipMessage, boolean isServer)
          Find the transaction corresponding to a given request.
 DialogImpl getDialog(String dialogId)
          Return the dialog for a given dialog ID.
 boolean isDialogCreated(String method)
          Return true if extension is supported.
 void putDialog(DialogImpl dialog)
          Put a dialog into the dialog table.
 
Methods inherited from class gov.nist.javax.sip.stack.SIPStack
addMessageProcessor, createMessageProcessor, exportServerLog, getBadMessageLog, getDefaultRoute, getDefaultRouteHeader, getHostAddress, getMessageProcessor, getMessageProcessors, getNextHop, getNextHop, getPort, getRouteHeader, getRouter, getStackFunction, getStackName, isAlive, isTransportEnabled, isTransportEnabled, logBadMessage, removeMessageProcessor, setHostAddress, setMaxConnections, setRouter, setSingleThreaded, setStackMessageFactory, setStackName, setThreadPoolSize, stopStack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nist.javax.sip.stack.SIPTransactionEventListener
transactionErrorEvent
 

Field Detail

BASE_TIMER_INTERVAL

public static final int BASE_TIMER_INTERVAL
Number of milliseconds between timer ticks (500).

See Also:
Constant Field Values
Method Detail

isDialogCreated

public boolean isDialogCreated(String method)
Return true if extension is supported.

Returns:
true if extension is supported and false otherwise.

addExtensionMethod

public void addExtensionMethod(String extensionMethod)
Add an extension method.

Parameters:
extensionMethod - -- extension method to support for dialog creation

putDialog

public void putDialog(DialogImpl dialog)
Put a dialog into the dialog table.

Parameters:
dialog - -- dialog to put into the dialog table.

createDialog

public DialogImpl createDialog(SIPTransaction transaction)

getDialog

public DialogImpl getDialog(String dialogId)
Return the dialog for a given dialog ID. If compatibility is enabled then we do not assume the presence of tags and hence need to add a flag to indicate whether this is a server or client transaction.

Parameters:
dialogId - is the dialog id to check.

findTransaction

public SIPTransaction findTransaction(gov.nist.javax.sip.message.SIPMessage sipMessage,
                                      boolean isServer)
Find the transaction corresponding to a given request.

Parameters:
isServer - -- search the server transaction table if true.
Returns:
the transaction object corresponding to the request or null if no such mapping exists.

findCancelTransaction

public SIPTransaction findCancelTransaction(gov.nist.javax.sip.message.SIPRequest cancelRequest,
                                            boolean isServer)
Get the transaction to cancel. Search the server transaction table for a transaction that matches the given transaction.


createMessageChannel

public MessageChannel createMessageChannel(Hop nextHop)
                                    throws UnknownHostException
Creates a client transaction to handle a new request. Gets the real message channel from the superclass, and then creates a new client transaction wrapped around this channel.

Overrides:
createMessageChannel in class SIPStack
Parameters:
nextHop - Hop to create a channel to contact.
Returns:
A MessageChannel to the specified Hop, or null if no MessageProcessors support contacting that Hop.
UnknownHostException

createMessageChannel

public MessageChannel createMessageChannel(MessageChannel rawChannel)
Create a client transaction from a raw channel.

Parameters:
rawChannel - is the transport channel to encapsulate.

createMessageChannel

public MessageChannel createMessageChannel(SIPTransaction transaction)
Create a client transaction from a raw channel.


createClientTransaction

public SIPClientTransaction createClientTransaction(MessageChannel encapsulatedMessageChannel)
Creates a client transaction that encapsulates a MessageChannel. Useful for implementations that want to subclass the standard

Parameters:
encapsulatedMessageChannel - Message channel of the transport layer.

createServerTransaction

public SIPServerTransaction createServerTransaction(MessageChannel encapsulatedMessageChannel)
Creates a server transaction that encapsulates a MessageChannel. Useful for implementations that want to subclass the standard

Parameters:
encapsulatedMessageChannel - Message channel of the transport layer.

createRawMessageChannel

public MessageChannel createRawMessageChannel(Hop hop)
                                       throws UnknownHostException
Creates a raw message channel. A raw message channel has no transaction wrapper.

Parameters:
hop - -- hop for which to create the raw message channel.
UnknownHostException

addTransaction

public void addTransaction(SIPClientTransaction clientTransaction)
Add a new client transaction to the set of existing transactions.

Parameters:
clientTransaction - -- client transaction to add to the set.

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.