// SIP 4xx Client failure

SIP 400 Bad Request

The request was malformed.

4xx Client failure · RFC 3261 · Answer to OPTIONS: Up, but it could not parse our request.

What SIP 400 means

A 400 means the server received the request but couldn't understand it because of malformed syntax: a missing or broken header, a bad URI, or a body that doesn't match its Content-Length. RFC 3261 asks the server to name the problem in the reason phrase, so a real 400 often reads like "Missing Call-ID header" rather than just "Bad Request".

A 400 can answer any method. It tells the sender to fix the request, not to retry it: the same bytes sent again get the same answer. Because it points at the sender, it usually means a software bug or a device on the path that rewrote the message, not a problem with the server itself.

Example response

SIP/2.0 400 Bad Request
Via: SIP/2.0/UDP 198.51.100.15:5060;branch=z9hG4bK-400-g7
From: <sip:+[email protected]>;tag=a7c9
To: <sip:+[email protected]>;tag=bx-31
Call-ID: [email protected]
CSeq: 3 INVITE
Warning: 399 sbc.example.net "Malformed From header"
Content-Length: 0

Common causes of SIP 400

  • A header the server requires, such as Max-Forwards, CSeq or Call-ID, is missing or malformed.
  • A router or firewall with a SIP ALG rewrote addresses in the message and broke its syntax or its Content-Length.
  • A UDP request was larger than the path MTU, was fragmented, and arrived incomplete.
  • A display name or URI contains characters that should have been quoted or escaped.
  • The SDP body is malformed, for example missing a line the server needs to parse it.

How to fix SIP 400

  1. Read the server's own reason phrase and any Warning header; they often name the broken header.
  2. Capture the request as it leaves your system and as it arrives at the server; if the two differ, something on the path changed it.
  3. Turn off SIP ALG on the routers and firewalls between you and the server.
  4. If large INVITEs fail and small ones don't, move the trunk to TCP: RFC 3261 asks clients to use TCP for requests within 200 bytes of the path MTU.
  5. Check the SDP against what the server expects and remove lines it may not parse.

SIP 400 as an answer to OPTIONS

A 400 to OPTIONS means the server is up and reading SIP, but rejected the probe as malformed. PingVo's free check shows the standard reason phrase, not the server's own, so the server's logs are where the detail is. A PingVo Route counts a 400 as reachable by default, because something did answer.

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

Questions about SIP 400

Should I retry after a SIP 400?

Not with the same request. The server has already said it can't parse it, so a retry gets the same answer. Fix the message first.

Why do I get 400 on some calls only?

Look for what those calls have in common: a long header, an unusual caller name, a large SDP or a different network path. Size-related 400s often go away over TCP.

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