📄 siplistener.html
字号:
<TD><CODE><B><A HREF="../../javax/sip/SipListener.html#processIOException(javax.sip.IOExceptionEvent)">processIOException</A></B>(<A HREF="../../javax/sip/IOExceptionEvent.html" title="class in javax.sip">IOExceptionEvent</A> exceptionEvent)</CODE>
<BR>
Process an asynchronously reported IO Exception.</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/SipListener.html#processRequest(javax.sip.RequestEvent)">processRequest</A></B>(<A HREF="../../javax/sip/RequestEvent.html" title="class in javax.sip">RequestEvent</A> requestEvent)</CODE>
<BR>
Processes a Request received on a SipProvider upon which this SipListener is registered.</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/SipListener.html#processResponse(javax.sip.ResponseEvent)">processResponse</A></B>(<A HREF="../../javax/sip/ResponseEvent.html" title="class in javax.sip">ResponseEvent</A> responseEvent)</CODE>
<BR>
Processes a Response received on a SipProvider upon which this SipListener is registered.</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/SipListener.html#processTimeout(javax.sip.TimeoutEvent)">processTimeout</A></B>(<A HREF="../../javax/sip/TimeoutEvent.html" title="class in javax.sip">TimeoutEvent</A> timeoutEvent)</CODE>
<BR>
Processes a retransmit or expiration Timeout of an underlying <A HREF="../../javax/sip/Transaction.html" title="interface in javax.sip"><CODE>Transaction</CODE></A>handled by this SipListener.</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/SipListener.html#processTransactionTerminated(javax.sip.TransactionTerminatedEvent)">processTransactionTerminated</A></B>(<A HREF="../../javax/sip/TransactionTerminatedEvent.html" title="class in javax.sip">TransactionTerminatedEvent</A> transactionTerminatedEvent)</CODE>
<BR>
Process an asynchronously reported TransactionTerminatedEvent.</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">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="processRequest(javax.sip.RequestEvent)"><!-- --></A><H3>
processRequest</H3>
<PRE>
void <B>processRequest</B>(<A HREF="../../javax/sip/RequestEvent.html" title="class in javax.sip">RequestEvent</A> requestEvent)</PRE>
<DL>
<DD>Processes a Request received on a SipProvider upon which this SipListener is registered. <p> <b>Handling Requests: </b> <br> When the application receives a RequestEvent from the SipProvider the RequestEvent may or may not belong to an existing dialog of the application. The application can be determine if the RequestEvent belongs to an existing dialog by checking the server transaction of the RequestEvent. <ul> <li>If the server transaction equals <code>null</code> the RequestEvent does not belong to an existing dialog and the application must determine how to handle the RequestEvent. If the application decides to forward the Request statelessly no transactional support is required and it can simply pass the Request of the RequestEvent as an argument to the <A HREF="../../javax/sip/SipProvider.html#sendRequest(javax.sip.message.Request)"><CODE>SipProvider.sendRequest(Request)</CODE></A>method. However if the application determines to respond to a Request statefully it must request a new server transaction from the <A HREF="../../javax/sip/SipProvider.html#getNewServerTransaction(javax.sip.message.Request)"><CODE>SipProvider.getNewServerTransaction(Request)</CODE></A>method and use this server transaction to send the Response based on the content of the Request. If the SipProvider throws TransactionAlreadyExistsException when the application requests a new server transaction to handle a Request the current RequestEvent is a retransmission of the initial request from which the application hadn't requested a server transaction to handle it, i.e. this exception handles the race condition of an application informing the SipProvider that it will handle a Request and the receipt of a retransmission of the Request from the network to the SipProvider. <li>If the server transaction <b>does NOT </b> equal <code>null</code> the application determines its action to the RequestEvent based on the content of the Request information. </ul> <p> <b>User Agent Server (UAS) Behaviour: </b> <br> A UAS application decides whether to accept the an invitation from a UAC. The UAS application can accept the invitation by sending a 2xx response to the UAC, a 2xx response to an INVITE transaction establishes a session. For 2xx responses, the processing is done by the UAS application, to guarantee the three way handshake of an INVITE transaction. This specification defines a utility thats enables the SipProvider to handle the 2xx processing for an INVITE transaction, see the <A HREF="../../javax/sip/SipStack.html#isRetransmissionFilterActive()"><CODE>SipStack.isRetransmissionFilterActive()</CODE></A>method. If the invitation is not accepted, a 3xx, 4xx, 5xx or 6xx response is sent by the application, depending on the reason for the rejection. Alternatively before sending a final response, the UAS can also send provisional responses (1xx) to advise the UAC of progress in contacting the called user. A UAS that receives a CANCEL request for an INVITE, but has not yet sent a final response, would "stop ringing" and then respond to the INVITE with a specific 487 Error response. <p> <b>General Proxy behaviour: </b> <br> In some circumstances, a proxy application MAY forward requests using stateful transports without being transaction stateful, i.e. using the <A HREF="../../javax/sip/SipProvider.html#sendRequest(javax.sip.message.Request)"><CODE>SipProvider.sendRequest(Request)</CODE></A>method, but using TCP as a transport. For example, a proxy application MAY forward a request from one TCP connection to another transaction statelessly as long as it places enough information in the message to be able to forward the response down the same connection the request arrived on. This is the responsibility of the application and not the SipProvider. Requests forwarded between different types of transports where the proxy application takes an active role in ensuring reliable delivery on one of the transports must be forwarded using the stateful send methods on the SipProvider. <p> <b>Stateful Proxies: </b> <br> A stateful proxy MUST create a new server transaction for each new request received, either automatically generated by the SipProvider, if the request matches an existing dialog or by the an application call on the SipProvider if it decides to respond to the request statefully. The proxy application determines where to route the request, choosing one or more next-hop locations. An outgoing request for each next-hop location is processed by its own associated client transaction. The proxy application collects the responses from the client transactions and uses them to send responses to the server transaction. When an application receives a CANCEL request that matches a server transaction, a stateful proxy cancels any pending client transactions associated with a response context. A stateful proxy responds to the CANCEL rather than simply forwarding a response it would receive from a downstream element. <p> For all new Requests, including any with unknown methods, an element intending to stateful proxy the Request determines the target(s) of the request. A stateful proxy MAY process the targets in any order. A stateful proxy must have a mechanism to maintain the target set as responses are received and associate the responses to each forwarded request with the original request. For each target, the proxy forwards the request following these steps: <ul> <li>Make a copy of the received request. <li>Update the Request-URI. <li>Update the Max-Forwards header. <li>Optionally add a Record-route header. <li>Optionally add additional headers. <li>Postprocess routing information. <li>Determine the next-hop address, port, and transport. <li>Add a Via header. <li>Add a Content-Length header if necessary. <li>Forward the new request using the <A HREF="../../javax/sip/ClientTransaction.html#sendRequest()"><CODE>ClientTransaction.sendRequest()</CODE></A>method. <li>Process all responses recieved on the <A HREF="../../javax/sip/SipListener.html#processResponse(javax.sip.ResponseEvent)"><CODE>processResponse(ResponseEvent)</CODE></A>method. <li>NOT generate 100 (Trying) responses to non-INVITE requests. </ul> <p> A stateful proxy MAY transition to stateless operation at any time during the processing of a request, as long as it did nothing that would prevent it from being stateless initially i.e. forking or generation of a 100 response. When performing such a transition, any state already stored is simply discarded. <p> <b>Forking Requests: </b> <br> A stateful proxy application MAY choose to "fork" a request, routing it to multiple destinations. Any request that is forwarded to more than one location MUST be forwarded using the stateful send methods on the SipProvider. <p> <b>Stateless Proxies: </b> <br> As a stateless proxy does not have any notion of a transaction, or of the response context used to describe stateful proxy behavior, <code>requestEvent.getServerTransaction() == null;</code> always return <var>true </var>. The transaction layer of the SipProvider implementation is by-passed. For all requests including any with unknown methods, an application intending to stateless proxy the request MUST: <ul> <li>Validate the request. <li>Preprocess routing information. <li>Determine a single target(s) for the request. <li>Forward the request to the target using the <A HREF="../../javax/sip/SipProvider.html#sendRequest(javax.sip.message.Request)"><CODE>SipProvider.sendRequest(Request)</CODE></A>method. <li>NOT perform special processing for CANCEL requests. </ul>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>requestEvent</CODE> - - requestEvent fired from the SipProvider to the SipListener representing a Request received from the network.</DL>
</DD>
</DL>
<HR>
<A NAME="processResponse(javax.sip.ResponseEvent)"><!-- --></A><H3>
processResponse</H3>
<PRE>
void <B>processResponse</B>(<A HREF="../../javax/sip/ResponseEvent.html" title="class in javax.sip">ResponseEvent</A> responseEvent)</PRE>
<DL>
<DD>Processes a Response received on a SipProvider upon which this SipListener is registered. <p> <b>Handling Responses: </b> <br> When the application receives a ResponseEvent from the SipProvider the ResponseEvent may or may not correlate to an existing Request of the application. The application can be determine if the ResponseEvent belongs to an existing Request by checking the client transaction of the ResponseEvent. <ul> <li>If the the client transaction equals <code>null</code> the ResponseEvent does not belong to an existing Request and the Response is considered stray, i.e. stray response can be identitied, if <code>responseEvent.getClientTransaction() == null;</code>. Handling of these "stray" responses is dependent on the application i.e. a proxy will forward them statelessly using the <A HREF="../../javax/sip/SipProvider.html#sendResponse(javax.sip.message.Response)"><CODE>SipProvider.sendResponse(Response)</CODE></A>method, while a User Agent will discard them. <li>If the client transaction <b>does NOT </b> equal <code>null</code> the application determines it action to the ResponseEvent based on the content of the Response information. </ul> <p> <b>User Agent Client (UAC) behaviour: </b> <br> After possibly receiving one or more provisional responses (1xx) to a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -