Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 1 | /* |
Hung-ying Tyan | 7b8a6ad | 2010-05-21 18:29:32 +0800 | [diff] [blame] | 2 | * Copyright (C) 2010 The Android Open Source Project |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 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 | |
| 17 | package android.net.sip; |
| 18 | |
| 19 | import android.net.sip.ISipSession; |
| 20 | import android.net.sip.SipProfile; |
| 21 | |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 22 | /** |
| 23 | * Listener class to listen to SIP session events. |
| 24 | * @hide |
| 25 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 26 | interface ISipSessionListener { |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 32 | void onCalling(in ISipSession session); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 41 | void onRinging(in ISipSession session, in SipProfile caller, |
| 42 | in byte[] sessionDescription); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 49 | void onRingingBack(in ISipSession session); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 57 | void onCallEstablished(in ISipSession session, |
| 58 | in byte[] sessionDescription); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * Called when the session is terminated. |
| 62 | * |
| 63 | * @param session the session object that is associated with the dialog |
| 64 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 65 | void onCallEnded(in ISipSession session); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 72 | void onCallBusy(in ISipSession session); |
Hung-ying Tyan | dfec511 | 2010-04-29 14:39:43 +0800 | [diff] [blame] | 73 | |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 82 | void onError(in ISipSession session, String errorClass, |
| 83 | String errorMessage); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | dfec511 | 2010-04-29 14:39:43 +0800 | [diff] [blame] | 92 | void onCallChangeFailed(in ISipSession session, String errorClass, |
| 93 | String errorMessage); |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 94 | |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 95 | /** |
| 96 | * Called when a registration request is sent. |
| 97 | * |
| 98 | * @param session the session object that carries out the transaction |
| 99 | */ |
Hung-ying Tyan | d52d2ea | 2010-05-10 18:15:10 +0800 | [diff] [blame] | 100 | void onRegistering(in ISipSession session); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 366ce21 | 2010-04-13 13:13:00 +0800 | [diff] [blame] | 108 | void onRegistrationDone(in ISipSession session, int duration); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 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 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 117 | void onRegistrationFailed(in ISipSession session, String errorClass, |
| 118 | String errorMessage); |
Hung-ying Tyan | fc11383 | 2010-05-17 20:02:24 +0800 | [diff] [blame] | 119 | |
| 120 | /** |
| 121 | * Called when the registration gets timed out. |
| 122 | * |
| 123 | * @param session the session object that carries out the transaction |
| 124 | */ |
Hung-ying Tyan | 4cfa749 | 2010-04-08 18:47:23 +0800 | [diff] [blame] | 125 | void onRegistrationTimeout(in ISipSession session); |
| 126 | } |