How to enable 400 Bad Request with syntax errors

I’m trying to find out if there is a setting that can be enabled to send a 400 Bad Request error when Asterisk/PJSIP receives a request with syntax errors.

For example, this INVITE has an Unterminated Quoted String in Display Name (To: "Mr. Nobody <sip:nobody…)

To: "Mr. Nobody sip:x.x.x.x:5060

The Asterisk logs show: “PJSIP syntax error exception when parsing ‘To’ header on line 4 col 5”, but the client doesn’t receive a 400 Bad Request error back. It just appears to not respond at all.

This is on FreePBX 15.0.29, and Asterisk 16.17.0

Is there a setting I can enable to have the server respond with a 400 Bad Request?

No, there is no setting. That happens at the low level PJSIP parsing. If that fails because it violates the specifications, then the message is dropped.

That makes sense. Thank you! :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.