Failure and End Causes
JsSIP provides a set of causes in order to make the user aware of what made the request or session fail. All causes exposed here are defined in JsSIP.C.causes
namespace and hence, any cause received in an event providing a cause
field can be compared against it.
Example
var target = 'sip:bob@example.com';
var eventHandlers = {
'failed': function(data) {
if (data.cause === JsSIP.C.causes.BUSY) {
coolPhone.sendMessage(target, 'Please, call me later!');
}
}
}
coolPhone.call(target, useAudio, useVideo, eventHandlers, views);
Common Causes
Constant | Value | Description |
---|---|---|
CONNECTION_ERROR |
‘Connection Error’ | WebSocket connection error ocurred. |
REQUEST_TIMEOUT |
‘Request Timeout’ | No response received, timeout expired for the client transaction. |
SIP_FAILURE_CODE |
‘SIP Failure Code’ | A negative SIP response was received which is not part of any of the groups defined in SIP Error Causes. |
INTERNAL_ERROR |
‘Internal Error’ | Unexpected error. |
SIP Error Causes
Some SIP response status codes are grouped into the following causes:
Constant | Value | SIP Status Codes |
---|---|---|
BUSY |
‘Busy’ | 486,600 |
REJECTED |
‘Rejected’ | 403,603 |
REDIRECTED |
‘Redirected’ | 300,301,302,305,380 |
UNAVAILABLE |
‘Unavailable’ | 480,410,408,430 |
NOT_FOUND |
‘Not Found’ | 404,604 |
ADDRESS_INCOMPLETE |
‘Address Incomplete’ | 484 |
INCOMPATIBLE_SDP |
‘Incompatible SDP’ | 488,606 |
MISSING_SDP |
’Received a request/response that should have SDP body but did not. | |
AUTHENTICATION_ERROR |
‘Authentication Error’ | 401,407 |
RTCSession Causes
The following causes apply to audio/video sessions.
Constant | Value | Description |
---|---|---|
BYE |
‘Terminated’ | RTCSession terminated normally by local or remote peer. |
CANCELED |
‘Canceled’ | RTCSession canceled by local or remote peer. |
NO_ANSWER |
‘No Answer’ | Incoming call was not answered in the time given in the configuration no_answer_timeout parameter. |
EXPIRES |
‘Expires’ | Incoming call contains a Expires header and local user did not answer within the time given in the header. |
NO_ACK |
‘No ACK’ | An incoming INVITE was replied with 2XX status code, but no ACK was received. |
DIALOG_ERROR |
‘Dialog Error’ | An in-dialog request received a 408 or 481 SIP error. |
USER_DENIED_MEDIA_ACCESS |
‘User Denied Media Access’ | Local user denied media access when prompted for audio/video devices. |
BAD_MEDIA_DESCRIPTION |
‘Bad Media Description’ | Received SDP is wrong. |
RTP_TIMEOUT |
‘RTP Timeout’ | Session ended due to loss of RTP. |