The Beginners’ Guide to SIP Codes: Common Errors and Fixes
![Three parts of SIP protocol including Session, Initiation, and Protocol.](https://flatrocksoft.com/wp-content/uploads/2023/12/The-Beginners-Guide-to-SIP-Codes-Common-Errors-and-Fixes.png)
[ad_1]
Session Initiation Protocol (SIP) is what establishes, maintains, and terminates voice and video calls over the internet. It’s a signaling protocol that can determine where people are in order to establish a connection between them—and it keeps that connection going until their VoIP call ends.
When things go right, SIP technology is simple at the user end. Likewise, when things aren’t going so well, there is a system in place to identify and troubleshoot issues. This is accomplished with the help of SIP response codes, which are three-digit numerical messages that contain information about the status of a call.
![Three parts of SIP protocol including Session, Initiation, and Protocol.](https://ceblog.s3.amazonaws.com/wp-content/uploads/2023/12/11133407/nextiva-sip-protocol.png)
SIP Codes Groups
SIP operates on a request-response model. A User Agent Client (UAC) initiates SIP requests, and a User Agent Server (UAS) responds.
In simple terms, the client requests to initiate communication, and the server responds with a SIP code to indicate the outcome of the request.
There are six class groups of SIP codes. The first digit of each group indicates its class. The following two digits describe the issue in more detail and suggest steps to take thereafter.
Codes beginning with 1 are called provisional codes. These codes are sent until a call is connected. Codes starting with numbers 2-6 are called final codes. These codes confirm whether or not a connection was successful.
SIP response codes are universal, but the reason phrases can vary from one service to another. Don’t worry too much about this. The differences are only semantic. If you understand the concept, you’re good to go.
The six categories of SIP response codes are as follows:
- 1xx | Provisional: 1xx response codes are sent while establishing a connection. They aren’t the final response to the request but provide information about its current status.
- 2xx | Success: 2xx response codes indicate that a SIP request has been received, understood, and accepted. These codes indicate that the action requested by the client has been completed.
- 3xx | Redirection: 3xx response codes indicate that further action is required to complete the request successfully. In this situation, the server suggests additional actions the client can take to complete the request.
- 4xx | Client Error: 4xx response codes indicate an issue with the client’s request, meaning the client should take corrective measures before making the request again.
- 5xx | Server Error: 5xx response codes mean there’s a problem at the server end.
- 6xx | Global Failure: 6xx response codes suggest a fundamental problem. In these cases, the issue is not specific to the client or server but due to some outside issue.
Common 1xx responses
- 100 | Trying: This response indicates that the server has received the request but is still working on it.
- 180 | Ringing: A 180 response code indicates that the called party is being alerted.
Common 2xx responses
- 200 | OK: This code means the request was successful, and the server has completed the action.
- 202 | Accepted: The request was accepted but hasn’t been authorized or processed yet.
Common 3xx responses
- 300 | Multiple Choices: This code means a request has returned several choices, each with a specific location. To access the resource, clients need to choose an option.
- 301 | Moved Permanently: This code means the resource has permanently moved to a new address. The Contact header field contains the new address. Save this address for future use.
- 302 | Moved Temporarily: A 302 code means the requested resource has temporarily moved. A new address should be supplied in the Contact header field.
Common 4xx responses
- 400 | Bad Request: A 400 code means the request was missing some information or couldn’t be understood for another reason.
- 401 | Unauthorized: This code means further authentication is necessary to access the requested resource.
- 404 | Not Found: Most likely the most recognizable code, a 404 error indicates that the resource you’re looking for can’t be found on the server and/or no longer exists.
Common 5xx responses
- 500 | Server Internal Error: This response means the server has encountered an unexpected condition and it can’t complete the request.
- 501 | Not Implemented: A 501 response means the server doesn’t support the necessary function to complete the client request.
- 503 | Service Unavailable: A 503 response code means the server is temporarily overloaded or down for maintenance.
Common 6xx responses
- 600 | Busy Everywhere: This response means all destinations are busy, and there’s no alternative destination to forward the call to.
- 603 | Decline: A 603 response means the user or server doesn’t wish to participate in the session. This refusal could be due to policy, resource limitations, or fears around the authenticity of the request.
Troubleshooting 7 Common SIP Codes
You’ll encounter some SIP response codes more than others, so it’s not necessary to learn every code by heart. Still, having a reference sheet bookmarked or printed out can be helpful if you’re dealing with SIP regularly. This will help you pick up on the six class groupings very quickly
The following list contains common SIP response codes and how to troubleshoot them:
300 | Multiple Choices
A response code 300 indicates a request has more than one possible response. Simply put, it means the called party has multiple contact addresses. Thus, the user or client must select one of these options to proceed with the call.
The Contact headers of the response will contain the different addresses or ways to reach the destination. In many cases, your SIP client will automatically select the best option at this point. If not, you may need to select from a list of options or manually input an address.
If you still can’t connect, retry your SIP request using the updated contact address from the get-go. It’s also worth double-checking the request for typos and ensuring that the address is still accessible.
301 | Moved Permanently
A SIP response code 301 tells you that the requested resource has permanently moved to a new location. You can find the resource’s new location in the Contact header field. Since the move is permanent, you may want to update your SIP client with the new address.
If you encounter multiple 301 responses, consider potential causes. These responses could result from server migration, network changes, or updates to the SIP infrastructure. Check with system admins if you encounter a pattern of 301 responses.
302 | Moved Temporarily
A 302 response code means the requested resource has moved. Unlike a 301 response, however, a 302 means the move is only temporary. Because of this, you don’t need to update the addresses of moved items.
When a request returns a 302 response, check the Contact header for the new location. You can now update your SIP request to include this new information. Once you update the address, your subsequent request should receive a 200 OK response, allowing you to proceed with the session.
400 | Bad Request
A SIP response code 400 indicates a problem with the client’s request. Essentially, it means the server can’t understand what you’re asking it to do, so you won’t be able to continue with the session until it does.
The first step in troubleshooting a 400 response is checking the request syntax. The request message must use the correct format and contain all the mandatory headers and values.
Next, you can check that the SIP addresses (markers identifying endpoints and participants) are valid. If these addresses have typos or errors, the server will return a 400 code.
Certain network issues and firewall configurations can also cause 400 response codes. Check network connectivity between the client and server, including routers, firewalls, and other network devices. Make sure your firewall is configured to allow SIP traffic.
Typically, ports 5060 for UDP/TCP must be open for SIP communication.
401 | Unauthorized
A response code 401 means your request lacks the necessary authentication credentials to proceed. The SIP server expects each request to contain specific credentials that allow access to resources. 401 means your request doesn’t have those credentials.
First, check that the username and password you used for authentication are correct. Next, check that the SIP server and client use the same authentication method, such as Digest Authentication.
Time discrepancy between the two communicating parties can also cause 401 responses. Check that the system clocks on the client and server end are synchronized.
Lastly, out-of-date software can cause authentication failure as well. Updating software and retrying the request can solve some authentication errors.
500 | Server Internal Error
A SIP response code 500 indicates a problem at the server end. This problem could be due to a server configuration error, a bug, or resource limitations.
Bugs and glitches in SIP server software can cause 500 responses. Updating to the newest software version can provide the necessary fixes along with other improvements.
Check the server logs for more detailed information about the error. Some logs may include codes and suggestions that point towards a resolution.
Server logs also contain timestamps for all requests made. Looking at these timestamps can provide insights into what caused the error.
Consider a rollback if the 500 response corresponds to server configuration or software changes.
503 | Service Unavailable
A SIP code 503 means the server is temporarily unavailable due to maintenance, being overwhelmed, or a general network problem.
First, check that your internet connection is stable and that you can access other websites. If your connection is good, wait a few minutes and try the request again.
Server-end problems can simply mean the server is overwhelmed with requests.
If you can access the server logs, look for error messages or additional information about the problem. Server logs can help you identify which request triggered the 503 response.
Time stamps in the server logs can also help you identify patterns leading up to the issues.
503 code responses are most associated with unexpected spikes in traffic and server maintenance. In both cases, simply waiting until later to make the request solves the issue. You can check with your service provider and system admin regarding scheduled maintenance.
[ad_2]
Source link