描述
/**
* Describes the cause of a disconnected call. Those disconnect causes can be converted into a more
* generic {@link android.telecom.DisconnectCause} object.
*/
示例
/** The disconnect cause is not valid (Not received a disconnect cause) */
public static final int NOT_VALID = -1;
/** Has not yet disconnected */
public static final int NOT_DISCONNECTED = 0;
/** An incoming call that was missed and never answered */
public static final int INCOMING_MISSED = 1;
/** Normal; Remote hangup*/
public static final int NORMAL = 2;
/** Normal; Local hangup */
public static final int LOCAL = 3;
/** Outgoing call to busy line */
public static final int BUSY = 4;
/** Outgoing call to congested network */
public static final int CONGESTION = 5;
/** Not presently used */
public static final int MMI = 6;
/** Invalid dial string */
public static final int INVALID_NUMBER = 7;
/** Cannot reach the peer */
public static final int NUMBER_UNREACHABLE = 8;
/** Cannot reach the server */
public static final int SERVER_UNREACHABLE = 9;
/** Invalid credentials */
public static final int INVALID_CREDENTIALS = 10;
/** Calling from out of network is not allowed */
public static final int OUT_OF_NETWORK = 11;
/** Server error */
public static final int SERVER_ERROR = 12;
/** Client timed out */
public static final int TIMED_OUT = 13;
/** Client went out of network range */
public static final int LOST_SIGNAL = 14;
/** GSM or CDMA ACM limit exceeded */
public static final int LIMIT_EXCEEDED = 15;
/** An incoming call that was rejected */
public static final int INCOMING_REJECTED = 16;
/** Radio is turned off explicitly */
public static final int POWER_OFF = 17;
/** Out of service */
public static final int OUT_OF_SERVICE = 18;
/** No ICC, ICC locked, or other ICC error */
public static final int ICC_ERROR = 19;
/** Call was blocked by call barring */
public static final int CALL_BARRED = 20;
...
/**
* Indicates that incoming call was rejected by the modem before the call went in ringing
*/
public static final int INCOMING_AUTO_REJECTED = 81;
这里只是给出部分Causes,详情请看android.telephony.DisconnectCause。
描述
/**
* Describes the cause of a disconnected call. This always includes a code describing the generic
* cause of the disconnect. Optionally, it may include a label and/or description to display to the
* user. It is the responsibility of the {@link ConnectionService} to provide localized versions of
* the label and description. It also may contain a reason for the disconnect, which is intended for
* logging and not for display to the user.
*/
示例
/** Disconnected because of an unknown or unspecified reason. */
public static final int UNKNOWN = TelecomProtoEnums.UNKNOWN; // = 0
/** Disconnected because there was an error, such as a problem with the network. */
public static final int ERROR = TelecomProtoEnums.ERROR; // = 1
/** Disconnected because of a local user-initiated action, such as hanging up. */
public static final int LOCAL = TelecomProtoEnums.LOCAL; // = 2
/**
* Disconnected because of a remote user-initiated action, such as the other party hanging up
* up.
*/
public static final int REMOTE = TelecomProtoEnums.REMOTE; // = 3
/** Disconnected because it has been canceled. */
public static final int CANCELED = TelecomProtoEnums.CANCELED; // = 4
/** Disconnected because there was no response to an incoming call. */
public static final int MISSED = TelecomProtoEnums.MISSED; // = 5
/** Disconnected because the user rejected an incoming call. */
public static final int REJECTED = TelecomProtoEnums.REJECTED; // = 6
/** Disconnected because the other party was busy. */
public static final int BUSY = TelecomProtoEnums.BUSY; // = 7
...
详情请看android.telecom.DisconnectCause。
顺便说一下:
TelecomProtoEnums目前包含了CallState和DisconnectCause;
TelephonyProtoEnums目前包含了CallBearer、NetworkType、SimState等。
描述
/**
* Provides details on why an IMS call failed. Applications can use the methods in this class to
* get local or network fault behind an IMS services failure. For example, if the code is
* CODE_CALL_BARRED, then the call was blocked by network call barring configuration and it is not
* the device's bug and the user can retry the call when network lift the barring.
* Typical use case includes call backs when IMS call state changed with this class as a param
* containing details on why IMS call changed state/failed.
*/
示例
/**
* The Reason is unspecified.
*/
public static final int CODE_UNSPECIFIED = 0;
// LOCAL
// IMS -> Telephony
/**
* The passed argument is invalid.
*/
public static final int CODE_LOCAL_ILLEGAL_ARGUMENT = 101;
/**
* The operation was invoked while in an invalid call state.
*/
public static final int CODE_LOCAL_ILLEGAL_STATE = 102;
/**
* IMS service internal error
*/
public static final int CODE_LOCAL_INTERNAL_ERROR = 103;
/**
* ImsService has crashed (service connection is lost).
*/
public static final int CODE_LOCAL_IMS_SERVICE_DOWN = 106;
/**
* No pending incoming call exists
*/
public static final int CODE_LOCAL_NO_PENDING_CALL = 107;
/**
* IMS Call ended during conference merge process
*/
public static final int CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE = 108;
...
这里还包含了一些SIP消息应答码
/*
* STATUSCODE (SIP response code) (IMS -> Telephony)
*/
// 3xx responses
/**
* SIP 3xx response: SIP request is redirected
*/
public static final int CODE_SIP_REDIRECTED = 321;
// 4xx responses
/**
* Sip 400 response : Bad Request
*/
public static final int CODE_SIP_BAD_REQUEST = 331;
/**
* Sip 403 response : Forbidden
*/
public static final int CODE_SIP_FORBIDDEN = 332;
/**
* Sip 404 response : Not Found
*/
public static final int CODE_SIP_NOT_FOUND = 333;
...
详情请看ImsReasonInfo。
描述
/**
* Call fail causes from TS 24.008 .
* These are mostly the cause codes we need to distinguish for the UI.
* See 22.001 Annex F.4 for mapping of cause codes to local tones.
*
* CDMA call failure reasons are derived from the possible call failure scenarios described
* in "CDMA IS2000 - Release A (C.S0005-A v6.0)" standard.
*
* The detailed fail causes are defined in ITU Recommendation Q.850.
*
* {@hide}
*
*/
这里的具体Causes来自3GPP TS 24.008。
示例
// The disconnect cause is not valid (Not received a disconnect cause)
int NOT_VALID = -1;
// Unassigned/Unobtainable number
int UNOBTAINABLE_NUMBER = 1;
int NO_ROUTE_TO_DEST = 3;
int CHANNEL_UNACCEPTABLE = 6;
int OPERATOR_DETERMINED_BARRING = 8;
int NORMAL_CLEARING = 16;
int USER_BUSY = 17;
int NO_USER_RESPONDING = 18;
...
// Call failed because of a network reject
int NETWORK_REJECT = 252;
// Call failed because of radio access failure. ex. RACH failure
int RADIO_ACCESS_FAILURE = 253;
// Call failed/dropped because of a Radio Link Failure (RLF).
int RADIO_LINK_FAILURE = 254;
// Call failed/dropped because of radio link lost
int RADIO_LINK_LOST = 255;
// Call failed because of a radio uplink issue
int RADIO_UPLINK_FAILURE = 256;
// Call failed because of a RRC (Radio Resource Control) connection setup failure
int RADIO_SETUP_FAILURE = 257;
// Call failed/dropped because of RRC (Radio Resource Control) connection release from NW
int RADIO_RELEASE_NORMAL = 258;
...
/**
* STATUSCODE (SIP response code) (IMS -> Telephony)
*/
// SIP request is redirected
int SIP_REDIRECTED = 1300;
/** 4xx responses */
// 400 : Bad Request
int SIP_BAD_REQUEST = 1310;
// 403 : Forbidden
int SIP_FORBIDDEN = 1311;
// 404 : Not Found
int SIP_NOT_FOUND = 1312;
...
详情请看CallFailCause。
这里的大部分Codes都能和ImsReasonInfo对应得上,但值不同,这里要注意一下。
100 Trying
180 Ringing
181 Call Is Being Forwarded
182 Queued
183 Session Progress
200 OK
202 accepted: It Indicates that the request has been understood but actually can’t be processed
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
305 Use Proxy
380 Alternative Service
400 Bad Request
401 Unauthorized (Used only by registrars or user agents. Proxies should use proxy authorization 407)
402 Payment Required (Reserved for future use)
403 Forbidden
404 Not Found (User not found)
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout (Couldn’t find the user in time)
409 Conflict
410 Gone (The user existed once, but is not available here any more.)
412 Conditional Request Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Unsupported URI Scheme
417 Unknown Resource-Priority
420 Bad Extension (Bad SIP Protocol Extension used, not understood by the server)
421 Extension Required
422 Session Interval Too Small
423 Interval Too Brief
424 Bad Location Information
428 Use Identity Header
429 Provide Referrer Identity
433 Anonymity Disallowed
436 Bad Identity-Info
437 Unsupported Certificate
438 Invalid Identity Header
480 Temporarily Unavailable
481 Call/Transaction Does Not Exist
482 Loop Detected
483 Too Many Hops
484 Address Incomplete
485 Ambiguous
486 Busy Here
487 Request Terminated
488 Not Acceptable Here
489 Bad Event
491 Request Pending
493 Undecipherable (Could not decrypt S/MIME body part)
494 Security Agreement Required
500 Server Internal Error
501 Not Implemented: The SIP request method is not implemented here
502 Bad Gateway
503 Service Unavailable
504 Server Time-out
505 Version Not Supported: The server does not support this version of the SIP protocol
513 Message Too Large
580 Precondition Failure
600 Busy Everywhere
603 Decline
604 Does Not Exist Anywhere
606 Not Acceptable
参考:
详细解释—SIP协议响应代码
代码浏览—Common SIP Responses
出处:
RFC官网—RFC3261
常出现在底层SIP消息中,用来表明失败时的原因。
示例
0 Valid cause code not yet received
1 Unallocated (unassigned) number
2 No route to specified transit network (WAN)
3 No route to destination
4 send special information tone
5 misdialled trunk prefix.
6 Channel unacceptable
7 Call awarded and being delivered in an established channel
8 Prefix 0 dialed but not allowed
9 Prefix 1 dialed but not allowed
10 Prefix 1 dialed but not required
11 More digits received than allowed, call is proceeding
16 Normal call clearing
17 User busy
18 No user responding
20 Subscriber absent
...
详情参考:
中文对照—Q.850原因值说明
代码浏览—Q.850 CAUSE CODES
出处:
ITU官网—Q.850下载
以上陋解,多多指教
转载请注明出处,谢谢~