Carrier down or bad number: which SIP codes to retry
Which SIP responses mean the carrier failed and which mean the number did, why retrying the wrong kind costs dials, and what 50-call tests showed.

To the point
When a carrier refuses a call, its SIP response says either that the carrier failed or that the number did. Only the first kind is worth sending to another carrier. We tested this in a SIP proxy in front of the dialers, with 50 calls per case.
- The rule we tested retries on another carrier for 408, 480, 500, 502, 503 and 504.
- Every other final failure ends the call on the first carrier, for example 404, 486 and 487.
- First carrier 503, second carrier available: the second carrier answered 50 of 50 calls.
- First carrier 404 or 486: 50 of 50 calls ended there, and none reached the second carrier.
Two kinds of failure
A carrier's final response to a call attempt tells you one of two things. Either the carrier, or its route, could not take the call. Or the carrier reached a verdict about the destination: the number does not exist, or the person is busy.
The difference matters when you have a second carrier. A carrier failure is worth another try elsewhere. A verdict about the number is not. Sending a 404 to another carrier places a second call that cannot succeed. Sending a 486 rings a busy person again.
The rule we use
In OpenSIPS, the decision sits in failure_route, which runs when the forwarded call gets a negative final reply, whether from the carrier or generated by the proxy itself (a timeout, for example). The route arms it with t_on_failure before each attempt. Our rule is one line:
t_check_status("408|480|500|502|503|504")
If the attempt ended with one of those codes, the proxy tries the next carrier. Anything else ends the call on the first carrier.

- Retry: 408 Request Timeout, 480 Temporarily Unavailable, 500 Server Internal Error, 502 Bad Gateway, 503 Service Unavailable, 504 Server Time-out.
- End the call: 404 Not Found, 486 Busy Here, 487 Request Terminated, and by the same rule 484 Address Incomplete and 603 Decline.
480 is the code to think about. The rule we tested counts it as a carrier failure because some carriers send it for "no route right now". It can also mean the called person is unreachable. Retrying it is a choice, not a rule of SIP, so decide it for your own carriers.
What our tests showed
The test setup: real OpenSIPS 3.6.10 and RTPEngine 12.5.1.31, with sipp playing both the callers and the carriers. Each case ran 50 calls, on 4 November 2026.

- 503, then a second carrier: the second carrier answered all 50 calls.
- 404, with a second carrier ready to answer: all 50 calls ended with 404. None reached the second carrier.
- 486, with a second carrier ready to answer: all 50 calls ended with 486. None reached the second carrier.
- The wrong rule: we changed the rule to also retry 404 and 486. Those calls reached the second carrier, and both tests failed.
The last case is the useful one. A test suite that only checks "the call got through" would pass the wrong rule. Ours checks that a number failure stays on the first carrier, so it caught the change.
When every carrier fails
When every carrier answers 503, the call ends after the last one, and the caller's side gets one result. In our runs, 50 of 50 calls ended that way.
There is one twist. RFC 3261, section 16.7, says that if the only response a proxy received is a 503, it "SHOULD generate a 500 response and forward that upstream". We saw exactly that on 3 November 2026: a carrier answered 503, and the calling side received "500 Service Unavailable", the code changed and the phrase kept. If your dialer counts 503s to spot a carrier outage, count 500s from the proxy too, and tell the two apart by the reason phrase or the proxy's log, since a proxy also answers 500 for its own errors.
The media during a retry
Moving to the next carrier keeps the same media relay session. Nothing is torn down while another carrier may still answer. In the 503 case, no media sessions were left open after the 50 calls.
We ran the same check across all eleven failure cases in the suite, among them busy, server errors, no answer, the caller hanging up while it rang or while the route was being chosen, and the media relay being down. Every call closed its media session and was reported once.
Questions people ask
Should I retry on 480?
It depends on your carriers. 480 can mean "no route right now" or "this person is unreachable". The rule we tested retries it; that is a choice, not part of SIP.
Why not retry every failure?
Because number failures fail everywhere. A 404 retried is a second call to a number that does not exist, and a 486 retried rings a busy person twice.
Can I do this in VICIdial's dialplan instead?
We have not tested how Asterisk exposes the carrier's response code to the dialplan, so we do not give a recipe for it. Everything above was done in a proxy in front of the dialers.
Next steps
Write down which codes your carriers send for an outage, and test your rule with a call that should stay on the first carrier, not only one that should move. For setting up carriers, see moving a carrier from chan_sip to PJSIP. For hosted servers, see VICIdial hosting and pricing.
VICIdial is a trademark of its owner. Trustane is an independent hosting provider.
Sources
- Trustane failure-path tests (internal), OpenSIPS 3.6.10 and RTPEngine 12.5.1.31, sipp callers and carriers, 50 calls per case, 4 November 2026
- Trustane proxy configuration (internal), the retry rule in failure_route
- RFC 3261, SIP, June 2002, section 16.7 and section 21 (response codes)
- Cover photo by Brett Sayles on Pexels
Managed VICIdial hosting


