blob: 8570958351c543ed6a3cdd875ab40bfb82097bc0 [file] [log] [blame]
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +08001/*
Hung-ying Tyan7b8a6ad2010-05-21 18:29:32 +08002 * Copyright (C) 2010 The Android Open Source Project
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.net.sip;
18
19import android.net.sip.ISipSession;
20import android.net.sip.SipProfile;
21
Hung-ying Tyanfc113832010-05-17 20:02:24 +080022/**
23 * Listener class to listen to SIP session events.
24 * @hide
25 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080026interface ISipSessionListener {
Hung-ying Tyanfc113832010-05-17 20:02:24 +080027 /**
28 * Called when an INVITE request is sent to initiate a new call.
29 *
30 * @param session the session object that carries out the transaction
31 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080032 void onCalling(in ISipSession session);
Hung-ying Tyanfc113832010-05-17 20:02:24 +080033
34 /**
35 * Called when an INVITE request is received.
36 *
37 * @param session the session object that carries out the transaction
38 * @param caller the SIP profile of the caller
39 * @param sessionDescription the caller's session description
40 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080041 void onRinging(in ISipSession session, in SipProfile caller,
42 in byte[] sessionDescription);
Hung-ying Tyanfc113832010-05-17 20:02:24 +080043
44 /**
45 * Called when a RINGING response is received for the INVITE request sent
46 *
47 * @param session the session object that carries out the transaction
48 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080049 void onRingingBack(in ISipSession session);
Hung-ying Tyanfc113832010-05-17 20:02:24 +080050
51 /**
52 * Called when the session is established.
53 *
54 * @param session the session object that is associated with the dialog
55 * @param sessionDescription the peer's session description
56 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080057 void onCallEstablished(in ISipSession session,
58 in byte[] sessionDescription);
Hung-ying Tyanfc113832010-05-17 20:02:24 +080059
60 /**
61 * Called when the session is terminated.
62 *
63 * @param session the session object that is associated with the dialog
64 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080065 void onCallEnded(in ISipSession session);
Hung-ying Tyanfc113832010-05-17 20:02:24 +080066
67 /**
68 * Called when the peer is busy during session initialization.
69 *
70 * @param session the session object that carries out the transaction
71 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080072 void onCallBusy(in ISipSession session);
Hung-ying Tyandfec5112010-04-29 14:39:43 +080073
Hung-ying Tyanfc113832010-05-17 20:02:24 +080074 /**
75 * Called when an error occurs during session initialization and
76 * termination.
77 *
78 * @param session the session object that carries out the transaction
79 * @param errorClass name of the exception class
80 * @param errorMessage error message
81 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080082 void onError(in ISipSession session, String errorClass,
83 String errorMessage);
Hung-ying Tyanfc113832010-05-17 20:02:24 +080084
85 /**
86 * Called when an error occurs during session modification negotiation.
87 *
88 * @param session the session object that carries out the transaction
89 * @param errorClass name of the exception class
90 * @param errorMessage error message
91 */
Hung-ying Tyandfec5112010-04-29 14:39:43 +080092 void onCallChangeFailed(in ISipSession session, String errorClass,
93 String errorMessage);
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +080094
Hung-ying Tyanfc113832010-05-17 20:02:24 +080095 /**
96 * Called when a registration request is sent.
97 *
98 * @param session the session object that carries out the transaction
99 */
Hung-ying Tyand52d2ea2010-05-10 18:15:10 +0800100 void onRegistering(in ISipSession session);
Hung-ying Tyanfc113832010-05-17 20:02:24 +0800101
102 /**
103 * Called when registration is successfully done.
104 *
105 * @param session the session object that carries out the transaction
106 * @param duration duration in second before the registration expires
107 */
Hung-ying Tyan366ce212010-04-13 13:13:00 +0800108 void onRegistrationDone(in ISipSession session, int duration);
Hung-ying Tyanfc113832010-05-17 20:02:24 +0800109
110 /**
111 * Called when the registration fails.
112 *
113 * @param session the session object that carries out the transaction
114 * @param errorClass name of the exception class
115 * @param errorMessage error message
116 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +0800117 void onRegistrationFailed(in ISipSession session, String errorClass,
118 String errorMessage);
Hung-ying Tyanfc113832010-05-17 20:02:24 +0800119
120 /**
121 * Called when the registration gets timed out.
122 *
123 * @param session the session object that carries out the transaction
124 */
Hung-ying Tyan4cfa7492010-04-08 18:47:23 +0800125 void onRegistrationTimeout(in ISipSession session);
126}