NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.stack
Class DefaultRouter

java.lang.Object
  |
  +--gov.nist.javax.sip.stack.DefaultRouter
All Implemented Interfaces:
Router

public class DefaultRouter
extends Object
implements Router

This is the default router. When the implementation wants to forward a request and had run out of othe options, then it calls this method to figure out where to send the request. The default router implements a simple "default routing algorithm" which just forwards to the configured proxy address. Use this for UAC/UAS implementations and use the ProxyRouter for proxies.

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

Constructor Summary
DefaultRouter(SipStack sipStack, String defaultRoute)
          Constructor.
DefaultRouter(SIPStack sipStack, String defaultRoute)
          Constructor given SIPStack as an argument (this is only for the protocol tester.
 
Method Summary
 Hop getDefaultRoute()
          Get the default route (does the same thing as getOutboundProxy).
 ListIterator getNextHops(Request request)
          Return addresses for default proxy to forward the request to.
 Hop getOutboundProxy()
          Get the default hop.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRouter

public DefaultRouter(SipStack sipStack,
                     String defaultRoute)
Constructor.


DefaultRouter

public DefaultRouter(SIPStack sipStack,
                     String defaultRoute)
Constructor given SIPStack as an argument (this is only for the protocol tester. Normal implementation should not need this.

Method Detail

getNextHops

public ListIterator getNextHops(Request request)
Return addresses for default proxy to forward the request to. The list is organized in the following priority. If the requestURI refers directly to a host, the host and port information are extracted from it and made the next hop on the list. If the default route has been specified, then it is used to construct the next element of the list.

Specified by:
getNextHops in interface Router
Parameters:
request - - the Request message that determines the default route.
Returns:
the ListIterator over all the hops of this Router.
See Also:
Hop

getOutboundProxy

public Hop getOutboundProxy()
Get the default hop.

Specified by:
getOutboundProxy in interface Router
Returns:
defaultRoute is the default route. public java.util.Iterator getDefaultRoute(Request request) { return this.getNextHops((SIPRequest)request); }
See Also:
Hop

getDefaultRoute

public Hop getDefaultRoute()
Get the default route (does the same thing as getOutboundProxy).

Returns:
the default route.

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.