# SIP/2.0 414 请求URI过长（INVITE请求）

- **ID:** `communication/sip-request-uri-too-long`
- **领域:** communication
- **类别:** protocol_error
- **错误码:** `414`
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

SIP INVITE请求URI超过了SIP代理或注册器中配置的最大允许长度（通常为2048字节），通常是由于电话号码过长、URI参数过多或报头格式错误所致。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Asterisk 18.15.0 | active | — | — |
| FreeSWITCH 1.10.9 | active | — | — |
| Kamailio 5.6.0 | active | — | — |
| OpenSIPS 3.4.0 | active | — | — |
| Cisco Unified CM 14.0 | active | — | — |

## 解决方案

1. ```
   Increase the max URI length in Kamailio: edit kamailio.cfg, add 'modparam("sl", "max_uri_len", 4096)' and reload configuration.
   ```
2. ```
   Shorten the SIP URI by removing unnecessary URI parameters (e.g., user=phone, transport=tcp) in the dial plan or using a URI normalization function.
   ```

## 无效尝试

- **Disable SIP URI length check entirely in config** — Disabling the length check exposes the server to denial-of-service attacks via extremely long URIs and may violate SIP standards. (95% 失败率)
- **Increase TCP buffer size on the SIP proxy** — TCP buffer size does not affect the SIP URI length limit, which is enforced at the application layer by the SIP stack. (90% 失败率)
- **Restart the SIP service to clear the error** — Restarting only resets the connection state; the URI length violation reoccurs on the next INVITE with the same URI. (85% 失败率)
