// SIP 5xx Server failure

SIP 504 Server Time-out

A gateway or proxy timed out waiting for the next hop.

5xx Server failure · RFC 3261 · Answer to OPTIONS: Answering, but the server behind it didn't reply in time.

What SIP 504 means

A 504 comes from a server acting as a gateway or proxy that gave up waiting for another server it needed to complete the request. That can be the next hop toward the destination, or an external service such as a location server. The server that sent the 504 is working; the one it waited for isn't answering.

On calls to the phone network, gateways also produce 504 when a network timer expires: RFC 3398 maps Q.850 cause 102, recovery on timer expiry, to 504. Because it is a timeout, a 504 often comes after a noticeable delay, and the caller may hear several seconds of silence before the call fails.

Example response

SIP/2.0 504 Server Time-out
Via: SIP/2.0/UDP 198.51.100.32:5060;branch=z9hG4bK-504-z5
From: <sip:+[email protected]>;tag=2a8f
To: <sip:+[email protected]>;tag=st-39
Call-ID: [email protected]
CSeq: 10 INVITE
Reason: Q.850;cause=102;text="Recovery on timer expiry"
Content-Length: 0

Common causes of SIP 504

  • The next hop toward the destination is down or overloaded and doesn't answer the forwarded request.
  • A DNS lookup for the next hop is slow or failing, so the proxy runs out of time before it can forward the request.
  • A database or location service the server queries for routing doesn't answer in time.
  • A firewall between the server and its next hop drops the forwarded request or the responses to it.
  • The phone network reported recovery on timer expiry, which a gateway maps to 504.

How to fix SIP 504

  1. Find the server that sent the 504 and check, from that server, whether its next hop answers.
  2. Time the DNS lookups the server makes for its next hops; slow or failing SRV or A lookups show up as 504.
  3. Check that the server's own timeout isn't shorter than the time its next hop normally needs.
  4. Look at the firewall rules between the two servers, in both directions.

SIP 504 as an answer to OPTIONS

A 504 to OPTIONS means the server is answering, but the server behind it didn't reply in time. The SBC is reachable, and its upstream is slow or gone. A PingVo Route counts it as reachable by default; set the expected codes to 200 if you want it to count as a failure.

See which code your SBC returns. Run a free SIP OPTIONS check

Questions about SIP 504

What is the difference between SIP 504 and no response?

A 504 is a response: the server you reached is working and reports that something behind it timed out. No response means you didn't reach a working server at all.

Why does a 504 take so long to arrive?

The server waits for its next hop until its own timer runs out, and only then sends the 504. The delay you see is that timer.

Related codes

Know a line is down before your callers do

Line checks, real test calls and IVR verification for your call-center numbers, with alerts that say whose side failed.

Start free trial

14 days · full Pro features · no credit card