# SIP/2.0 481 Call/Transaction Does Not Exist

- **ID:** `communication/sip-481-loop-detected`
- **Domain:** communication
- **Category:** protocol_error
- **Error Code:** `481`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kamailio 5.7 | active | — | — |
| FreeSWITCH 1.10 | active | — | — |
| Asterisk 20 | active | — | — |
| opensips 3.5 | active | — | — |

## Workarounds

1. **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.** (82% success)
   ```
   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.
   ```
2. **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.** (75% success)
   ```
   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.
   ```
3. **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.** (80% success)
   ```
   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.
   ```

## Dead Ends

- **Restart the SIP proxy service to clear all dialogs** — 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. (95% fail)
- **Increase transaction timeout values in SIP config** — 481 is not a timeout error; it's a state machine inconsistency. Longer timeouts only delay the inevitable failure. (85% fail)
- **Disable SIP forking entirely** — 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. (60% fail)
