ISipSessionListener.aidl revision 363c2ab82cca4f095e9e0c8465e28f6d27a24bf8
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
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
22/**
23 * Listener class to listen to SIP session events.
24 * @hide
25 */
26interface ISipSessionListener {
27    /**
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     */
32    void onCalling(in ISipSession session);
33
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     */
41    void onRinging(in ISipSession session, in SipProfile caller,
42            in byte[] sessionDescription);
43
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     */
49    void onRingingBack(in ISipSession session);
50
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     */
57    void onCallEstablished(in ISipSession session,
58            in byte[] sessionDescription);
59
60    /**
61     * Called when the session is terminated.
62     *
63     * @param session the session object that is associated with the dialog
64     */
65    void onCallEnded(in ISipSession session);
66
67    /**
68     * Called when the peer is busy during session initialization.
69     *
70     * @param session the session object that carries out the transaction
71     */
72    void onCallBusy(in ISipSession session);
73
74    /**
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     */
82    void onError(in ISipSession session, String errorClass,
83            String errorMessage);
84
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     */
92    void onCallChangeFailed(in ISipSession session, String errorClass,
93            String errorMessage);
94
95    /**
96     * Called when a registration request is sent.
97     *
98     * @param session the session object that carries out the transaction
99     */
100    void onRegistering(in ISipSession session);
101
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     */
108    void onRegistrationDone(in ISipSession session, int duration);
109
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     */
117    void onRegistrationFailed(in ISipSession session, String errorClass,
118            String errorMessage);
119
120    /**
121     * Called when the registration gets timed out.
122     *
123     * @param session the session object that carries out the transaction
124     */
125    void onRegistrationTimeout(in ISipSession session);
126}
127