406 communication protocol_error ai_generated true

SIP/2.0 406 Not Acceptable

ID: communication/sip-406-not-acceptable

Also available as: JSON · Markdown · 中文
75%Fix Rate
82%Confidence
1Evidence
2024-01-22First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
Asterisk 20.5.0 active
FreeSWITCH 1.10.11 active
Kamailio 5.7.0 active

Root Cause

The SIP server cannot generate a response that matches the Accept header sent by the client.

generic

中文

SIP服务器无法生成符合客户端发送的Accept标头的响应。

Official Documentation

https://datatracker.ietf.org/doc/html/rfc3261#section-21.4.7

Workarounds

  1. 80% success Modify the SIP INVITE to include an Accept header with supported media types. Example: 'Accept: application/sdp' in the request. In Asterisk: set sip.conf globalaccept=application/sdp
    Modify the SIP INVITE to include an Accept header with supported media types. Example: 'Accept: application/sdp' in the request. In Asterisk: set sip.conf globalaccept=application/sdp
  2. 85% success Ensure the SIP server supports the requested media format. For example, in FreeSWITCH, check the codec list: 'show codec' and add missing codecs to the dialplan.
    Ensure the SIP server supports the requested media format. For example, in FreeSWITCH, check the codec list: 'show codec' and add missing codecs to the dialplan.

中文步骤

  1. Modify the SIP INVITE to include an Accept header with supported media types. Example: 'Accept: application/sdp' in the request. In Asterisk: set sip.conf globalaccept=application/sdp
  2. Ensure the SIP server supports the requested media format. For example, in FreeSWITCH, check the codec list: 'show codec' and add missing codecs to the dialplan.

Dead Ends

Common approaches that don't work:

  1. Disable all SIP security checks in the server 70% fail

    The 406 is about content negotiation, not security; disabling security may create vulnerabilities.

  2. Ignore Accept headers entirely in client code 60% fail

    The server may still reject requests if Accept headers are missing or malformed; proper negotiation is required.