# SIP/2.0 406 不可接受

- **ID:** `communication/sip-406-not-acceptable`
- **领域:** communication
- **类别:** protocol_error
- **错误码:** `406`
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Asterisk 20.5.0 | active | — | — |
| FreeSWITCH 1.10.11 | active | — | — |
| Kamailio 5.7.0 | active | — | — |

## 解决方案

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.
   ```

## 无效尝试

- **Disable all SIP security checks in the server** — The 406 is about content negotiation, not security; disabling security may create vulnerabilities. (70% 失败率)
- **Ignore Accept headers entirely in client code** — The server may still reject requests if Accept headers are missing or malformed; proper negotiation is required. (60% 失败率)
