⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sipconnection.html

📁 sipapi 说明文档.用于JAVA的SIP开发及应用.
💻 HTML
📖 第 1 页 / 共 4 页
字号:
 <td>- share system SIP port <br>- share system SIP identity <br>- SIP register done by the system</td> <td>- route incoming SIP requests with MIME type feature tag <tt>"application/subtype"</tt> to this <tt>SipConnectionNotifier</tt></td> </tr> <tr> <td><b>2)</b></td> <td><tt>sip:5080[;type=<br>"application/subtype"]</tt></td> <td NOWRAP>- use dedicated port number <tt>5080</tt> <br>- use identity set by the application <br>- application does the SIP register</td> <td>- route all incoming SIP requests on port 5080 to this <tt>SipConnectionNotifier</tt>.       If the optional MIME type feature tag <tt>"application/subtype"</tt> is set, route       only the requests with the matching tag.</td> </tr>  <tr> <td><b>3)</b></td> <td><tt>sip:</tt></td>  <td>- use dedicated port selected by the system <br>- use identity set by the application <br>- application does the SIP register</td>  <td>- route all incoming SIP requests to the selected port to this <tt>SipConnectionNotifier</tt></td> </tr> </table> <h2><A NAME="ROUTING">Routing the incoming request</A></h2> The following routing rules are based on the information available in the  incoming request. The implementations may define local policy that overrides any of  these rules for security reasons. The incoming request is routed based on following  information:<br><br> <ul> <li><b>Accept-Contact header</b> UA client expresses preference for capabilities  supported by the target UA. <li><b>Reject-Contact header</b> (OPTIONAL) Header field contains feature sets which,  if matched by a UA, imply that the request should not be routed to that UA. This is  considered optional within this specification. <li><b>SDP media</b> (OPTIONAL) Media name and transport address port. The implementation may route the request based on the media information in the SDP payload. </ul> The request is routed according to the following rules, based on which of the information above is available. Every request may include <tt>Accept-Contact</tt> and  <tt>Reject-Contact</tt> headers. INVITE request can also have SDP payload. <p> <p> <table BORDER COLS=4 WIDTH="100%" > <tr> <td><tt> </tt></td> <td NOWRAP><b><u>Accept-Contact</u></b></td> <td NOWRAP><b><u>SDP media</u></b></td> <td><b><u>Routing</u></b></td> </tr>  <tr> <td><b>1)</b></td> <td>yes</td> <td>-</td> <td>Header field contains feature sets that describe UAsthat the caller would like to reach. In this specificationthe minimum requirement is the application MIME typeindicated by the Accept-Contact parameter <tt>'type'</tt></td> </tr> <tr> <td><b>2)</b></td> <td>yes</td> <td>yes</td> <td>Same as case 1)</td> </tr> <tr> <td><b>3)</b></td> <td>-</td> <td>yes</td> <td>(OPTIONAL) The request is routed based on SDP mediainformation.</td> </tr> </table> <p> The rule <b>1)</b> defines the minimum required operation for this specification.  The SIP dispatcher should implement the decision rules defined in caller prefs  [RFC3841] specification. For security reasons the dispatcher implementation may  define routing rules that cannot be overridden by other applications. <br><br> If matching application is not found a suitable error response is sent e.g.  <ul> <li><tt>405 Method Not Allowed</tt> <li><tt>415 Unsupported Media Type</tt> <li><tt>480 Temporarily Unavailable</tt> </ul> <h3>Examples of <tt>Accept-Contact</tt> header and incoming request</h3> The format of the <tt>Accept-Contact</tt> header is: <pre>    Accept-Contact: *;&lt;feature_set&gt; </pre> Where <tt>"*"</tt> is purely there to match the SIP extensions syntax and <tt>&lt;feature_set&gt;</tt> is a list of feature parameters. <br>Examples: <pre>    Accept-Contact: *;type="application/vnd.company.battleships"    Accept-Contact: *;type="application/x-chess";    Accept-Contact: *;audio;voice;mobility="mobile"; </pre> Example of an incoming request with <tt>Accept-Contact</tt> header, matching the application MIME type <tt>"application/x-chess"</tt>: <pre>    INVITE sip:UserY@example.com SIP/2.0    From: sip:UserX@operator.com    To: sip:UserY@example.com    Accept-Contact: *;type="application/x-chess";explicit    Content-Type: application/sdp    ...SDP... </pre> <p> <h2><A NAME="HEADERACCESS">Restricted access to headers</A></h2> Access to certain header types may be restricted.  Typically these headers are related to SIP routing and transaction  handling so they are not needed to be read and/or modified by the user.  The following two list of headers apply to all header manipulation methods of this class. <p> <h3>Read-only headers</h3> An implementation MAY throw  <tt>SipException</tt> with INVALID_OPERATION error code if the user  tries to modify the following headers: <p> <tt>Call-ID, Cseq, Proxy-Authenticate, WWW-Authenticate</tt> <p> <h3>Inaccessible headers</h3> An implementation MAY return <tt>null</tt> if the user tries to read the following headers. Trying to modify these  headers will result in <tt>SipException.INVALID_OPERATION</tt>: <p> <tt>Authentication-Info, Authorization, Max-Forwards, Min-Expires,  Proxy-Authorization, Record-Route, Security-Server, Security-Verify,  Service-Route, Via</tt> <p> <h2><A NAME="APIID">Identification of the SIP API</A></h2> To enable applications to test for the presence of the SIP API and its  version during runtime, a system property is defined. Platforms where  this API is implemented according to this specification shall include  a system property with a key <code>"microedition.sip.version"</code>. When  <code>System.getProperty</code> is called with this key,  implementations conforming to this specification shall return the  version string <code>"1.1.0"</code>.<p>
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/sip/SipClientConnection.html" title="interface in javax.microedition.sip"><CODE>SipClientConnection</CODE></A>, <A HREF="../../../javax/microedition/sip/SipServerConnection.html" title="interface in javax.microedition.sip"><CODE>SipServerConnection</CODE></A>, <A HREF="../../../javax/microedition/sip/SipConnectionNotifier.html" title="interface in javax.microedition.sip"><CODE>SipConnectionNotifier</CODE></A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->


<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#addHeader(java.lang.String, java.lang.String)">addHeader</A></B>(java.lang.String&nbsp;name,          java.lang.String&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a header to the SIP message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/microedition/sip/SipDialog.html" title="interface in javax.microedition.sip">SipDialog</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getDialog()">getDialog</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current SIP dialog.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getHeader(java.lang.String)">getHeader</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the header field value of specified header type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getHeaders(java.lang.String)">getHeaders</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the header field value(s) of specified header type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getMethod()">getMethod</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the SIP method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getReasonPhrase()">getReasonPhrase</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets SIP response reason phrase.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getRequestURI()">getRequestURI</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets Request-URI.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#getStatusCode()">getStatusCode</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets SIP response status code.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.InputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#openContentInputStream()">openContentInputStream</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <tt>InputStream</tt> to read the message body content of a  request or response received.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.OutputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#openContentOutputStream()">openContentOutputStream</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <tt>OutputStream</tt> to fill the SIP message body content.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#removeHeader(java.lang.String)">removeHeader</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes header from the message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#send()">send</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends the SIP message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#setErrorListener(javax.microedition.sip.SipErrorListener)">setErrorListener</A></B>(<A HREF="../../../javax/microedition/sip/SipErrorListener.html" title="interface in javax.microedition.sip">SipErrorListener</A>&nbsp;sel)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the listener for error notifications.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipConnection.html#setHeader(java.lang.String, java.lang.String)">setHeader</A></B>(java.lang.String&nbsp;name,          java.lang.String&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets header value in SIP message.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.microedition.io.Connection"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.microedition.io.Connection</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>close</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="send()"><!-- --></A><H3>
send</H3>
<PRE>
public void <B>send</B>()          throws java.io.IOException,                 <A HREF="../../../javax/microedition/sip/SipException.html" title="class in javax.microedition.sip">SipException</A></PRE>
<DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -