1 /*
2  * Copyright (C) 2006 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 
17 package com.android.internal.telephony;
18 
19 /**
20  * Call fail causes from TS 24.008 .
21  * These are mostly the cause codes we need to distinguish for the UI.
22  * See 22.001 Annex F.4 for mapping of cause codes to local tones.
23  *
24  * CDMA call failure reasons are derived from the possible call failure scenarios described
25  * in "CDMA IS2000 - Release A (C.S0005-A v6.0)" standard.
26  *
27  * The detailed fail causes are defined in ITU Recommendation Q.850.
28  *
29  * {@hide}
30  *
31  */
32 public interface CallFailCause {
33     // The disconnect cause is not valid (Not received a disconnect cause)
34     int NOT_VALID = -1;
35 
36     // Unassigned/Unobtainable number
37     int UNOBTAINABLE_NUMBER = 1;
38 
39     int NO_ROUTE_TO_DEST = 3;
40     int CHANNEL_UNACCEPTABLE = 6;
41     int OPERATOR_DETERMINED_BARRING = 8;
42     int NORMAL_CLEARING     = 16;
43     int USER_BUSY           = 17;
44     int NO_USER_RESPONDING = 18;
45 
46     /**
47      * This cause is used when the called party has been alerted but does not respond with a connect
48      * indication within a prescribed period of time. Note - This cause is not necessarily generated
49      * by Q.931 procedures but may be generated by internal network timers.
50      */
51     int USER_ALERTING_NO_ANSWER = 19;
52 
53     /**
54      * The equipment sending this cause does not wish to accept this call, although it could have
55      * accepted the call because the equipment sending this cause is neither busy nor incompatible.
56      * The network may also generate this cause, indicating that the call was cleared due to a
57      * supplementary service constraint. The diagnostic field may contain additional information
58      * about the supplementary service and reason for rejection.
59      */
60     int CALL_REJECTED = 21;
61 
62     int NUMBER_CHANGED      = 22;
63     int PRE_EMPTION = 25;
64 
65     // The user has not been awarded the incoming call.
66     int NON_SELECTED_USER_CLEARING = 26;
67 
68     int DESTINATION_OUT_OF_ORDER = 27;
69 
70     // Incomplete number
71     int INVALID_NUMBER_FORMAT = 28;
72 
73     // Supplementary service requested by the user cannot be provide by the network.
74     int FACILITY_REJECTED = 29;
75 
76     int STATUS_ENQUIRY      = 30;
77     int NORMAL_UNSPECIFIED  = 31;
78     int NO_CIRCUIT_AVAIL    = 34;
79 
80     // Resource unavailable
81     int NETWORK_OUT_OF_ORDER = 38;
82     int TEMPORARY_FAILURE   = 41;
83     int SWITCHING_CONGESTION    = 42;
84     int ACCESS_INFORMATION_DISCARDED = 43;
85     int CHANNEL_NOT_AVAIL   = 44;
86     int RESOURCES_UNAVAILABLE_UNSPECIFIED = 47;
87     int QOS_NOT_AVAIL       = 49;
88 
89     // Service or option unavailable
90     /**
91      * The user has requested a supplementary service, which is available, but the user is not
92      * authorized to use.
93      */
94     int REQUESTED_FACILITY_NOT_SUBSCRIBED = 50;
95     /**
96      * Although the called party is a member of the CUG (Closed User Group) for the incoming CUG
97      * call, incoming calls are not allowed to this member of the CUG.
98      */
99     int INCOMING_CALL_BARRED_WITHIN_CUG = 55;
100     int BEARER_CAPABILITY_NOT_AUTHORISED = 57;
101     int BEARER_NOT_AVAIL    = 58;
102     /**
103      * This cause is used to report a service or option not available event only when no other cause
104      * between 49-62 (where a service or option is unavailable) applies.
105      */
106     int SERVICE_OR_OPTION_NOT_AVAILABLE = 63;
107     int BEARER_SERVICE_NOT_IMPLEMENTED = 65;
108 
109     // Service or option not implemented
110     int ACM_LIMIT_EXCEEDED = 68;
111     int REQUESTED_FACILITY_NOT_IMPLEMENTED = 69;
112     /**
113      * The calling party has requested an unrestricted bearer service but that the equipment sending
114      * this cause only supports the restricted version of the requested bearer capability.
115      */
116     int ONLY_RESTRICTED_DIGITAL_INFO_BC_AVAILABLE = 70;
117     int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79;
118     int INVALID_TRANSACTION_ID_VALUE = 81;
119 
120     // Invalid message
121     int USER_NOT_MEMBER_OF_CUG = 87;
122     int INCOMPATIBLE_DESTINATION = 88;
123     int INVALID_TRANSIT_NETWORK_SELECTION = 91;
124     int SEMANTICALLY_INCORRECT_MESSAGE = 95;
125     int INVALID_MANDATORY_INFORMATION = 96;
126 
127     // Protocol error
128     int MESSAGE_TYPE_NON_EXISTENT = 97;
129     int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROT_STATE = 98;
130     int IE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99;
131     /**
132      * The equipment sending this cause has received an information element which it has
133      * implemented; however, one or more fields in the information element are coded in such a way
134      * which has not been implemented by the equipment sending this cause.
135      */
136     int CONDITIONAL_IE_ERROR = 100;
137     int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101;
138     int RECOVERY_ON_TIMER_EXPIRY = 102;
139     int PROTOCOL_ERROR_UNSPECIFIED = 111;
140     int INTERWORKING_UNSPECIFIED = 127;
141 
142     // Others
143     int CALL_BARRED        = 240;
144     int FDN_BLOCKED        = 241;
145     int IMEI_NOT_ACCEPTED  = 243;
146 
147     // Stk Call Control
148     int DIAL_MODIFIED_TO_USSD = 244;
149     int DIAL_MODIFIED_TO_SS   = 245;
150     int DIAL_MODIFIED_TO_DIAL = 246;
151 
152     // The call cannot be established because RADIO is OFF
153     int RADIO_OFF = 247;
154 
155     // The call cannot be established because of no valid SIM
156     int NO_VALID_SIM = 249;
157 
158     // The call is dropped or failed internally by modem
159     int RADIO_INTERNAL_ERROR = 250;
160 
161     // Call failed because of UE timer expired while waiting for a response from network
162     int NETWORK_RESP_TIMEOUT = 251;
163 
164     // Call failed because of a network reject
165     int NETWORK_REJECT                                   = 252;
166     // Call failed because of radio access failure. ex. RACH failure
167     int RADIO_ACCESS_FAILURE                             = 253;
168     // Call failed/dropped because of a Radio Link Failure (RLF).
169     int RADIO_LINK_FAILURE                               = 254;
170     // Call failed/dropped because of radio link lost
171     int RADIO_LINK_LOST                                  = 255;
172     // Call failed because of a radio uplink issue
173     int RADIO_UPLINK_FAILURE                             = 256;
174     // Call failed because of a RRC (Radio Resource Control) connection setup failure
175     int RADIO_SETUP_FAILURE                              = 257;
176     // Call failed/dropped because of RRC (Radio Resource Control) connection release from NW
177     int RADIO_RELEASE_NORMAL                             = 258;
178     /**
179      * Call failed/dropped because of RRC (Radio Resource Control) abnormally released by
180      * modem/network.
181      */
182     int RADIO_RELEASE_ABNORMAL                           = 259;
183     //Access class blocked - TS 31.121 5.2.1
184     int ACCESS_CLASS_BLOCKED = 260;
185 
186     /** Call failed/dropped because of a network detach. */
187     int NETWORK_DETACH                                   = 261;
188 
189     //Emergency Redial
190     int EMERGENCY_TEMP_FAILURE = 325;
191     int EMERGENCY_PERM_FAILURE = 326;
192 
193     int CDMA_LOCKED_UNTIL_POWER_CYCLE  = 1000;
194     int CDMA_DROP                      = 1001;
195     int CDMA_INTERCEPT                 = 1002;
196     int CDMA_REORDER                   = 1003;
197     int CDMA_SO_REJECT                 = 1004;
198     int CDMA_RETRY_ORDER               = 1005;
199     int CDMA_ACCESS_FAILURE            = 1006;
200     int CDMA_PREEMPTED                 = 1007;
201 
202     // For non-emergency number dialed while in emergency callback mode.
203     int CDMA_NOT_EMERGENCY             = 1008;
204 
205     // Access Blocked by CDMA Network.
206     int CDMA_ACCESS_BLOCKED            = 1009;
207 
208     /** Mapped from ImsReasonInfo */
209     // The passed argument is an invalid
210     int LOCAL_ILLEGAL_ARGUMENT                           = 1200;
211     // The operation is invoked in invalid call state
212     int LOCAL_ILLEGAL_STATE                              = 1201;
213     // IMS service internal error
214     int LOCAL_INTERNAL_ERROR                             = 1202;
215     // IMS service goes down (service connection is lost)
216     int LOCAL_IMS_SERVICE_DOWN                           = 1203;
217     // No pending incoming call exists
218     int LOCAL_NO_PENDING_CALL                            = 1204;
219     // Service unavailable; by power off
220     int LOCAL_POWER_OFF                                  = 1205;
221     // Service unavailable; by low battery
222     int LOCAL_LOW_BATTERY                                = 1206;
223     // Service unavailable; by out of service (data service state)
224     int LOCAL_NETWORK_NO_SERVICE                         = 1207;
225 
226     /* Service unavailable; by no LTE coverage
227      * (VoLTE is not supported even though IMS is registered)
228      */
229     int LOCAL_NETWORK_NO_LTE_COVERAGE                    = 1208;
230     // Service unavailable; by located in roaming area
231     int LOCAL_NETWORK_ROAMING                            = 1209;
232     // Service unavailable; by IP changed
233     int LOCAL_NETWORK_IP_CHANGED                         = 1210;
234     // Service unavailable; other
235     int LOCAL_SERVICE_UNAVAILABLE                        = 1211;
236     // Service unavailable; IMS connection is lost (IMS is not registered)
237     int LOCAL_NOT_REGISTERED                             = 1212;
238     // Max call exceeded
239     int LOCAL_MAX_CALL_EXCEEDED                          = 1213;
240     // Call decline
241     int LOCAL_CALL_DECLINE                               = 1214;
242     // SRVCC is in progress
243     int LOCAL_CALL_VCC_ON_PROGRESSING                    = 1215;
244     // Resource reservation is failed (QoS precondition)
245     int LOCAL_CALL_RESOURCE_RESERVATION_FAILED           = 1216;
246     /** Retry CS call; VoLTE service can't be provided by the network or remote end
247      *  Resolve the extra code(EXTRA_CODE_CALL_RETRY_*) if the below code is set
248      */
249     int LOCAL_CALL_CS_RETRY_REQUIRED                     = 1217;
250     // Retry VoLTE call; VoLTE service can't be provided by the network temporarily
251     int LOCAL_CALL_VOLTE_RETRY_REQUIRED                  = 1218;
252     // IMS call is already terminated (in TERMINATED state)
253     int LOCAL_CALL_TERMINATED                            = 1219;
254     // Handover not feasible
255     int LOCAL_HO_NOT_FEASIBLE                            = 1220;
256 
257     // 1xx waiting timer is expired after sending INVITE request (MO only)
258     int TIMEOUT_1XX_WAITING                              = 1221;
259     /** User no answer during call setup operation (MO/MT)
260      *  MO : 200 OK to INVITE request is not received,
261      *  MT : No action from user after alerting the call
262      */
263     int TIMEOUT_NO_ANSWER                                = 1222;
264     /** User no answer during call update operation (MO/MT)
265      *  MO : 200 OK to re-INVITE request is not received,
266      *  MT : No action from user after alerting the call
267      */
268     int TIMEOUT_NO_ANSWER_CALL_UPDATE                    = 1223;
269 
270     /**
271      * STATUSCODE (SIP response code) (IMS -> Telephony)
272      */
273     // SIP request is redirected
274     int SIP_REDIRECTED                                   = 1300;
275     /** 4xx responses */
276     // 400 : Bad Request
277     int SIP_BAD_REQUEST                                  = 1310;
278     // 403 : Forbidden
279     int SIP_FORBIDDEN                                    = 1311;
280     // 404 : Not Found
281     int SIP_NOT_FOUND                                    = 1312;
282     /** 415 : Unsupported Media Type
283      *  416 : Unsupported URI Scheme
284      *  420 : Bad Extension
285      */
286     int SIP_NOT_SUPPORTED                                = 1313;
287     // 408 : Request Timeout
288     int SIP_REQUEST_TIMEOUT                              = 1314;
289     // 480 : Temporarily Unavailable
290     int SIP_TEMPRARILY_UNAVAILABLE                       = 1315;
291     // 484 : Address Incomplete
292     int SIP_BAD_ADDRESS                                  = 1316;
293     /** 486 : Busy Here
294      *  600 : Busy Everywhere
295      */
296     int SIP_BUSY                                         = 1317;
297     // 487 : Request Terminated
298     int SIP_REQUEST_CANCELLED                            = 1318;
299     /** 406 : Not Acceptable
300      *  488 : Not Acceptable Here
301      *  606 : Not Acceptable
302      */
303     int SIP_NOT_ACCEPTABLE                               = 1319;
304     /** 410 : Gone
305      *  604 : Does Not Exist Anywhere
306      */
307     int SIP_NOT_REACHABLE                                = 1320;
308     // Others
309     int SIP_CLIENT_ERROR                                 = 1321;
310     // 481 : Transaction Does Not Exist
311     int SIP_TRANSACTION_DOES_NOT_EXIST                   = 1322;
312     /** 5xx responses
313      *  501 : Server Internal Error
314      */
315     int SIP_SERVER_INTERNAL_ERROR                        = 1330;
316     // 503 : Service Unavailable
317     int SIP_SERVICE_UNAVAILABLE                          = 1331;
318     // 504 : Server Time-out
319     int SIP_SERVER_TIMEOUT                               = 1332;
320     // Other
321     int SIP_SERVER_ERROR                                 = 1333;
322     /** 6xx responses
323      *  603 : Decline
324      */
325     int SIP_USER_REJECTED                                = 1340;
326     // Others
327     int SIP_GLOBAL_ERROR                                 = 1341;
328     // Emergency failure
329     int IMS_EMERGENCY_TEMP_FAILURE                       = 1342;
330     int IMS_EMERGENCY_PERM_FAILURE                       = 1343;
331     // Media resource initialization failed
332     int MEDIA_INIT_FAILED                                = 1400;
333     // RTP timeout (no audio / video traffic in the session)
334     int MEDIA_NO_DATA                                    = 1401;
335     // Media is not supported; so dropped the call
336     int MEDIA_NOT_ACCEPTABLE                             = 1402;
337     // Unknown media related errors
338     int MEDIA_UNSPECIFIED                                = 1403;
339     // User triggers the call end
340     int USER_TERMINATED                                  = 1500;
341     // No action while an incoming call is ringing
342     int USER_NOANSWER                                    = 1501;
343     // User ignores an incoming call
344     int USER_IGNORE                                      = 1502;
345     // User declines an incoming call
346     int USER_DECLINE                                     = 1503;
347     // Device declines/ends a call due to low battery
348     int LOW_BATTERY                                      = 1504;
349     // Device declines call due to blacklisted call ID
350     int BLACKLISTED_CALL_ID                              = 1505;
351     // The call is terminated by the network or remote user
352     int USER_TERMINATED_BY_REMOTE                        = 1510;
353 
354     /**
355      * UT
356      */
357     int UT_NOT_SUPPORTED                                 = 1800;
358     int UT_SERVICE_UNAVAILABLE                           = 1801;
359     int UT_OPERATION_NOT_ALLOWED                         = 1802;
360     int UT_NETWORK_ERROR                                 = 1803;
361     int UT_CB_PASSWORD_MISMATCH                          = 1804;
362 
363     /**
364      * ECBM
365      */
366     int ECBM_NOT_SUPPORTED                               = 1900;
367 
368     /**
369      * Fail code used to indicate that Multi-endpoint is not supported by the Ims framework.
370      */
371     int MULTIENDPOINT_NOT_SUPPORTED                      = 1901;
372 
373     /**
374      * CALL DROP error codes (Call could drop because of many reasons like Network not available,
375      *  handover, failed, etc)
376      */
377 
378     /**
379      * CALL DROP error code for the case when a device is ePDG capable and when the user is on an
380      * active wifi call and at the edge of coverage and there is no qualified LTE network available
381      * to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error
382      * code is received as part of the handover message.
383      */
384     int CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE               = 2000;
385 
386     // MT call has ended due to a release from the network because the call was answered elsewhere
387     int ANSWERED_ELSEWHERE                               = 2100;
388 
389     // For MultiEndpoint - Call Pull request has failed
390     int CALL_PULL_OUT_OF_SYNC                            = 2101;
391 
392     // For MultiEndpoint - Call has been pulled from primary to secondary
393     int CALL_PULLED                                      = 2102;
394 
395     /**
396      * Supplementary services (HOLD/RESUME) failure error codes.
397      * Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision.
398      */
399     int SUPP_SVC_FAILED                                  = 2300;
400     int SUPP_SVC_CANCELLED                               = 2301;
401     int SUPP_SVC_REINVITE_COLLISION                      = 2302;
402 
403     //DPD Procedure received no response or send failed
404     int IWLAN_DPD_FAILURE                                = 2400;
405 
406     // Establishment of the ePDG Tunnel Failed
407     int EPDG_TUNNEL_ESTABLISH_FAILURE                    = 2500;
408 
409     // Re-keying of the ePDG Tunnel Failed; may not always result in teardown
410     int EPDG_TUNNEL_REKEY_FAILURE                        = 2501;
411 
412     // Connection to the packet gateway is lost
413     int EPDG_TUNNEL_LOST_CONNECTION                      = 2502;
414 
415     /**
416      * The maximum number of calls allowed has been reached.  Used in a multi-endpoint scenario
417      * where the number of calls across all connected devices has reached the maximum.
418      */
419     int MAXIMUM_NUMBER_OF_CALLS_REACHED                  = 2503;
420 
421     /**
422      * Similar to {@link #CODE_LOCAL_CALL_DECLINE}, except indicates that a remote device has
423      * declined the call.  Used in a multi-endpoint scenario where a remote device declined an
424      * incoming call.
425      */
426     int REMOTE_CALL_DECLINE                              = 2504;
427 
428     /**
429      * Indicates the call was disconnected due to the user reaching their data limit.
430      */
431     int DATA_LIMIT_REACHED                               = 2505;
432 
433     /**
434      * Indicates the call was disconnected due to the user disabling cellular data.
435      */
436     int DATA_DISABLED                                    = 2506;
437 
438     /**
439      * Indicates a call was disconnected due to loss of wifi signal.
440      */
441     int WIFI_LOST                                        = 2507;
442 
443     /**
444      * Indicates a call was disconnected because retry over volte is needed.
445      */
446     int EMC_REDIAL_ON_IMS                                = 3001;
447 
448     /**
449      * Indicates a call was disconnected because retry over vowifi is needed.
450      */
451     int EMC_REDIAL_ON_VOWIFI                             = 3002;
452 
453     /* OEM specific error codes. To be used by OEMs when they don't want to
454        reveal error code which would be replaced by ERROR_UNSPECIFIED */
455     int OEM_CAUSE_1                                      = 0xf001;
456     int OEM_CAUSE_2                                      = 0xf002;
457     int OEM_CAUSE_3                                      = 0xf003;
458     int OEM_CAUSE_4                                      = 0xf004;
459     int OEM_CAUSE_5                                      = 0xf005;
460     int OEM_CAUSE_6                                      = 0xf006;
461     int OEM_CAUSE_7                                      = 0xf007;
462     int OEM_CAUSE_8                                      = 0xf008;
463     int OEM_CAUSE_9                                      = 0xf009;
464     int OEM_CAUSE_10                                     = 0xf00a;
465     int OEM_CAUSE_11                                     = 0xf00b;
466     int OEM_CAUSE_12                                     = 0xf00c;
467     int OEM_CAUSE_13                                     = 0xf00d;
468     int OEM_CAUSE_14                                     = 0xf00e;
469     int OEM_CAUSE_15                                     = 0xf00f;
470 
471     int ERROR_UNSPECIFIED = 0xffff;
472 
473 }
474