406 communication protocol_error ai_generated true

SIP/2.0 406 不可接受

SIP/2.0 406 Not Acceptable

ID: communication/sip-406-not-acceptable

其他格式: JSON · Markdown 中文 · English
75%修复率
82%置信度
1证据数
2024-01-22首次发现

版本兼容性

版本状态引入弃用备注
Asterisk 20.5.0 active
FreeSWITCH 1.10.11 active
Kamailio 5.7.0 active

根因分析

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

English

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

generic

官方文档

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

解决方案

  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.

无效尝试

常见但无效的做法:

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

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

  2. Ignore Accept headers entirely in client code 60% 失败

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