📄 router.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0) on Wed Nov 15 07:55:48 PST 2006 -->
<TITLE>
Router (JSIP API v1.2)
</TITLE>
<META NAME="keywords" CONTENT="javax.sip.address.Router interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Router (JSIP API v1.2)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>JSIP API v1.2<br><font size=-1>November 2006</font></b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/sip/address/Hop.html" title="interface in javax.sip.address"><B>PREV CLASS</B></A>
<A HREF="../../../javax/sip/address/SipURI.html" title="interface in javax.sip.address"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?javax/sip/address/Router.html" target="_top"><B>FRAMES</B></A>
<A HREF="Router.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.sip.address</FONT>
<BR>
Interface Router</H2>
<HR>
<DL>
<DT><PRE>public interface <B>Router</B></DL>
</PRE>
<P>
The Router interface may be implemented by the application to provide custom routing logic. It is used to determine the next hop for a given request. <p>For backwards compatibility reasons, the default behavior of the stack is to consult the application provided Router implementation for all requests outside of a dialog. This is controlled through the stack property <code>javax.sip.USE_ROUTER_FOR_ALL_URIS</code> which defaults to <code>true</code> when not set. <p>This specification recommends to set the stack property <code>javax.sip.USE_ROUTER_FOR_ALL_URIS</code> to <code>false</code>. This will cause the stack to only consult the application provided Router implementation for requests with a non-SIP URI as request URI (such as tel: or pres:) and without Route headers. This enables an application to implement DNS lookups and other resolution algorithms <p>When <code>javax.sip.USE_ROUTER_FOR_ALL_URIS</code> is set to <code>false</code>, the next hop is determined according to the following algorithm: <ul> <li> If the request contains one or more Route headers, use the URI of the topmost Route header as next hop, possibly modifying the request in the process if the topmost Route header contains no lr parameter(See Note below)) <li> Else, if the property <code>javax.sip.OUTBOUND_PROXY</code> is set, use its value as the next hop <li> Otherwise, use the request URI as next hop. If the request URI is not a SIP URI, call <A HREF="../../../javax/sip/address/Router.html#getNextHop(javax.sip.message.Request)"><CODE>getNextHop(Request)</CODE></A> provided by the application. </ul> <p><b>Note:</b> In case the topmost Route header contains no 'lr' parameter (which means the next hop is a strict router), the implementation will perform 'Route Information Postprocessing' as described in RFC3261 section 16.6 step 6 (also known as "Route header popping"). That is, the following modifications will be made to the request: <ol> <li>The implementation places the Request-URI into the Route header field as the last value. <li>The implementation then places the first Route header field value into the Request-URI and removes that value from the Route header field. </ol> Subsequently, the request URI will be used as next hop target. <p>The location (classname) of the user-defined Router object is supplied in the Properties object passed to the <A HREF="../../../javax/sip/SipFactory.html#createSipStack(java.util.Properties)"><CODE>SipFactory.createSipStack(Properties)</CODE></A> method upon creation of the SIP Stack object. The Router object must accept a SipStack as an argument to the constructor in order for the Router to access attributes of the SipStack The constructor of an object implementing the Router interface must be <code>RouterImpl(SipStack sipStack, String outboundProxy) {}</code> <p> The routing policy can not be changed dynamically, i.e. the SipStack needs to be deleted and re-created. Outbound proxy should be passed to the <A HREF="../../../javax/sip/SipFactory.html#createSipStack(java.util.Properties)"><CODE>SipFactory.createSipStack(Properties)</CODE></A> method upon creation of the SIP Stack object. <p><b>Application Notes</b><br/> <p>A UAC application which desires to use a particular outbound proxy should prepend a Route header with the URI of that proxy (and 'lr' flag if appropriate). Alternatively, it may achieve the same result by setting the OUTBOUND_PROXY property (although the Route header approach is more flexible and therefore RECOMMENDED) <p>A proxy application may either rewrite the request URI (if the proxy is responsible for the domain), or prepend a Route header.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>BEA Systems, NIST</DD>
</DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -