📄 sipprovider.html
字号:
can still handle these requests statelessly. The application cannot create a new server transaction for such requests. </ul> <p> <b>Sending Requests:</b><br> The client side of the transport layer is responsible for sending the request. The application passes the the Request to the ClientTransaction Dialog or the SipProvider that will send the Request over one of the SipProvider's ListeningPoints. The SipProvider will choose a ListeningPoint that has the same transport as the destination. For example, a Request that is going to be sent over TCP will use a TCP ListeningPoint. See section 18.1.1 of <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a>. <p> <b>Sending Responses:</b><br> The server side of the transport layer is responsible for sending the responses. The application passes the Response to the ServerTransaction or the SipProvider that will send the Response over one of its ListeningPoints. <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a>. The response must be sent from the same ListeningPoint on which the request was received. <p> <b>Receiving Requests:</b><br> A SipProvider should be prepared to receive requests on any IP address, port and transport encapsulated in one of its ListeningPoints. When the SipProvider receives a request over any transport, it must examine the value of the "sent-by" parameter in the top Via header. If the host portion of the "sent-by" parameter contains a domain name, or if it contains an IP address that differs from the packet source address, the server must add a "received" parameter to that Via header field value. This parameter must contain the source address from which the packet was received. This is to assist the SipProvider in sending the response, since it must be sent to the source IP address from which the request came. Next, the SipProvider attempts to match the request to a server transaction. If there are any server transactions in existence, the server transport uses the matching procedures of Chapter 17 of <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a> to attempt to match the response to an existing transaction. If a matching server transaction is found, the request is passed to that transaction, encapsulated into a RequestEvent and fired to the application for processing. If no match is found, the request is passed to the application, which may decide to construct a new server transaction for that request. <p> <b>Receiving Responses</b><br> Responses are first processed by the transport layer and then passed up to the transaction layer. The transaction layer performs its processing and then passes the response up to the application. When a response is received, the SipProvider examines the top Via header. If the value of the "sent-by" parameter in that header field value does not correspond to a value that the client transport is configured to insert into requests, the response MUST be silently discarded. If there are any client transactions in existence, the client transport uses the matching procedures of Chapter 17 of <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a> to attempt to match the response to an existing transaction. If there is a match, the response must be passed to that transaction, encapsulated into a ResponseEvent and fired to the application. Otherwise, the response is stray and must be passed to the application to determine its outcome i.e. a proxy will forward them, while a User Agent will discard.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>BEA Systems, NIST</DD>
<DT><B>See Also:</B><DD><A HREF="../../javax/sip/SipListener.html" title="interface in javax.sip"><CODE>SipListener</CODE></A>,
<A HREF="../../javax/sip/SipStack.html" title="interface in javax.sip"><CODE>SipStack</CODE></A></DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#addListeningPoint(javax.sip.ListeningPoint)">addListeningPoint</A></B>(<A HREF="../../javax/sip/ListeningPoint.html" title="interface in javax.sip">ListeningPoint</A> listeningPoint)</CODE>
<BR>
This method adds the supplied ListeningPoint to the list of ListeningPoints associated to this SipProvider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#addSipListener(javax.sip.SipListener)">addSipListener</A></B>(<A HREF="../../javax/sip/SipListener.html" title="interface in javax.sip">SipListener</A> sipListener)</CODE>
<BR>
This method registers the SipListener object to this SipProvider, once registered the SIP Listener recieve events emitted from the SipProvider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/ListeningPoint.html" title="interface in javax.sip">ListeningPoint</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getListeningPoint()">getListeningPoint</A></B>()</CODE>
<BR>
<B>Deprecated.</B> <I>Since v1.2. Note that in v1.1 a SipProvider could only be associated to a single listening point, this restriction has been lifted to allow a SipProvider to have a specific ListeningPoints for each transport. For backwards compatibility, this method will return the first ListeningPoint of the list of ListeningPoints associated with the SipProvider. This method has been replaced with <A HREF="../../javax/sip/SipProvider.html#getListeningPoints()"><CODE>getListeningPoints()</CODE></A>.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/ListeningPoint.html" title="interface in javax.sip">ListeningPoint</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getListeningPoint(java.lang.String)">getListeningPoint</A></B>(java.lang.String transport)</CODE>
<BR>
Get the listening point for a given transport.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/ListeningPoint.html" title="interface in javax.sip">ListeningPoint</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getListeningPoints()">getListeningPoints</A></B>()</CODE>
<BR>
Returns all the ListeningPoints of this SipProvider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/header/CallIdHeader.html" title="interface in javax.sip.header">CallIdHeader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getNewCallId()">getNewCallId</A></B>()</CODE>
<BR>
Returns a unique CallIdHeader for identifying dialogues between two SIP applications.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/ClientTransaction.html" title="interface in javax.sip">ClientTransaction</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getNewClientTransaction(javax.sip.message.Request)">getNewClientTransaction</A></B>(<A HREF="../../javax/sip/message/Request.html" title="interface in javax.sip.message">Request</A> request)</CODE>
<BR>
Before an application can send a new request it must first request a new client transaction to handle that Request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/Dialog.html" title="interface in javax.sip">Dialog</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getNewDialog(javax.sip.Transaction)">getNewDialog</A></B>(<A HREF="../../javax/sip/Transaction.html" title="interface in javax.sip">Transaction</A> transaction)</CODE>
<BR>
Create a dialog for the given transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/ServerTransaction.html" title="interface in javax.sip">ServerTransaction</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getNewServerTransaction(javax.sip.message.Request)">getNewServerTransaction</A></B>(<A HREF="../../javax/sip/message/Request.html" title="interface in javax.sip.message">Request</A> request)</CODE>
<BR>
An application has the responsibility of deciding to respond to a Request that does not match an existing server transaction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/SipStack.html" title="interface in javax.sip">SipStack</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#getSipStack()">getSipStack</A></B>()</CODE>
<BR>
Returns the SipStack that created this SipProvider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#removeListeningPoint(javax.sip.ListeningPoint)">removeListeningPoint</A></B>(<A HREF="../../javax/sip/ListeningPoint.html" title="interface in javax.sip">ListeningPoint</A> listeningPoint)</CODE>
<BR>
Removes the specified ListeningPoint from this SipProvider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#removeSipListener(javax.sip.SipListener)">removeSipListener</A></B>(<A HREF="../../javax/sip/SipListener.html" title="interface in javax.sip">SipListener</A> sipListener)</CODE>
<BR>
Removes the specified SipListener from this SipProvider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#sendRequest(javax.sip.message.Request)">sendRequest</A></B>(<A HREF="../../javax/sip/message/Request.html" title="interface in javax.sip.message">Request</A> request)</CODE>
<BR>
Sends the Request statelessly, that is no transaction record is associated with this action.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#sendResponse(javax.sip.message.Response)">sendResponse</A></B>(<A HREF="../../javax/sip/message/Response.html" title="interface in javax.sip.message">Response</A> response)</CODE>
<BR>
Sends the Response statelessly, that is no transaction record is associated with this action.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#setAutomaticDialogSupportEnabled(boolean)">setAutomaticDialogSupportEnabled</A></B>(boolean flag)</CODE>
<BR>
Enable or disable automatic dialog creation for this Provider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/SipProvider.html#setListeningPoint(javax.sip.ListeningPoint)">setListeningPoint</A></B>(<A HREF="../../javax/sip/ListeningPoint.html" title="interface in javax.sip">ListeningPoint</A> listeningPoint)</CODE>
<BR>
<B>Deprecated.</B> <I>Since v1.2. Note that in v1.1 a SipProvider could only be associated to a single listening point, this restriction has been lifted to allow a SipProvider to have a specific ListeningPoints for each transport. For backwards compatibility, this method will add the ListeningPoint to the list of ListeningPoints associated with the SipProvider. This method has been replaced with <A HREF="../../javax/sip/SipProvider.html#addListeningPoint(javax.sip.ListeningPoint)"><CODE>addListeningPoint(ListeningPoint)</CODE></A>, the same semantics apply to this method.</I></TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -