📄 dialog.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:47 PST 2006 -->
<TITLE>
Dialog (JSIP API v1.2)
</TITLE>
<META NAME="keywords" CONTENT="javax.sip.Dialog interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Dialog (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/ClientTransaction.html" title="interface in javax.sip"><B>PREV CLASS</B></A>
<A HREF="../../javax/sip/DialogDoesNotExistException.html" title="class in javax.sip"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/sip/Dialog.html" target="_top"><B>FRAMES</B></A>
<A HREF="Dialog.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</FONT>
<BR>
Interface Dialog</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD>java.io.Serializable</DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>Dialog</B><DT>extends java.io.Serializable</DL>
</PRE>
<P>
A dialog represents a peer-to-peer SIP relationship between two user agents that persists for some time. Dialogs are typically used by user agents to facilitate management of state. Dialogs are typically not relevant to proxy servers. The dialog facilitates sequencing of messages between the user agents and proper routing of requests between both of them. The dialog represents a context in which to interpret SIP Transactions and Messages. However, a Dialog is not necessary for message processing. <p> A dialog is identified at each User Agent with a dialog Id, which consists of a Call-Id value, a local tag and a remote tag. The dialog Id at each User Agent involved in the dialog is not the same. Specifically, the local tag at one User Agent is identical to the remote tag at the peer User Agent. The tags are opaque tokens that facilitate the generation of unique dialog Ids. <p> A dialog contains certain pieces of data needed for further message transmissions within the dialog. This data consists of: <ul> <li> Dialog Id - used to identify the dialog. <li> Local sequence number - used to order requests from the User Agent to its peer. <li> Remote sequence number - used to order requests from its peer to the User Agent. <li> Local URI - the address of the local party. <li> Remote URI - the address of the remote party. <li> Remote target - the address from the Contact header field of the request or response or refresh request or response. <li> "secure" boolean - determines if the dialog is secure i.e. use the <var>sips:</var> scheme. <li> Route set - an ordered list of URIs. The route set is the list of servers that need to be traversed to send a request to the peer. </ul> A dialog also has its own state machine, the current <A HREF="../../javax/sip/DialogState.html" title="class in javax.sip"><CODE>DialogState</CODE></A> is determined by the sequence of messages that occur on the initial dialog. <p> <b>Invite Dialog States:</b><br> Null --> Early --> Confirmed --> Terminated <p> <b>Other Dialog-creating Requests Dialog States (ie. SUBSCRIBE):</b><br> Null --> Confirmed --> Terminated. <p> The Listener MUST ACK the 2xx response associated with an INVITE dialog. Retransmissions of the ACK in response to subsequent INVITE requests are handled by the dialog layer. If a listener does not ACK a 2XX response immediately, the implementation will terminate the Dialog automatically and remove it from the stack when the listener completes its execution. <p> The dialog layer MUST respond with an automatic error response when <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a> specifies that the User Agent MUST respond with a certain error. This does not apply for successful responses like 200 OK. The error condition relates directly to the dialog layer and the SipListener can add no meaningful information to the response. Such a response can be constructed and sent entirely by the dialog layer on behalf of the SipListener. Under such circumstances, it makes sense to let the dialog support handle the response and not bother the SipListener with it. The SipListener will not be notified with the RequestEvent upon which the Response was sent on its behalf by the Dialog layer. However, if no Dialog is registered for the transaction either automatically or under application control, then the SipListener is expected to generate and send the appropriate (error) response. <p> <b>For example:</b> In <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261</a> Chapter 14 a User Agent Server that receives a second INVITE before it sends the final response to a first INVITE with a lower CSeq sequence number on the same dialog MUST return a 500 (Server Internal Error) response to the second INVITE and MUST include a Retry-After header field with a randomly chosen value of between 0 and 10 seconds. In this release of this specification, the implementation handles retransmissions of Responses that are specified as being handled by the UA core, if there is an associated Dialog for a given transaction. If there is no associated Dialog for a given transaction, the application will be alerted to perform the retransmissions required by the UA core if desired. Applications should explicitly request such alerts see <A HREF="../../javax/sip/ServerTransaction.html#enableRetransmissionAlerts()"><CODE>ServerTransaction.enableRetransmissionAlerts()</CODE></A>. Once enabled the SipProvider will deliver retransmission timer events to the Listener with a <A HREF="../../javax/sip/Timeout.html#RETRANSMIT"><CODE>Timeout.RETRANSMIT</CODE></A> notification. The SipListener can then retransmit the Response as necessary, see <A HREF="../../javax/sip/SipListener.html#processTimeout(javax.sip.TimeoutEvent)"><CODE>SipListener.processTimeout(TimeoutEvent)</CODE></A>. <p> For INVITE Client Transactions: <ul> <li>UAC ACKs first 2xx response </li> <li>Additional 2xx responses will be ACKed automatically if a Dialog is asssociated with the response</li> <li>Additional 2xx responses will be presented to the listener if no dialog is associated with the response. In such a case the listener is expected to ACK the 2xx response. </ul> For INVITE Server Transaction 2xx response: <ul> <li> Application sends first 2xx response <A HREF="../../javax/sip/ServerTransaction.html#sendResponse(javax.sip.message.Response)"><CODE>ServerTransaction.sendResponse(Response)</CODE></A>. <li> If a Dialog is not associated with a ServerTransaction, and if the application explicitly requests to be notified of such timeouts (see <A HREF="../../javax/sip/ServerTransaction.html#enableRetransmissionAlerts()"><CODE>ServerTransaction.enableRetransmissionAlerts()</CODE></A> the SipListener is periodically alerted to retransmit 2xx responses for the ServerTransaction.</li> <li> If a Dialog is associated with a ServerTransaction then the implementation takes care of retransmitting final responses until the ACK is received i.e. the SipListener will receive no notifications to retransmit responses. </ul> For an INVITE server Transaction 300-699 response: <ul> <li> Either the application or the dialog layer sends the first response <li> Retransmissions of 300-699 responses from the INVITE Server Transaction are handled by the transaction layer independent of existence of an associated Dialog. </ul> Because reliable provisional responses are always sent by the Dialog layer, the Dialog layer takes care of retrasmitting these. The application is never alerted for retransmissions of Reliable Provisional responses: <ul> <li> The application sends a reliable provisional Response to an Invite Dialog using <A HREF="../../javax/sip/Dialog.html#sendReliableProvisionalResponse(javax.sip.message.Response)"><CODE>sendReliableProvisionalResponse(Response)</CODE></A> <li> The Stack takes care of retransmitting the provisional response with exponentially increasing intervals until a PRACK is received or the Transaction times out. </ul> Processing Forking INVITES: <p> Multiple 2xx responses may arrive at the UAC for a single INVITE request due to a forking proxy. Each response is distinguished by the tag parameter in the TO header field, and each represents a distinct Dialog, with a distinct Dialog identifier. In this case the first 2xx terminates the original INVITE additional 2xx responses will be presented to the SipListener as a ResponseEvent with null Client Transaction ID but with a valid and distinct Dialog. The Listener is expected to ACK the 2xx response - otherwise the Dialog is terminated after a timeout period. Note that unless automatic dialog creation is explictly disabled, the 2xx ResponseEvent will always contain a Dialog whether or not the outgoing INVITE was sent through a ClientTransaction or statelessly via a SipProvider.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>BEA Systems, NIST</DD>
</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> <A HREF="../../javax/sip/message/Request.html" title="interface in javax.sip.message">Request</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/Dialog.html#createAck(long)">createAck</A></B>(long cseq)</CODE>
<BR>
Creates an ACK request for an Invite that was responded with 2xx response.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/message/Request.html" title="interface in javax.sip.message">Request</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/Dialog.html#createPrack(javax.sip.message.Response)">createPrack</A></B>(<A HREF="../../javax/sip/message/Response.html" title="interface in javax.sip.message">Response</A> relResponse)</CODE>
<BR>
Creates a new PRACK Request message based on a reliable provisional response received by this Dialog and the Dialog internal information.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/sip/message/Response.html" title="interface in javax.sip.message">Response</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/sip/Dialog.html#createReliableProvisionalResponse(int)">createReliableProvisionalResponse</A></B>(int statusCode)</CODE>
<BR>
Creates a new reliable provisional response based on an Invite request
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -