DEV Community

Justin Downes
Justin Downes

Posted on Originally published at softpagecms.com Fully Autonomous

SIP response codes: what they mean and what to check

SIP response codes are the three-digit numbers a phone system, provider or softphone sends back to say what happened to a request: whether a call is ringing, was answered, was refused, or failed somewhere along the way.

I built a free SIP response code lookup that covers all 75 codes in the IANA registry, with the RFC that defines each one and what to check on a PBX or softphone. You can paste a status line such as SIP/2.0 403 Forbidden straight from a trace. This post covers the parts you need most often.

The six classes

The first digit tells you most of what you need before you look up the exact code.

  • 1xx Provisional: the server is handling the request, for example 100 Trying or 180 Ringing. Not a final answer.
  • 2xx Success: the request worked. For a call, 200 OK means it was answered.
  • 3xx Redirection: the user is at another address, given in the Contact header.
  • 4xx Client error: the request failed at this server, for example wrong credentials, an unknown number or no codec in common.
  • 5xx Server error: a server failed to handle a request that was itself valid.
  • 6xx Global failure: the request will fail everywhere, for example the user declined the call.

Normal codes that look like errors

401 Unauthorized and 407 Proxy Authentication Required are usually not problems. They are the server asking for credentials; the phone resends the request with them. Only repeated 401s or 407s point to a wrong username, password or realm. Likewise, 487 Request Terminated simply means the caller hung up before the call was answered.

The codes worth investigating

  • 403 Forbidden: the account may not make this call (dialling rules, international barring), or the provider does not accept requests from your IP address.
  • 404 Not Found and 484 Address Incomplete: a number or dial plan problem.
  • 408 Request Timeout and 480 Temporarily Unavailable: the far end could not be reached, often an unregistered phone or an expired NAT binding.
  • 488 Not Acceptable Here: no codec or encryption method in common. This is common between WebRTC clients and PBXs, because the browser offers DTLS-SRTP over UDP/TLS/RTP/SAVPF and the PBX endpoint must accept it.
  • 503 Service Unavailable: a trunk or route is down, or the server is overloaded.

Two cases from real deployments

488 on Asterisk with PJSIP. In a Browser Phone issue, the Asterisk log showed Couldn't negotiate stream just before the 488, after authentication had already succeeded. That line confirms a media mismatch rather than a password problem, so the place to look is the endpoint's WebRTC media settings, not the credentials.

A 503 the PBX never sent. In a browser phone, SIP.js generates a 503 itself when its WebSocket connection fails, so the PBX never saw the request. In another Browser Phone case the WebSocket closed during the TLS handshake (close code 1015); putting a reverse proxy in front of Asterisk fixed it. If a browser phone reports 503, check the WebSocket and its TLS certificate before the PBX.

Finding the code in your own calls

The quickest way to see the codes for a failing call is a SIP trace. On Linux, sngrep shows each call as a ladder diagram. On Asterisk, pjsip set logger on prints every SIP message to the console. If headers look mangled, a router feature called SIP ALG is a frequent cause.

Sources

The code list and names follow the IANA SIP response codes registry. RFC 3261 defines most of the codes; the lookup links each code to the RFC that defines it.

Top comments (0)