ISipSessionListener.aidl revision 97963794af1e18674dd111e3ad344d90b16c922c
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 String 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 String 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 errorCode error code defined in {@link SipErrorCode} 80 * @param errorMessage error message 81 */ 82 void onError(in ISipSession session, int errorCode, String errorMessage); 83 84 /** 85 * Called when an error occurs during session modification negotiation. 86 * 87 * @param session the session object that carries out the transaction 88 * @param errorCode error code defined in {@link SipErrorCode} 89 * @param errorMessage error message 90 */ 91 void onCallChangeFailed(in ISipSession session, int errorCode, 92 String errorMessage); 93 94 /** 95 * Called when a registration request is sent. 96 * 97 * @param session the session object that carries out the transaction 98 */ 99 void onRegistering(in ISipSession session); 100 101 /** 102 * Called when registration is successfully done. 103 * 104 * @param session the session object that carries out the transaction 105 * @param duration duration in second before the registration expires 106 */ 107 void onRegistrationDone(in ISipSession session, int duration); 108 109 /** 110 * Called when the registration fails. 111 * 112 * @param session the session object that carries out the transaction 113 * @param errorCode error code defined in {@link SipErrorCode} 114 * @param errorMessage error message 115 */ 116 void onRegistrationFailed(in ISipSession session, int errorCode, 117 String errorMessage); 118 119 /** 120 * Called when the registration gets timed out. 121 * 122 * @param session the session object that carries out the transaction 123 */ 124 void onRegistrationTimeout(in ISipSession session); 125} 126