summaryrefslogtreecommitdiffstats
path: root/voip/java/android/net/sip/ISipSessionListener.aidl
blob: 690700c0f8a962bcab6cbb85365d251ce0838115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.sip;

import android.net.sip.ISipSession;
import android.net.sip.SipProfile;

/**
 * Listener class to listen to SIP session events.
 * @hide
 */
interface ISipSessionListener {
    /**
     * Called when an INVITE request is sent to initiate a new call.
     *
     * @param session the session object that carries out the transaction
     */
    void onCalling(in ISipSession session);

    /**
     * Called when an INVITE request is received.
     *
     * @param session the session object that carries out the transaction
     * @param caller the SIP profile of the caller
     * @param sessionDescription the caller's session description
     */
    void onRinging(in ISipSession session, in SipProfile caller,
            String sessionDescription);

    /**
     * Called when a RINGING response is received for the INVITE request sent
     *
     * @param session the session object that carries out the transaction
     */
    void onRingingBack(in ISipSession session);

    /**
     * Called when the session is established.
     *
     * @param session the session object that is associated with the dialog
     * @param sessionDescription the peer's session description
     */
    void onCallEstablished(in ISipSession session,
            String sessionDescription);

    /**
     * Called when the session is terminated.
     *
     * @param session the session object that is associated with the dialog
     */
    void onCallEnded(in ISipSession session);

    /**
     * Called when the peer is busy during session initialization.
     *
     * @param session the session object that carries out the transaction
     */
    void onCallBusy(in ISipSession session);

    /**
     * Called when the call is being transferred to a new one.
     *
     * @param newSession the new session that the call will be transferred to
     * @param sessionDescription the new peer's session description
     */
    void onCallTransferring(in ISipSession newSession, String sessionDescription);

    /**
     * Called when an error occurs during session initialization and
     * termination.
     *
     * @param session the session object that carries out the transaction
     * @param errorCode error code defined in {@link SipErrorCode}
     * @param errorMessage error message
     */
    void onError(in ISipSession session, int errorCode, String errorMessage);

    /**
     * Called when an error occurs during session modification negotiation.
     *
     * @param session the session object that carries out the transaction
     * @param errorCode error code defined in {@link SipErrorCode}
     * @param errorMessage error message
     */
    void onCallChangeFailed(in ISipSession session, int errorCode,
            String errorMessage);

    /**
     * Called when a registration request is sent.
     *
     * @param session the session object that carries out the transaction
     */
    void onRegistering(in ISipSession session);

    /**
     * Called when registration is successfully done.
     *
     * @param session the session object that carries out the transaction
     * @param duration duration in second before the registration expires
     */
    void onRegistrationDone(in ISipSession session, int duration);

    /**
     * Called when the registration fails.
     *
     * @param session the session object that carries out the transaction
     * @param errorCode error code defined in {@link SipErrorCode}
     * @param errorMessage error message
     */
    void onRegistrationFailed(in ISipSession session, int errorCode,
            String errorMessage);

    /**
     * Called when the registration gets timed out.
     *
     * @param session the session object that carries out the transaction
     */
    void onRegistrationTimeout(in ISipSession session);
}