Tip: type a SIP code like 488, or a problem like one-way audio. Use ↑ ↓ and Enter.

500 5xx Server error RFC 3261

SIP 500 Server Internal Error

The server hit an unexpected condition and could not complete the request.

Class5xx Server error
TypeFinal response
Defined inRFC 3261
Typical Q.850 cause41: Temporary failure

500 Server Internal Error means the server that answered hit a problem of its own while handling a request that looked valid. It is a catch-all: a crashed module, a failed database query, a broken script or dialplan, or a downstream failure the server chose to report as its own. The reason phrase is often the only clue in the SIP message, and the server's logs hold the real answer.

500 also has a legitimate use worth recognising. RFC 3261 requires a user agent that receives a second re-INVITE while an earlier one on the same call is still pending to reject the newer one with 500 and a Retry-After of up to 10 seconds. Proxies also send 500 when the only response they received was 503, because forwarding a 503 would tell upstream servers that the proxy itself is out of service.

For a caller, a 500 on a new call means immediate failure. Repeated 500s from one server on every call point to a fault on that server; occasional ones on re-INVITEs are usually timing collisions that resolve on retry.

What it looks like in a SIP trace

PBX   -> Phone : INVITE sip:2001@192.168.1.41:5060 SIP/2.0    (re-INVITE, CSeq 21: hold)
PBX   -> Phone : INVITE sip:2001@192.168.1.41:5060 SIP/2.0    (re-INVITE, CSeq 22: codec change)
Phone -> PBX   : SIP/2.0 500 Server Internal Error
   Via: SIP/2.0/UDP 192.168.1.10:5060;branch=z9hG4bK66d01e
   Call-ID: 8a2f61c3@192.168.1.10
   CSeq: 22 INVITE
   Retry-After: 4
   Content-Length: 0
PBX   -> Phone : ACK sip:2001@192.168.1.41:5060 SIP/2.0       (CSeq 22)
Phone -> PBX   : SIP/2.0 200 OK                                (CSeq 21)
PBX   -> Phone : ACK sip:2001@192.168.1.41:5060 SIP/2.0       (CSeq 21)
# The PBX may retry the codec change, with a new CSeq, after the Retry-After delay.

Example values only. Your headers, addresses and numbers will differ.

Common causes

  • A software fault or exception on the PBX or proxy.
  • Database or backend lookup failure.
  • Script or dialplan error.

How to diagnose it

  1. Note which server sent the 500 (Via, Server or User-Agent header) and the exact time, then go to that server's logs. The SIP response rarely explains the fault.
  2. Check whether the 500 answers a re-INVITE or UPDATE and carries Retry-After. That is the overlapping re-INVITE case, often caused by hold, transfer and session-timer updates colliding.
  3. If a proxy returned 500, check what it got from downstream. A 503 from every gateway, or a failure to relay at all (unresolvable destination, missing transport), is often reported upstream as 500.
  4. Check backend dependencies such as databases, DNS, AGI or REST scripts, LDAP and billing lookups. An error or timeout in any of them can surface as 500 on every call.
  5. Check recent changes. A dialplan or script edit, module update or certificate change shortly before the 500s began is the most likely cause.
  6. If 500s rise and fall with load, check CPU, memory and file descriptor limits, and whether the process restarted or logged out-of-memory errors.

How to fix it

  1. Check the server's error logs at the time of the call.
  2. Retry. Repeated 500s point to a bug or broken config that needs fixing on that server.

Platform notes

Asterisk / FreePBX

Search /var/log/asterisk/full for ERROR and WARNING lines around the call, and reproduce it with pjsip set logger on to capture the exact request. In FreePBX, run fwconsole reload after changes and read any errors it reports, because configuration problems after module updates are a common source of odd failures.

OpenSIPS / Kamailio

The OpenSIPS stock script replies 500 Internal Error when t_relay() fails, for example because the destination cannot be resolved or no listening socket matches its transport; Kamailio's default script calls sl_reply_error(), which reports the internal error with its own code. Add xlog lines around the relay and check the log for shared memory errors.

SIP 500 FAQ

Is SIP 500 my fault or the server's?

The server reports it, but the trigger can be on either side: your request may have hit a bug or unhandled case. Capture the request and give the server's owner the time and Call-ID.

Why do I get 500 with Retry-After during a call?

The device received a new re-INVITE while an earlier one was still pending, and RFC 3261 tells it to answer 500 with a short Retry-After. Frequent cases point to features sending updates at the same moment.

What is the difference between 500 and 503?

500 means the server failed while handling this request. 503 means it is overloaded, in maintenance or has no route or capacity, and may recover shortly.

Related guides

← Back to all SIP response codes