SIP/2.0 481 呼叫/事务不存在
SIP/2.0 481 Call/Transaction Does Not Exist
ID: communication/sip-481-loop-detected
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Kamailio 5.7 | active | — | — | — |
| FreeSWITCH 1.10 | active | — | — | — |
| Asterisk 20 | active | — | — | — |
| opensips 3.5 | active | — | — | — |
根因分析
SIP 代理或 B2BUA 收到了一个针对已终止或从未创建的对话或事务的请求,通常是由于分叉请求或 CANCEL 乱序导致。
English
SIP proxy or B2BUA receives a request for a dialog or transaction that it has already terminated or never created, often due to forked requests or out-of-order CANCEL.
官方文档
https://datatracker.ietf.org/doc/html/rfc3261#section-21.4.3解决方案
-
Enable SIP dialog tracking in Kamailio: `modparam("dialog", "track_cseq_updates", 1)` and ensure `dlg_flag` is set on initial INVITE. Also add `failure_route` to handle 481 gracefully by sending ACK and clearing state. -
Configure FreeSWITCH to handle 481 by setting `sip-force-expires` on re-INVITE and enabling `sip-call-id` validation in the dialplan to reject mismatched requests.
-
Add a SIP route in Asterisk that matches 481 responses and sends a CANCEL or BYE to clean up the dangling transaction on the upstream leg.
无效尝试
常见但无效的做法:
-
Restart the SIP proxy service to clear all dialogs
95% 失败
The error is caused by dialog state mismatch, not by stale state. Restarting loses all active calls and won't fix the routing logic that creates the mismatch.
-
Increase transaction timeout values in SIP config
85% 失败
481 is not a timeout error; it's a state machine inconsistency. Longer timeouts only delay the inevitable failure.
-
Disable SIP forking entirely
60% 失败
While forking can contribute to 481 errors, disabling it breaks legitimate call distribution and is an overreaction. The root cause is usually improper dialog tracking.