Put simply, SIP is a call and response protocol. If you send a message, you’ll get a response, and in some cases, you might get multiple responses—lucky you! Why not try it out for yourself? You can test out our SIP trunking product in just a few minutes in the Mission Control Portal.
From a more technical standpoint, a SIP response will contain information sent by a User Agent Server (UAS) to a User Agent Client (UAC).These responses are designed to help and inform. Each code consists of three digits, with the first digit of the code placing the response into one of six class types:
- 1xx is ‘Informational’
- 2xx is ‘Success’
- 3xx is a ‘Redirection’
- 4xx is a ‘Client Error’
- 5xx is a ‘Server Error’
- 6xx is a ‘Global Failure’
These class types can also be broken into two categories: code 1xx is known as a ‘Provisional’ code, and codes 2xx-6xx are referred to as ‘Final’ codes.
For an easy way to remember this distinction - a ‘Provisional’ code can be sent up until the point of establishment, or before you’ve made a connection. The ‘Final’ codes will be sent to confirm whether you’ve successfully made a connection or not (error, redirection, failure).
Which SIP response code should I remember?
Each code is accompanied by an explanatory description string, so thankfully, you don’t necessarily need to remember all the codes and what they mean. It might help to know what action to take based on what you receive back from the UAS. Here are the most common types of SIP response codes that you’re likely to encounter, and their meanings.
1xx - Informational
As mentioned earlier, a 1xx SIP response code can be sent at any time while a connection is being established. Some common 1xx codes are:
100 - Trying
The request has been received, and an unspecified action is being taken on behalf of the call.
180 - Ringing
An invite has been received by the user agent and it is now trying to alert the user.
181 - Call is Being Forwarded
Indicates that the call is being forwarded to another endpoint.
183 - Session Progress
This code is used to give information about the progress of a call.
199 - Early Dialog Terminated
Indicates to upstream SIP entities that an early dialog has been terminated.
2xx - Success
The 2xx response codes are used to indicate that a SIP request has been successfully received, understood, and accepted. You’ll typically see the following versions:
200 - Ok
The request has succeeded.
202 - Accepted
The UAS has received and understood the request, but it may not have been authorized or processed by the server.
204 - No Notification
The request was successful, but the response will not be received.
3xx - Redirection
These notify the UAC on redirections and of the different routes available to get to the UAS. Commonly received examples include:
300 - Multiple Choices
The request address returned several choices, each with their own specific locations. In this case, the UA can select a preferred endpoint to redirect the request to that specific location.
301 - Moved Permanently
The user can no longer be found at the address used in the request. A new address will be given in the contact header field, which can be retried by the requesting client. The new address should be saved and used in all future invite requests.
302 - Moved Temporarily
A new address will be given in the contact header field, which can be retried by the requesting client. This address should not be saved for future invite requests.
305 - Use Proxy
A proxy must be used to access the required destination. The specified proxy will be displayed in the contact field.
380 - Alternate Service
The call failed, but the message body details alternatives.
4xx - Client Error
The 4xx response codes indicate that something went wrong while processing the message, and the request cannot be fulfilled. There are quite a few of them, including:
400 - Bad Request
The request could not be understood.
401 - Not Authorized
The request requires user authentication.
404 - Not Found
The server has definitive information that the user does not exist at that particular domain.
407 - Proxy Authentication Required
This code is similar to the 401 - Not Authorized code, but in this case, the client must authenticate itself with the proxy.
408 - Request Timeout
The server could not produce a response within a suitable time frame.
415 - Unsupported Media Type
The server is refusing to service the request because the message body is in a format not supported by the server for the particular request method.
5xx - Server Error
5xx responses relate to server error issues and are mostly generated by the likes of proxy servers, location servers, and redirect servers. You’ll be familiar with some of these:
500 - Server Internal Error
The server was prevented from fulfilling the request by an unexpected condition.
501- Not Implemented
The functionality required to fulfill the request is not supported by the server.
502 - Bad Gateway
When attempting to fulfill the request, the server received an invalid response from a downstream server.
503 - Service Unavailable
Temporary overloading or maintenance of the server means it is currently unable to process the request. The client should attempt to forward the request to another server.
504 - Server Time-Out
When attempting to process the request, the server did not receive a timely response form the external server.
6xx - Global Error
Finally, the 6xx response codes relate to Global Error issues. They include:
600 - Busy Everywhere
The callee’s end system was contacted successfully but the callee is busy.
603 - Decline
The callee’s end system was successfully contacted but the user does not wish to or cannot participate.
604 - Does Not Exist Anywhere
There is information that the user indicated in the request URI does not exist.
606 - Not Acceptable
The user wishes to communicate but they cannot adequately support the session described.
Knowing all the codes and messages is great- but what about the practical applications of SIP trunking?
Share on Social