IImsCallSession.aidl revision 0a493e87224e4b337a89d9fbaaa604d7a8c5bd5f
1/* 2 * Copyright (c) 2013 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 com.android.ims.internal; 18 19import com.android.ims.ImsCallProfile; 20import com.android.ims.ImsStreamMediaProfile; 21import com.android.ims.internal.IImsCallSessionListener; 22 23/** 24 * An IMS session that is associated with a SIP dialog which is established from/to 25 * INVITE request or a mid-call transaction to control the session. 26 * {@hide} 27 */ 28interface IImsCallSession { 29 /** 30 * Closes the object. This object is not usable after being closed. 31 */ 32 void close(); 33 34 /** 35 * Gets the call ID of the session. 36 * 37 * @return the call ID 38 */ 39 String getCallId(); 40 41 /** 42 * Gets the call profile that this session is associated with 43 * 44 * @return the call profile that this session is associated with 45 */ 46 ImsCallProfile getCallProfile(); 47 48 /** 49 * Gets the local call profile that this session is associated with 50 * 51 * @return the local call profile that this session is associated with 52 */ 53 ImsCallProfile getLocalCallProfile(); 54 55 /** 56 * Gets the value associated with the specified property of this session. 57 * 58 * @return the string value associated with the specified property 59 */ 60 String getProperty(String name); 61 62 /** 63 * Gets the session state. The value returned must be one of the states in 64 * {@link ImsCallSession#State}. 65 * 66 * @return the session state 67 */ 68 int getState(); 69 70 /** 71 * Checks if the session is in a call. 72 * 73 * @return true if the session is in a call 74 */ 75 boolean isInCall(); 76 77 /** 78 * Sets the listener to listen to the session events. A {@link IImsCallSession} 79 * can only hold one listener at a time. Subsequent calls to this method 80 * override the previous listener. 81 * 82 * @param listener to listen to the session events of this object 83 */ 84 void setListener(in IImsCallSessionListener listener); 85 86 /** 87 * Mutes or unmutes the mic for the active call. 88 * 89 * @param muted true if the call is muted, false otherwise 90 */ 91 void setMute(boolean muted); 92 93 /** 94 * Initiates an IMS call with the specified target and call profile. 95 * The session listener is called back upon defined session events. 96 * The method is only valid to call when the session state is in 97 * {@link ImsCallSession#State#IDLE}. 98 * 99 * @param callee dialed string to make the call to 100 * @param profile call profile to make the call with the specified service type, 101 * call type and media information 102 * @see Listener#callSessionStarted, Listener#callSessionStartFailed 103 */ 104 void start(String callee, in ImsCallProfile profile); 105 106 /** 107 * Initiates an IMS call with the specified participants and call profile. 108 * The session listener is called back upon defined session events. 109 * The method is only valid to call when the session state is in 110 * {@link ImsCallSession#State#IDLE}. 111 * 112 * @param participants participant list to initiate an IMS conference call 113 * @param profile call profile to make the call with the specified service type, 114 * call type and media information 115 * @see Listener#callSessionStarted, Listener#callSessionStartFailed 116 */ 117 void startConference(in String[] participants, in ImsCallProfile profile); 118 119 /** 120 * Accepts an incoming call or session update. 121 * 122 * @param callType call type specified in {@link ImsCallProfile} to be answered 123 * @param profile stream media profile {@link ImsStreamMediaProfile} to be answered 124 * @see Listener#callSessionStarted 125 */ 126 void accept(int callType, in ImsStreamMediaProfile profile); 127 128 /** 129 * Rejects an incoming call or session update. 130 * 131 * @param reason reason code to reject an incoming call 132 * @see Listener#callSessionStartFailed 133 */ 134 void reject(int reason); 135 136 /** 137 * Terminates a call. 138 * 139 * @see Listener#callSessionTerminated 140 */ 141 void terminate(int reason); 142 143 /** 144 * Puts a call on hold. When it succeeds, {@link Listener#callSessionHeld} is called. 145 * 146 * @param profile stream media profile {@link ImsStreamMediaProfile} to hold the call 147 * @see Listener#callSessionHeld, Listener#callSessionHoldFailed 148 */ 149 void hold(in ImsStreamMediaProfile profile); 150 151 /** 152 * Continues a call that's on hold. When it succeeds, {@link Listener#callSessionResumed} 153 * is called. 154 * 155 * @param profile stream media profile {@link ImsStreamMediaProfile} to resume the call 156 * @see Listener#callSessionResumed, Listener#callSessionResumeFailed 157 */ 158 void resume(in ImsStreamMediaProfile profile); 159 160 /** 161 * Merges the active & hold call. When it succeeds, {@link Listener#callSessionMerged} 162 * is called. 163 * 164 * @see Listener#callSessionMerged, Listener#callSessionMergeFailed 165 */ 166 void merge(); 167 168 /** 169 * Updates the current call's properties (ex. call mode change: video upgrade / downgrade). 170 * 171 * @param callType call type specified in {@link ImsCallProfile} to be updated 172 * @param profile stream media profile {@link ImsStreamMediaProfile} to be updated 173 * @see Listener#callSessionUpdated, Listener#callSessionUpdateFailed 174 */ 175 void update(int callType, in ImsStreamMediaProfile profile); 176 177 /** 178 * Extends this call to the conference call with the specified recipients. 179 * 180 * @param participants participant list to be invited to the conference call after extending the call 181 * @see Listener#sessionConferenceExtened, Listener#sessionConferenceExtendFailed 182 */ 183 void extendToConference(in String[] participants); 184 185 /** 186 * Requests the conference server to invite an additional participants to the conference. 187 * 188 * @param participants participant list to be invited to the conference call 189 * @see Listener#sessionInviteParticipantsRequestDelivered, 190 * Listener#sessionInviteParticipantsRequestFailed 191 */ 192 void inviteParticipants(in String[] participants); 193 194 /** 195 * Requests the conference server to remove the specified participants from the conference. 196 * 197 * @param participants participant list to be removed from the conference call 198 * @see Listener#sessionRemoveParticipantsRequestDelivered, 199 * Listener#sessionRemoveParticipantsRequestFailed 200 */ 201 void removeParticipants(in String[] participants); 202 203 /** 204 * Sends a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2833</a>, 205 * event 0 ~ 9 maps to decimal value 0 ~ 9, '*' to 10, '#' to 11, event 'A' ~ 'D' to 12 ~ 15, 206 * and event flash to 16. Currently, event flash is not supported. 207 * 208 * @param code the DTMF to send. Value 0 to 15 (inclusive) are valid inputs. 209 * @param duration the interval in milli-seconds between the DTMFs 210 */ 211 void sendDtmf(int code, int duration); 212 213 /** 214 * Sends an USSD message. 215 * 216 * @param ussdMessage USSD message to send 217 */ 218 void sendUssd(String ussdMessage); 219} 220