|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.javax.sip.stack.SIPStack
This class defines a SIP Stack. In order to build a SIP server (UAS/UAC or Proxy etc.) you need to extend this class and instantiate it in your application. After you have done so, call createMessageProcessor to create message processors and then start these message processors to get the stack the process messages. This will start the necessary threads that wait for incoming SIP messages. A general note about the handler structures -- handlers are expected to returnResponse for successful message processing and throw SIPServerException for unsuccessful message processing.
Field Summary | |
static int |
DEFAULT_PORT
Default UDP port (5060) |
Constructor Summary | |
SIPStack()
Default constructor. |
|
SIPStack(SIPStackMessageFactory messageFactory,
String stackAddress,
String stackName)
Construcor for the stack. |
|
SIPStack(SIPStackMessageFactory messageFactory,
String stackAddress,
String stackName,
ChannelNotifier notifier)
Construcor for the stack. |
Method Summary | |
void |
addMessageProcessor(MessageProcessor newMessageProcessor)
Adds a new MessageProcessor to the list of running processors for this SIPStack and starts it. |
MessageChannel |
createMessageChannel(Hop nextHop)
Creates a new MessageChannel for a given Hop. |
MessageProcessor |
createMessageProcessor(int port,
String transport)
Creates the equivalent of a JAIN listening point and attaches to the stack. |
void |
exportServerLog(String logRootName,
int rmiPort,
int lifetime)
Export the Server Log for Access via RMI. |
String |
getBadMessageLog()
Get the file name of the bad message log. |
Hop |
getDefaultRoute()
Get the default route. |
Route |
getDefaultRouteHeader()
Get the route header corresponding to the default route. |
String |
getHostAddress()
Get my address. |
MessageProcessor |
getMessageProcessor(String transport)
Get a message processor for the given transport. |
MessageProcessor[] |
getMessageProcessors()
Gets an array of running MessageProcessors on this SIPStack. |
Hop |
getNextHop()
Get the default next hop from the router. |
Iterator |
getNextHop(gov.nist.javax.sip.message.SIPRequest sipRequest)
Get the default route string. |
int |
getPort(String transport)
get port of the message processor (based on the transport). |
Route |
getRouteHeader(Hop hop)
Get the route header for this hop. |
Router |
getRouter()
Get the router algorithm. |
String |
getStackFunction()
Get the stack function. |
String |
getStackName()
Get the Stack name. |
boolean |
isAlive()
return the status of the toExit flag. |
boolean |
isTransportEnabled(String transport)
Return true if a transport is enabled. |
boolean |
isTransportEnabled(String transport,
int port)
Return true if the transport is enabled for a given port. |
void |
logBadMessage(String message)
Log a bad message (invoked when a parse exception arises). |
void |
removeMessageProcessor(MessageProcessor oldMessageProcessor)
Removes a MessageProcessor from this SIPStack. |
void |
setHostAddress(String stackAddress)
Set my address. |
void |
setMaxConnections(int nconnections)
Set the max # of simultaneously handled TCP connections. |
void |
setRouter(Router router)
Set the router algorithm. |
void |
setSingleThreaded()
Set the flag that instructs the stack to only start a single thread for sequentially processing incoming udp messages (thus serializing the processing). |
void |
setStackMessageFactory(SIPStackMessageFactory messageFactory)
Set the server Request and response factories. |
void |
setStackName(String stackName)
Set the descriptive name of the stack. |
void |
setThreadPoolSize(int size)
Set the thread pool size for processing incoming UDP messages. |
void |
stopStack()
Make the stack close all accept connections and return. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_PORT
Constructor Detail |
public SIPStack(SIPStackMessageFactory messageFactory, String stackAddress, String stackName, ChannelNotifier notifier) throws UnknownHostException
messageFactory
- User-implemented factory for processing
messages.stackAddress
- -- IP address or host name of the stack.stackName
- -- descriptive name for the stack.notifier
- -- Callback that gets invoked when a channel is
closed. This is used primarily to notify when a tcp connection
is closed.public SIPStack(SIPStackMessageFactory messageFactory, String stackAddress, String stackName) throws UnknownHostException
messageFactory
- User-implemented factory for processing
messages.stackAddress
- -- IP address or host name of the stack.stackName
- -- descriptive name for the stack.public SIPStack()
Method Detail |
public void logBadMessage(String message)
message
- is a string that contains the bad message to log.public String getBadMessageLog()
public void setSingleThreaded()
public void setThreadPoolSize(int size)
public void setMaxConnections(int nconnections)
public Iterator getNextHop(gov.nist.javax.sip.message.SIPRequest sipRequest)
sipRequest
- is the request for which we want to compute
the next hop.public void setStackMessageFactory(SIPStackMessageFactory messageFactory)
messageFactory
- User-implemented factory for processing
messages.public void setStackName(String stackName)
stackName
- -- descriptive name of the stack.public void exportServerLog(String logRootName, int rmiPort, int lifetime)
logRootName
- - the root name to assign to the log.rmiPort
- - the rmi port for the rmi registry (usually 1099)lifetime
- - the number of seconds to hold on to the log.public String getStackName()
public void setHostAddress(String stackAddress) throws UnknownHostException
stackAddress
- -- A string containing the stack address.
UnknownHostException
public String getHostAddress()
public Hop getNextHop()
public int getPort(String transport)
transport
- is the transport for which to get the port.public boolean isTransportEnabled(String transport)
transport
- is the transport to check.public boolean isTransportEnabled(String transport, int port)
transport
- transport to checkport
- port to check transport at.public void setRouter(Router router)
router
- A class that implements the Router interface.public Router getRouter()
public Hop getDefaultRoute()
public String getStackFunction()
public Route getRouteHeader(Hop hop)
public Route getDefaultRouteHeader()
public boolean isAlive()
public void stopStack()
public void addMessageProcessor(MessageProcessor newMessageProcessor) throws IOException
IOException
public void removeMessageProcessor(MessageProcessor oldMessageProcessor)
oldMessageProcessor
- public MessageProcessor[] getMessageProcessors()
public MessageProcessor getMessageProcessor(String transport)
public MessageProcessor createMessageProcessor(int port, String transport) throws IOException
IOException
public MessageChannel createMessageChannel(Hop nextHop) throws UnknownHostException
nextHop
- Hop to create a MessageChannel to.
UnknwonHostException
- If the host in the Hop doesn't
exist.
UnknownHostException
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |