📄 siplistener.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>
SipListener (JSIP API v1.2)
</TITLE>
<META NAME="keywords" CONTENT="javax.sip.SipListener interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="SipListener (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/SipFactory.html" title="class in javax.sip"><B>PREV CLASS</B></A>
<A HREF="../../javax/sip/SipProvider.html" title="interface in javax.sip"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/sip/SipListener.html" target="_top"><B>FRAMES</B></A>
<A HREF="SipListener.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 SipListener</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD>java.util.EventListener</DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>SipListener</B><DT>extends java.util.EventListener</DL>
</PRE>
<P>
This interface represents the application view to a SIP stack therefore defines the application's communication channel to the SIP stack. This interface defines the methods required by an applications to receive and process Events that are emitted by an object implementing the <A HREF="../../javax/sip/SipProvider.html" title="interface in javax.sip"><CODE>SipProvider</CODE></A>interface. <p> The Events accepted by a SipListener may be one of four types: <ul> <li><A HREF="../../javax/sip/RequestEvent.html" title="class in javax.sip"><CODE>RequestEvent</CODE></A>- these are request messages emitted as events by the SipProvider. Request events represent request messages i.e. INVITE, that are received from the network to the application via the underlying stack implementation. <li><A HREF="../../javax/sip/ResponseEvent.html" title="class in javax.sip"><CODE>ResponseEvent</CODE></A>- these are response messages emitted as events by the SipProvider. Response events represent Response messages i.e. 2xx's, that are received from the network to the application via the underlying stack implementation. <li><A HREF="../../javax/sip/TimeoutEvent.html" title="class in javax.sip"><CODE>TimeoutEvent</CODE></A>- these are timeout notifications emitted as events by the SipProvider. Timeout events represent timers expiring in the underlying SipProvider transaction state machine. These timeout's events notify the application that a retranmission is required or a transaction has timed out. <li><A HREF="../../javax/sip/IOExceptionEvent.html" title="class in javax.sip"><CODE>IOExceptionEvent</CODE></A>- these are IO Exception notifications emitted as events by the SipProvider. IOException events represent failure in the underlying SipProvider IO Layer. These IO Exception events notify the application that a failure has occured while accessing a socket. <li><A HREF="../../javax/sip/TransactionTerminatedEvent.html" title="class in javax.sip"><CODE>TransactionTerminatedEvent</CODE></A>- these are Transaction Terminated notifications emitted as events by the SipProvider. TransactionTerminated events represent a transaction termination and notify the application of the termination. <li><A HREF="../../javax/sip/DialogTerminatedEvent.html" title="class in javax.sip"><CODE>DialogTerminatedEvent</CODE></A>- these are Dialog Terminated notifications emitted as events by the SipProvider. DialogTerminated events represent a Dialog termination and notify the application of the termination. </ul> <p> An application will only receive Request, Response, Timeout, TransactionTerminated, DialogTerminated and IOException events once it has registered as an EventListener of a SipProvider. The application registers with the SipProvider by invoking the <A HREF="../../javax/sip/SipProvider.html#addSipListener(javax.sip.SipListener)"><CODE>SipProvider.addSipListener(SipListener)</CODE></A>passing itself as an argument. <p> <b>Architecture: </b> <br> This specification mandates a single SipListener per SipStack, and a unicast event model i.e. a SipProvider can only have one SipListener registered with it. This specification allows multiple SipProviders per SipStack and as such a SipListener can register with multiple SipProviders i.e there is a one-to-many relationship between a SipListener and a SipProvider. <p> Note: An application that implements the SipListener interface, may act as a proxy object and pass all events to higher level core application programming logic that is outside the scope of this specification. For example a SIP Servlet, or a JSLEE implementation can implement a back to back UA or Proxy core application respectively in there respective container environments utilizing this specification to talk the SIP protocol. <p> <b>Messaging Model: </b> <br> An application can send messages by passing <A HREF="../../javax/sip/message/Request.html" title="interface in javax.sip.message"><CODE>Request</CODE></A> and <A HREF="../../javax/sip/message/Response.html" title="interface in javax.sip.message"><CODE>Response</CODE></A>messages to that the following object: <ul> <li>Request and response messages can be sent statelessly via the SipProvider using the send methods on the <A HREF="../../javax/sip/SipProvider.html" title="interface in javax.sip"><CODE>SipProvider</CODE></A>. <li>Request messages can be sent transaction stateful via the ClientTransaction using the <A HREF="../../javax/sip/ClientTransaction.html#sendRequest()"><CODE>ClientTransaction.sendRequest()</CODE></A>method. <li>Response messages can be sent transaction stateful via the ServerTransaction using the <A HREF="../../javax/sip/ServerTransaction.html#sendResponse(javax.sip.message.Response)"><CODE>ServerTransaction.sendResponse(Response)</CODE></A> method. <li>Request messages can be sent dialog stateful via the Dialog using the <A HREF="../../javax/sip/Dialog.html#sendRequest(javax.sip.ClientTransaction)"><CODE>Dialog.sendRequest(ClientTransaction)</CODE></A>method. </ul> Although this specification provides the capabilities to send messages both statelessly and statefully it is mandated that an application will not send the same message both statefully and statelessly. The messages sent by the application are not Event's as the event model is uni-directional from the SipProvider to the SipListener, i.e. the SipListener listens for Events from the SipProvider, but the SipProvider does not listen for Events on the SipListener. The rationale is the application knows when to initiate requests and responses i.e setup a call or respond to a network event, however an application doesn't know when it will receive a network event, hence the application must listen for these network events. <p> <b>Session Negotiation </b> <br> There are special rules for message bodies of Request and Responses that contain a session description. SIP uses an offer/answer model where one User Agent sends a session description, called the offer, which contains a proposed description of the session. The other User Agent responds with another session description, called the answer, which indicates which communications means are accepted. In this specification, offers and answers can only appear in INVITE requests and Responses, and ACK. The Session Description Protocol (SDP) <a href = "http://www.ietf.org/rfc/rfc2327.txt">RFC2327 </a> MUST be supported by all user agents as a means to describe sessions, and its usage for constructing offers and answers MUST follow the procedures defined in <a href = "http://www.ietf.org/rfc/rfc3261.txt">RFC3261 </a>. The SDP protocol is described in Java by <a href = "http://www.jcp.org/en/jsr/detail?id=141">JSR 141 </a>
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>BEA Systems, NIST</DD>
<DT><B>See Also:</B><DD><A HREF="../../javax/sip/SipProvider.html" title="interface in javax.sip"><CODE>SipProvider</CODE></A>,
<A HREF="../../javax/sip/RequestEvent.html" title="class in javax.sip"><CODE>RequestEvent</CODE></A>,
<A HREF="../../javax/sip/ResponseEvent.html" title="class in javax.sip"><CODE>ResponseEvent</CODE></A>,
<A HREF="../../javax/sip/TimeoutEvent.html" title="class in javax.sip"><CODE>TimeoutEvent</CODE></A>,
<A HREF="../../javax/sip/IOExceptionEvent.html" title="class in javax.sip"><CODE>IOExceptionEvent</CODE></A>,
<A HREF="../../javax/sip/TransactionTerminatedEvent.html" title="class in javax.sip"><CODE>TransactionTerminatedEvent</CODE></A>,
<A HREF="../../javax/sip/DialogTerminatedEvent.html" title="class in javax.sip"><CODE>DialogTerminatedEvent</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/SipListener.html#processDialogTerminated(javax.sip.DialogTerminatedEvent)">processDialogTerminated</A></B>(<A HREF="../../javax/sip/DialogTerminatedEvent.html" title="class in javax.sip">DialogTerminatedEvent</A> dialogTerminatedEvent)</CODE>
<BR>
Process an asynchronously reported DialogTerminatedEvent.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -