blob: 15234e5c0e92a90bc1eccb277d0c3bcfa14e21ab [file] [log] [blame]
Wink Savillef8458ff2014-06-25 16:08:02 -07001/*
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
Libin.Tang@motorola.comc47b18f2014-08-23 18:12:51 -050019import android.os.Message;
Brad Ebinger6ed4ee62018-01-11 10:27:43 -080020import android.telephony.ims.aidl.IImsCallSessionListener;
21
Brad Ebinger0e370b42018-01-22 13:51:52 -080022import android.telephony.ims.ImsCallProfile;
23import android.telephony.ims.ImsStreamMediaProfile;
Andrew Lee752217b2014-08-08 01:40:14 -070024import com.android.ims.internal.IImsVideoCallProvider;
Wink Savillef8458ff2014-06-25 16:08:02 -070025
26/**
27 * An IMS session that is associated with a SIP dialog which is established from/to
28 * INVITE request or a mid-call transaction to control the session.
29 * {@hide}
30 */
31interface IImsCallSession {
32 /**
33 * Closes the object. This object is not usable after being closed.
34 */
35 void close();
36
37 /**
38 * Gets the call ID of the session.
39 *
40 * @return the call ID
41 */
42 String getCallId();
43
44 /**
45 * Gets the call profile that this session is associated with
46 *
47 * @return the call profile that this session is associated with
48 */
49 ImsCallProfile getCallProfile();
50
51 /**
52 * Gets the local call profile that this session is associated with
53 *
54 * @return the local call profile that this session is associated with
55 */
56 ImsCallProfile getLocalCallProfile();
57
58 /**
Shriram Ganesh482e6da2014-10-13 11:31:50 -070059 * Gets the remote call profile that this session is associated with
60 *
61 * @return the remote call profile that this session is associated with
62 */
63 ImsCallProfile getRemoteCallProfile();
64
65 /**
Wink Savillef8458ff2014-06-25 16:08:02 -070066 * Gets the value associated with the specified property of this session.
67 *
68 * @return the string value associated with the specified property
69 */
70 String getProperty(String name);
71
72 /**
73 * Gets the session state. The value returned must be one of the states in
74 * {@link ImsCallSession#State}.
75 *
76 * @return the session state
77 */
78 int getState();
79
80 /**
81 * Checks if the session is in a call.
82 *
83 * @return true if the session is in a call
84 */
85 boolean isInCall();
86
87 /**
88 * Sets the listener to listen to the session events. A {@link IImsCallSession}
89 * can only hold one listener at a time. Subsequent calls to this method
90 * override the previous listener.
91 *
92 * @param listener to listen to the session events of this object
93 */
94 void setListener(in IImsCallSessionListener listener);
95
96 /**
97 * Mutes or unmutes the mic for the active call.
98 *
99 * @param muted true if the call is muted, false otherwise
100 */
101 void setMute(boolean muted);
102
103 /**
104 * Initiates an IMS call with the specified target and call profile.
105 * The session listener is called back upon defined session events.
106 * The method is only valid to call when the session state is in
107 * {@link ImsCallSession#State#IDLE}.
108 *
109 * @param callee dialed string to make the call to
110 * @param profile call profile to make the call with the specified service type,
111 * call type and media information
112 * @see Listener#callSessionStarted, Listener#callSessionStartFailed
113 */
114 void start(String callee, in ImsCallProfile profile);
115
116 /**
117 * Initiates an IMS call with the specified participants and call profile.
118 * The session listener is called back upon defined session events.
119 * The method is only valid to call when the session state is in
120 * {@link ImsCallSession#State#IDLE}.
121 *
122 * @param participants participant list to initiate an IMS conference call
123 * @param profile call profile to make the call with the specified service type,
124 * call type and media information
125 * @see Listener#callSessionStarted, Listener#callSessionStartFailed
126 */
127 void startConference(in String[] participants, in ImsCallProfile profile);
128
129 /**
130 * Accepts an incoming call or session update.
131 *
132 * @param callType call type specified in {@link ImsCallProfile} to be answered
133 * @param profile stream media profile {@link ImsStreamMediaProfile} to be answered
134 * @see Listener#callSessionStarted
135 */
136 void accept(int callType, in ImsStreamMediaProfile profile);
137
138 /**
Pooja Jaind34698d2017-12-28 14:15:31 +0530139 * Deflects an incoming call.
140 *
141 * @param deflectNumber number to deflect the call
142 */
143 void deflect(String deflectNumber);
144
145 /**
Wink Savillef8458ff2014-06-25 16:08:02 -0700146 * Rejects an incoming call or session update.
147 *
148 * @param reason reason code to reject an incoming call
149 * @see Listener#callSessionStartFailed
150 */
151 void reject(int reason);
152
153 /**
154 * Terminates a call.
155 *
156 * @see Listener#callSessionTerminated
157 */
158 void terminate(int reason);
159
160 /**
161 * Puts a call on hold. When it succeeds, {@link Listener#callSessionHeld} is called.
162 *
163 * @param profile stream media profile {@link ImsStreamMediaProfile} to hold the call
164 * @see Listener#callSessionHeld, Listener#callSessionHoldFailed
165 */
166 void hold(in ImsStreamMediaProfile profile);
167
168 /**
169 * Continues a call that's on hold. When it succeeds, {@link Listener#callSessionResumed}
170 * is called.
171 *
172 * @param profile stream media profile {@link ImsStreamMediaProfile} to resume the call
173 * @see Listener#callSessionResumed, Listener#callSessionResumeFailed
174 */
175 void resume(in ImsStreamMediaProfile profile);
176
177 /**
Tyler Gunnf764e802014-10-24 14:06:40 -0700178 * Merges the active & hold call. When the merge starts,
179 * {@link Listener#callSessionMergeStarted} is called.
180 * {@link Listener#callSessionMergeComplete} is called if the merge is successful, and
181 * {@link Listener#callSessionMergeFailed} is called if the merge fails.
Wink Savillef8458ff2014-06-25 16:08:02 -0700182 *
Tyler Gunnf764e802014-10-24 14:06:40 -0700183 * @see Listener#callSessionMergeStarted, Listener#callSessionMergeComplete,
184 * Listener#callSessionMergeFailed
Wink Savillef8458ff2014-06-25 16:08:02 -0700185 */
186 void merge();
187
188 /**
189 * Updates the current call's properties (ex. call mode change: video upgrade / downgrade).
190 *
191 * @param callType call type specified in {@link ImsCallProfile} to be updated
192 * @param profile stream media profile {@link ImsStreamMediaProfile} to be updated
193 * @see Listener#callSessionUpdated, Listener#callSessionUpdateFailed
194 */
195 void update(int callType, in ImsStreamMediaProfile profile);
196
197 /**
198 * Extends this call to the conference call with the specified recipients.
199 *
Wink Saville0a493e82014-06-26 04:50:00 -0700200 * @param participants participant list to be invited to the conference call after extending the call
Wink Savillef8458ff2014-06-25 16:08:02 -0700201 * @see Listener#sessionConferenceExtened, Listener#sessionConferenceExtendFailed
202 */
203 void extendToConference(in String[] participants);
204
205 /**
206 * Requests the conference server to invite an additional participants to the conference.
207 *
Wink Saville0a493e82014-06-26 04:50:00 -0700208 * @param participants participant list to be invited to the conference call
Wink Savillef8458ff2014-06-25 16:08:02 -0700209 * @see Listener#sessionInviteParticipantsRequestDelivered,
210 * Listener#sessionInviteParticipantsRequestFailed
211 */
212 void inviteParticipants(in String[] participants);
213
214 /**
215 * Requests the conference server to remove the specified participants from the conference.
216 *
217 * @param participants participant list to be removed from the conference call
218 * @see Listener#sessionRemoveParticipantsRequestDelivered,
219 * Listener#sessionRemoveParticipantsRequestFailed
220 */
221 void removeParticipants(in String[] participants);
222
223 /**
224 * Sends a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2833</a>,
225 * event 0 ~ 9 maps to decimal value 0 ~ 9, '*' to 10, '#' to 11, event 'A' ~ 'D' to 12 ~ 15,
226 * and event flash to 16. Currently, event flash is not supported.
227 *
Libin.Tang@motorola.comc47b18f2014-08-23 18:12:51 -0500228 * @param c the DTMF to send. '0' ~ '9', 'A' ~ 'D', '*', '#' are valid inputs.
229 * @param result.
Wink Savillef8458ff2014-06-25 16:08:02 -0700230 */
Libin.Tang@motorola.comc47b18f2014-08-23 18:12:51 -0500231 void sendDtmf(char c, in Message result);
Wink Savillef8458ff2014-06-25 16:08:02 -0700232
233 /**
Uma Maheswari Ramalingama8af6bb2014-12-05 16:39:57 -0800234 * Start a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2833</a>,
235 * event 0 ~ 9 maps to decimal value 0 ~ 9, '*' to 10, '#' to 11, event 'A' ~ 'D' to 12 ~ 15,
236 * and event flash to 16. Currently, event flash is not supported.
237 *
238 * @param c the DTMF to send. '0' ~ '9', 'A' ~ 'D', '*', '#' are valid inputs.
239 */
240 void startDtmf(char c);
241
242 /**
243 * Stop a DTMF code.
244 */
245 void stopDtmf();
246
247 /**
Wink Savillef8458ff2014-06-25 16:08:02 -0700248 * Sends an USSD message.
249 *
250 * @param ussdMessage USSD message to send
251 */
252 void sendUssd(String ussdMessage);
Andrew Lee752217b2014-08-08 01:40:14 -0700253
254 /**
255 * Returns a binder for the video call provider implementation contained within the IMS service
256 * process. This binder is used by the VideoCallProvider subclass in Telephony which
257 * intermediates between the propriety implementation and Telecomm/InCall.
258 */
259 IImsVideoCallProvider getVideoCallProvider();
Tyler Gunn6a7ed1e2014-10-22 11:26:40 -0700260
261 /**
262 * Determines if the current session is multiparty.
263 * @return {@code True} if the session is multiparty.
264 */
265 boolean isMultiparty();
Anju Mathapati7e177da2017-01-24 11:58:28 -0800266
267 /**
268 * Device issues RTT modify request
269 * @param toProfile The profile with requested changes made
270 */
271 void sendRttModifyRequest(in ImsCallProfile toProfile);
272
273 /*
274 * Device responds to Remote RTT modify request
275 * @param status true : Accepted the request
276 * false : Declined the request
277 */
278 void sendRttModifyResponse(in boolean status);
279
280 /*
281 * Device sends RTT message
282 * @param rttMessage RTT message to be sent
283 */
284 void sendRttMessage(in String rttMessage);
Wink Savillef8458ff2014-06-25 16:08:02 -0700285}