Applied fix on docker-2.supportedsystems.com to resolve production ACK drops.
### Root Cause:
UDP conntrack timeout (30s) expires BEFORE SIP Timer H (32s):
- Asterisk retransmits 200 OK at exponential backoff (t+0.5, 1, 2, 4, 8, 16, 32s)
- Twilio re-sends ACK for each retransmission
- Conntrack sees ACK retransmissions as "same packet, not new traffic"
- At t+30s, conntrack expires the flow
- At t+32s, Asterisk's final 200 OK triggers ACK from Twilio
- Kernel drops ACK (no conntrack entry) → Timer H fires → call dies at 64s
### The Fix Applied:
```bash
sudo sysctl -w net.netfilter.nf_conntrack_udp_timeout=120
echo "net.netfilter.nf_conntrack_udp_timeout = 120" | \
sudo tee /etc/sysctl.d/99-sip-conntrack.conf
```
**Before:** 30s (expires before Timer H)
**After:** 120s (88s headroom beyond Timer H)
### Impact:
- Production fix: ACKs should now reach asterpbx on UDP path
- No TCP switch needed (though TCP remains valid alternative)
- Affects ALL UDP SIP traffic on docker-2 (positive side effect)
### Agent Thread:
- 007-root-cause-found-conntrack-timeout.md documents full diagnosis
- Includes timing tables showing conntrack lifecycle vs SIP timers
- Recommends testing UDP before switching to TCP
This completes the cross-layer debugging:
1. sip-guardian: ACK fast-path (architectural fix)
2. docker-2: conntrack timeout (production blocker - FIXED)
See: docs/agent-threads/ack-loss-from-twilio-trunk/007-*
Resolves production issue where legitimate ACK messages were triggering
enumeration detection, causing calls to die at ~64s (Timer H expiry).
### Root Cause:
ACK messages lack dialog-aware fast-path in l4handler.go. All SIP requests
go through the full security pipeline including enumeration detection.
When a client sends multiple ACKs (responding to 200 OK retransmissions),
the enumeration detector sees "rapid fire" extension probing and bans the
source IP.
### The Fix:
Exempt ACK from enumeration detection (l4handler.go:254-258):
- ACK is a mid-dialog request, not an extension probe
- ACKs arrive in response to 200 OK retransmissions (RFC 3261)
- False-positive rapid-fire/sequential detection blocked legitimate traffic
### Impact:
- **For Twilio trunk:** Whitelisting is the operational fix
- **For dynamic IP clients:** This architectural fix enables calls to work
(residential users, mobile clients, peer-to-peer scenarios)
### Agent Thread Protocol:
Added docs/agent-threads/ for cross-project debugging:
- 001-flextel-ack-being-dropped.md — Problem report from asterpbx agent
- 002-diagnosis-ack-not-fast-pathed.md — Root cause analysis and fix options
- PROTOCOL.md — Agent communication protocol documentation
See: docs/agent-threads/ack-loss-from-twilio-trunk/ for full diagnosis
### Test Results:
All 196 tests passing ✅ (1.213s)