01: /*
02: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
03: * Reserved. Use is subject to license terms.
04: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License version
08: * 2 only, as published by the Free Software Foundation.
09: *
10: * This program is distributed in the hope that it will be useful, but
11: * WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * General Public License version 2 for more details (a copy is
14: * included at /legal/license.txt).
15: *
16: * You should have received a copy of the GNU General Public License
17: * version 2 along with this work; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
22: * Clara, CA 95054 or visit www.sun.com if you need additional
23: * information or have any questions.
24: */
25:
26: package javax.microedition.sip;
27:
28: /**
29: * SipDialog represents one SIP Dialog.
30: * @see JSR180 spec, v 1.0.1, p 42-47
31: *
32: */
33: public interface SipDialog {
34: /**
35: * no response or error response (3xx-6xx) received (or sent).
36: * Also if the dialog is terminated with BYE or un-SUBSCRIBE.
37: */
38: public static final byte TERMINATED = 0;
39: /**
40: * provisional 101-199 response received (or sent)
41: * Method getNewClientConnection() can not be called in this state.
42: */
43: public static final byte EARLY = 1;
44: /**
45: * final 2xx response received (or sent)
46: * All methods available.
47: */
48: public static final byte CONFIRMED = 2;
49:
50: /**
51: * Returns new SipClientConnection in this dialog.
52: * @see JSR180 spec, v 1.0.1, p 45
53: *
54: * @param method - given method
55: * @return SipClientConnection with preset headers.
56: * @throws IllegalArgumentException - if the method is invalid
57: * @throws SipException - INVALID_STATE if the new connection can not be
58: * established in the current state of dialog.
59: */
60: public javax.microedition.sip.SipClientConnection getNewClientConnection(
61: java.lang.String method) throws IllegalArgumentException,
62: SipException;
63:
64: /**
65: * Does the given SipConnection belong to this dialog.
66: * @param sc - SipConnection to be checked, can be either
67: * SipClientConnection or SipServerConnection
68: * @return true if the SipConnection belongs to the this dialog.
69: * Returns false
70: * if the connection is not part of this dialog or the dialog is terminated.
71: */
72: public boolean isSameDialog(javax.microedition.sip.SipConnection sc);
73:
74: /**
75: * Returns the state of the SIP Dialog.
76: * @return dialog state byte number.
77: */
78: public byte getState();
79:
80: /**
81: * Returns the ID of the SIP Dialog.
82: * @return Dialog ID (Call-ID + remote tag + local tag).
83: * Returns null if the dialog is terminated.
84: */
85: public java.lang.String getDialogID();
86: }
|