1/*
2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef CALL_MANAGER_ERRORS_H
17#define CALL_MANAGER_ERRORS_H
18
19#include "telephony_errors.h"
20
21namespace OHOS {
22namespace Telephony {
23/**
24 * @brief Indicates the error code of CallManager.
25 */
26enum CallManagerErrorCode {
27    /**
28     * Indicates an invalid slot id.
29     */
30    CALL_ERR_INVALID_SLOT_ID = CALL_ERR_OFFSET,
31    /**
32     * Indicates an invalid call id.
33     */
34    CALL_ERR_INVALID_CALLID,
35    /**
36     * Indicates the phone number is empty.
37     */
38    CALL_ERR_PHONE_NUMBER_EMPTY,
39    /**
40     * Indicates number length out of range.
41     */
42    CALL_ERR_NUMBER_OUT_OF_RANGE,
43    /**
44     * Indicates network type is not supported.
45     */
46    CALL_ERR_UNSUPPORTED_NETWORK_TYPE,
47    /**
48     * Indicates an invalid dial scene, which is used when the dial scene fails to be obtained.
49     */
50    CALL_ERR_INVALID_DIAL_SCENE,
51    /**
52     * Indicates an invalid video state, which is used when the video state fails to be obtained.
53     */
54    CALL_ERR_INVALID_VIDEO_STATE,
55    /**
56     * Indicates an invalid dial type, which is used when the dial type fails to be obtained.
57     */
58    CALL_ERR_UNKNOW_DIAL_TYPE,
59    /**
60     * Indicates an invalid call type, which is used when the call type fails to be obtained.
61     */
62    CALL_ERR_UNKNOW_CALL_TYPE,
63    /**
64     * Indicates the call type is illegal.
65     */
66    CALL_ERR_VIDEO_ILLEGAL_CALL_TYPE,
67    /**
68     * Indicates the call state is duplicate.
69     */
70    CALL_ERR_NOT_NEW_STATE,
71    /**
72     * Indicates the call object is null.
73     */
74    CALL_ERR_CALL_OBJECT_IS_NULL,
75    /**
76     * Indicates there is already a call.
77     */
78    CALL_ERR_DIAL_IS_BUSY,
79    /**
80     * Indicates current call is not activated.
81     */
82    CALL_ERR_CALL_IS_NOT_ACTIVATED,
83    /**
84     * Indicates current call is not on holding state.
85     */
86    CALL_ERR_CALL_IS_NOT_ON_HOLDING,
87    /**
88     * Indicates current call operation is not allowed.
89     */
90    CALL_ERR_ILLEGAL_CALL_OPERATION,
91    /**
92     * Indicates the current call state is mismatch with the expected call state.
93     */
94    CALL_ERR_CALL_STATE_MISMATCH_OPERATION,
95    /**
96     * Indicates the conference call is not exists.
97     */
98    CALL_ERR_CONFERENCE_NOT_EXISTS,
99    /**
100     * Indicates the number of calls in the conference exceeds limits.
101     */
102    CALL_ERR_CONFERENCE_CALL_EXCEED_LIMIT,
103    /**
104     * Indicates call state error.
105     */
106    CALL_ERR_CALL_STATE,
107    /**
108     * Indicates the call count exceeds limit.
109     */
110    CALL_ERR_CALL_COUNTS_EXCEED_LIMIT,
111    /**
112     * Indicates the connection is null.
113     */
114    CALL_ERR_CALL_CONNECTION_NOT_EXIST,
115    /**
116     * Indicates radio state error.
117     */
118    CALL_ERR_GET_RADIO_STATE_FAILED,
119    /**
120     * Indicates emergency call not allowed to join conference.
121     */
122    CALL_ERR_EMERGENCY_UNSUPPORT_CONFERENCEABLE,
123    /**
124     * Indicates the device is currently not ringing.
125     */
126    CALL_ERR_PHONE_ANSWER_IS_BUSY,
127    /**
128     * Indicates this call has existed.
129     */
130    CALL_ERR_PHONE_CALL_ALREADY_EXISTS,
131    /**
132     * Indicates the number of phone calls less than two.
133     */
134    CALL_ERR_PHONE_CALLS_TOO_FEW,
135    /**
136     * Indicates unexpected type event occurs.
137     */
138    CALL_ERR_PHONE_TYPE_UNEXPECTED,
139    /**
140     * Indicates notify call state failed.
141     */
142    CALL_ERR_PHONE_CALLSTATE_NOTIFY_FAILED,
143    /**
144     * Indicates unknown call media type.
145     */
146    CALL_ERR_VIDEO_ILLEGAL_MEDIA_TYPE,
147    /**
148     * Indicates video update in progress.
149     */
150    CALL_ERR_VIDEO_IN_PROGRESS,
151    /**
152     * Indicates illegal media state.
153     */
154    CALL_ERR_VIDEO_ILLEAGAL_SCENARIO,
155    /**
156     * Indicates video mode change notify failed.
157     */
158    CALL_ERR_VIDEO_MODE_CHANGE_NOTIFY_FAILED,
159    /**
160     * Indicates dial failed.
161     */
162    CALL_ERR_DIAL_FAILED,
163    /**
164     * Indicates answer call failed.
165     */
166    CALL_ERR_ANSWER_FAILED,
167    /**
168     * Indicates reject call failed.
169     */
170    CALL_ERR_REJECT_FAILED,
171    /**
172     * Indicates holdcall call failed.
173     */
174    CALL_ERR_HOLD_FAILED,
175    /**
176     * Indicates unHoldCall call failed.
177     */
178    CALL_ERR_UNHOLD_FAILED,
179    /**
180     * Indicates hangUp call failed.
181     */
182    CALL_ERR_HANGUP_FAILED,
183    /**
184     * Indicates separate conference failed.
185     */
186    CALL_ERR_CONFERENCE_SEPERATE_FAILED,
187    /**
188     * Indicates conference call is not active.
189     */
190    CALL_ERR_CONFERENCE_CALL_IS_NOT_ACTIVE,
191    /**
192     * Indicates the call is not in the conference.
193     */
194    CALL_ERR_THE_CALL_IS_NOT_IN_THE_CONFERENCE,
195    /**
196     * Indicates start Rtt failed.
197     */
198    CALL_ERR_STARTRTT_FAILED,
199    /**
200     * Indicates stop Rtt failed.
201     */
202    CALL_ERR_STOPRTT_FAILED,
203    /**
204     * Indicates volte is not supported.
205     */
206    CALL_ERR_VOLTE_NOT_SUPPORT,
207    /**
208     * Indicates volte provisioning disabled.
209     */
210    CALL_ERR_VOLTE_PROVISIONING_DISABLED,
211    /**
212     * Indicates bluetooth connection failed.
213     */
214    CALL_ERR_BLUETOOTH_CONNECTION_FAILED,
215    /**
216     * Indicates set audio device failed.
217     */
218    CALL_ERR_SETTING_AUDIO_DEVICE_FAILED,
219    /**
220     * Indicates tone descriptor unknown.
221     */
222    CALL_ERR_AUDIO_UNKNOWN_TONE,
223    /**
224     * Indicates play call tone failed.
225     */
226    CALL_ERR_AUDIO_TONE_PLAY_FAILED,
227    /**
228     * Indicates stop call tone failed.
229     */
230    CALL_ERR_AUDIO_TONE_STOP_FAILED,
231    /**
232     * Indicates set mute failed.
233     */
234    CALL_ERR_AUDIO_SETTING_MUTE_FAILED,
235    /**
236     * Indicates set audio device failed.
237     */
238    CALL_ERR_AUDIO_SET_AUDIO_DEVICE_FAILED,
239    /**
240     * Indicates start vibrate failed.
241     */
242    CALL_ERR_AUDIO_START_VIBRATE_FAILED,
243    /**
244     * Indicates cancel vibrate failed.
245     */
246    CALL_ERR_AUDIO_CANCEL_VIBRATE_FAILED,
247    /**
248     * Indicates some error happpens in audio interface.
249     */
250    CALL_ERR_AUDIO_OPERATE_FAILED,
251    /**
252     * Indicates invalid coordinates.
253     */
254    CALL_ERR_VIDEO_INVALID_COORDINATES,
255    /**
256     * Indicates invalid zoom.
257     */
258    CALL_ERR_VIDEO_INVALID_ZOOM,
259    /**
260     * Indicates invalid rotation.
261     */
262    CALL_ERR_VIDEO_INVALID_ROTATION,
263    /**
264     * Indicates camera id is error.
265     */
266    CALL_ERR_VIDEO_INVALID_CAMERA_ID,
267    /**
268     * Indicates invalid path.
269     */
270    CALL_ERR_INVALID_PATH,
271    /**
272     * Indicates camera not turned on.
273     */
274    CALL_ERR_CAMERA_NOT_TURNED_ON,
275    /**
276     * Indicates callback already exist.
277     */
278    CALL_ERR_CALLBACK_ALREADY_EXIST,
279    /**
280     * Indicates callback is null.
281     */
282    CALL_ERR_CALLBACK_NOT_EXIST,
283    /**
284     * Indicates napi interface failed.
285     */
286    CALL_ERR_NAPI_INTERFACE_FAILED,
287    /**
288     * Indicates dtmf exceed limit.
289     */
290    CALL_ERR_DTMF_EXCEED_LIMIT,
291    /**
292     * Indicates invalid restriction type.
293     */
294    CALL_ERR_INVALID_RESTRICTION_TYPE,
295    /**
296     * Indicates invalid restriction mode.
297     */
298    CALL_ERR_INVALID_RESTRICTION_MODE,
299    /**
300     * Indicates invalid transfer type.
301     */
302    CALL_ERR_INVALID_TRANSFER_TYPE,
303    /**
304     * Indicates invalid transfer setting type.
305     */
306    CALL_ERR_INVALID_TRANSFER_SETTING_TYPE,
307    /**
308     * Indicates invalid transfer time.
309     */
310    CALL_ERR_INVALID_TRANSFER_TIME,
311    /**
312     * Indicates format phone number failed.
313     */
314    CALL_ERR_FORMAT_PHONE_NUMBER_FAILED,
315    /**
316     * Indicates handle system event failed.
317     */
318    CALL_ERR_SYSTEM_EVENT_HANDLE_FAILURE,
319    /**
320     * Indicates service dump failed.
321     */
322    CALL_ERR_SERVICE_DUMP_FAILED,
323    /**
324     * Indicates function not supported.
325     */
326    CALL_ERR_FUNCTION_NOT_SUPPORTED,
327    /**
328     * Indicates call not support video.
329     */
330    CALL_ERR_VIDEO_NOT_SUPPORTED,
331    /**
332     * Indicates ims call supplyment doesn't connect.
333     */
334    CALL_ERR_UT_NO_CONNECTION,
335};
336
337/**
338 * @brief Indicates the tye of protocol error.
339 *
340 * 3GPP TS 24.008 V3.9.0 (2001-09)  10.5.4.11 Cause
341 */
342enum PROTOCOL_ERROR_TYPE {
343    /**
344     * Indicates parameter out of range.
345     */
346    CALL_ERR_PARAMETER_OUT_OF_RANGE = PROTOCOL_ERR_OFFSET,
347    /**
348     * Indicates call completed elsewhere.
349     */
350    CALL_ERR_CALL_ALREADY_EXISTS,
351    /**
352     * Indicates radio state error, network out of order.
353     */
354    CALL_ERR_RADIO_STATE,
355    /**
356     * Indicates resources unavailable, unspecified.
357     */
358    CALL_ERR_RESOURCE_UNAVAILABLE,
359    /**
360     * Indicates service or option not available.
361     */
362    CALL_ERR_OPTION_NOT_AVAILABLE,
363    /**
364     * Indicates service or option not implemented.
365     */
366    CALL_ERR_OPTION_NOT_IMPLEMENTED,
367};
368} // namespace Telephony
369} // namespace OHOS
370
371#endif // CALL_MANAGER_ERRORS_H
372