Thursday 29 September 2016

SIP Response Codes

In this post I am going to discuss about SIP Response codes. In the previous post we discussed about SIP messages. SIP Response codes as the name says is a kind of response to any SIP message. It can be a response to Invite message, Bye message or an Options message. We have. 6 different classes SIP Response codes which we will discuss now.

1XX - INFORMATIONAL RESPONSE
2XX - SUCCESSFUL RESPONSES
3XX - REDIRECTION RESPONSES
4XX - CLIENT FAILURE RESPONSES
5XX - SERVER FAILURE RESPONSES
6XX - GLOBAL FAILURE RESPONSES


1xx: 1xx are known as provisional responses and is an informational response which means request has been received and still in progress. Below are the few important 1xx responses:


100 TRYING: Trying shows an invite request has been received and a search is in progress. If there is a proxy server in between communication it will send the Trying message to the client before forwarding it to the next server.

180 Ringing: 180 Ringing show that the server has received the Invite request and its informing the client or in the case of phones it starts ringing.

183 Session in Progress: 183 Session in Progress is another important 1xx response which is used similar to 180 ringing but is used in cases of IVR and PSTN environments which we will discuss in details later. In 183 Session in Progress media starts without ringing the phone like we see in an IVR environment.

Few other 1xx responses are 181 Call is being Forwarded182 Queued and 199 Early Dialogue Terminated

2xx: 2xx is a success response which notifies that the request was successful and has been understood.


200 OK: 200 OK it is the most common response we get for initial Invite message. It indicates that the request is successful. It also contains other important information like SDP.

202 Accepted: It notifies that the request has been accepted and is still under processing.

3xx3xx indicates redirection response i.e. it gives detail about user's new direction/location. Below are the few 3xx responses:


300 Multiple Choices: This address provides several choices to user with each corresponding to a particular location and then the user can choose a preferred one and further can redirect response there.

301 Moved Permanently: As the name dictates, user is moved permanently to a new address given by contact header field and the requesting client should retry there. Requester should update the new address of the user and redirect future request to a new address.

302 Moved Temporarily: It worked the same way as 301 with difference of, an additional timer (Expires parameter) is used in contact header field that means for that particular time, request will redirect to that new location.

There are a few more 305 (use proxy) and 380 (alternative service).

4xx: Indicates Client Failure response.


400 Bad Request: Syntax error due to which request cannot be understood.

401 Unauthorized: Authentication is required for request. This is issued by UAS and registrar server.

404 Not Found: Very common error. It occurs because of user not available, domain mismatch (domain mentioned in the request-URI does not match any of the domains handled by the recipient of the request).

405 Method not allowed: Method mentioned in request is understood by server but not allowed/supported.

486 Busy Here: Indicates callee busy status. Callee is contacted successfully but he is busy or not ready to accept the call now.

487 Request Terminated:  Request is being terminated by bye or call message.

488 Not Acceptable Here:  Some aspect of request-URI is not acceptable.

The list of responses is a way long but those responses are not much seen.


5xx: 
Indicates Server failure response i.e. server itself has some error. Following are few one:


500 Server Internal Error: This is an unexpected situation for which server can not complete the request. It can be for a particular time after which server send a retry header field and user can try again.

501 Not implemented: Here server does not understood the request method (compare with 405)

502 Bad Gateway:  Server acts as a gateway and received an invalid response from downstream server.

503 Service Unavailable: Server cannot process the request due to overload or any maintenance.

Others are 504 Server Time-out, 513 Message too long...etc

6xx: It represents that a server has complete (global) information for a particular user and not for a particular request.


600 Busy Everywhere: All possible destinations are busy. e.g.: a user call and did not get any response and there is no other end point also like voicemail system to answer the request, in that case 600 is sent. Otherwise 486 (Busy here) can be used.

603 Decline: Work same as 600 that other party don't want to answer the call and there is no other alternative so 603 are sent.

Few more are 604 Does not exist anywhere, 606 Not Acceptable


PS: If you like this post please like my Facebook page Cisco Voice Virtual Lab which will help you to know about my next post on Facebook.






No comments:

Post a Comment