• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
21 namespace OHOS {
22 namespace Telephony {
23 /**
24  * @brief Indicates the error code of CallManager.
25  */
26 enum 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 the call is not in the conference.
189      */
190     CALL_ERR_THE_CALL_IS_NOT_IN_THE_CONFERENCE,
191     /**
192      * Indicates start Rtt failed.
193      */
194     CALL_ERR_STARTRTT_FAILED,
195     /**
196      * Indicates stop Rtt failed.
197      */
198     CALL_ERR_STOPRTT_FAILED,
199     /**
200      * Indicates volte is not supported.
201      */
202     CALL_ERR_VOLTE_NOT_SUPPORT,
203     /**
204      * Indicates volte provisioning disabled.
205      */
206     CALL_ERR_VOLTE_PROVISIONING_DISABLED,
207     /**
208      * Indicates bluetooth connection failed.
209      */
210     CALL_ERR_BLUETOOTH_CONNECTION_FAILED,
211     /**
212      * Indicates set audio device failed.
213      */
214     CALL_ERR_SETTING_AUDIO_DEVICE_FAILED,
215     /**
216      * Indicates tone descriptor unknown.
217      */
218     CALL_ERR_AUDIO_UNKNOWN_TONE,
219     /**
220      * Indicates play call tone failed.
221      */
222     CALL_ERR_AUDIO_TONE_PLAY_FAILED,
223     /**
224      * Indicates stop call tone failed.
225      */
226     CALL_ERR_AUDIO_TONE_STOP_FAILED,
227     /**
228      * Indicates set mute failed.
229      */
230     CALL_ERR_AUDIO_SETTING_MUTE_FAILED,
231     /**
232      * Indicates set audio device failed.
233      */
234     CALL_ERR_AUDIO_SET_AUDIO_DEVICE_FAILED,
235     /**
236      * Indicates start vibrate failed.
237      */
238     CALL_ERR_AUDIO_START_VIBRATE_FAILED,
239     /**
240      * Indicates cancel vibrate failed.
241      */
242     CALL_ERR_AUDIO_CANCEL_VIBRATE_FAILED,
243     /**
244      * Indicates some error happpens in audio interface.
245      */
246     CALL_ERR_AUDIO_OPERATE_FAILED,
247     /**
248      * Indicates invalid coordinates.
249      */
250     CALL_ERR_VIDEO_INVALID_COORDINATES,
251     /**
252      * Indicates invalid zoom.
253      */
254     CALL_ERR_VIDEO_INVALID_ZOOM,
255     /**
256      * Indicates invalid rotation.
257      */
258     CALL_ERR_VIDEO_INVALID_ROTATION,
259     /**
260      * Indicates camera id is error.
261      */
262     CALL_ERR_VIDEO_INVALID_CAMERA_ID,
263     /**
264      * Indicates invalid path.
265      */
266     CALL_ERR_INVALID_PATH,
267     /**
268      * Indicates camera not turned on.
269      */
270     CALL_ERR_CAMERA_NOT_TURNED_ON,
271     /**
272      * Indicates callback already exist.
273      */
274     CALL_ERR_CALLBACK_ALREADY_EXIST,
275     /**
276      * Indicates callback is null.
277      */
278     CALL_ERR_CALLBACK_NOT_EXIST,
279     /**
280      * Indicates napi interface failed.
281      */
282     CALL_ERR_NAPI_INTERFACE_FAILED,
283     /**
284      * Indicates dtmf exceed limit.
285      */
286     CALL_ERR_DTMF_EXCEED_LIMIT,
287     /**
288      * Indicates invalid restriction type.
289      */
290     CALL_ERR_INVALID_RESTRICTION_TYPE,
291     /**
292      * Indicates invalid restriction mode.
293      */
294     CALL_ERR_INVALID_RESTRICTION_MODE,
295     /**
296      * Indicates invalid transfer type.
297      */
298     CALL_ERR_INVALID_TRANSFER_TYPE,
299     /**
300      * Indicates invalid transfer setting type.
301      */
302     CALL_ERR_INVALID_TRANSFER_SETTING_TYPE,
303     /**
304      * Indicates invalid transfer time.
305      */
306     CALL_ERR_INVALID_TRANSFER_TIME,
307     /**
308      * Indicates format phone number failed.
309      */
310     CALL_ERR_FORMAT_PHONE_NUMBER_FAILED,
311     /**
312      * Indicates handle system event failed.
313      */
314     CALL_ERR_SYSTEM_EVENT_HANDLE_FAILURE,
315     /**
316      * Indicates service dump failed.
317      */
318     CALL_ERR_SERVICE_DUMP_FAILED,
319     /**
320      * Indicates function not supported.
321      */
322     CALL_ERR_FUNCTION_NOT_SUPPORTED,
323     /**
324      * Indicates call not support video.
325      */
326     CALL_ERR_VIDEO_NOT_SUPPORTED,
327     /**
328      * Indicates ims call supplyment doesn't connect.
329      */
330     CALL_ERR_UT_NO_CONNECTION,
331 };
332 
333 /**
334  * @brief Indicates the tye of protocol error.
335  *
336  * 3GPP TS 24.008 V3.9.0 (2001-09)  10.5.4.11 Cause
337  */
338 enum PROTOCOL_ERROR_TYPE {
339     /**
340      * Indicates parameter out of range.
341      */
342     CALL_ERR_PARAMETER_OUT_OF_RANGE = PROTOCOL_ERR_OFFSET,
343     /**
344      * Indicates call completed elsewhere.
345      */
346     CALL_ERR_CALL_ALREADY_EXISTS,
347     /**
348      * Indicates radio state error, network out of order.
349      */
350     CALL_ERR_RADIO_STATE,
351     /**
352      * Indicates resources unavailable, unspecified.
353      */
354     CALL_ERR_RESOURCE_UNAVAILABLE,
355     /**
356      * Indicates service or option not available.
357      */
358     CALL_ERR_OPTION_NOT_AVAILABLE,
359     /**
360      * Indicates service or option not implemented.
361      */
362     CALL_ERR_OPTION_NOT_IMPLEMENTED,
363 };
364 } // namespace Telephony
365 } // namespace OHOS
366 
367 #endif // CALL_MANAGER_ERRORS_H
368