Skip to content

fix(transaction): retain exact ACKs for each answered fork - #247

Merged
yeoleobun merged 1 commit into
restsend:mainfrom
FedorKiselev76:codex/fix-fork-ack-cache
Nov 12, 2026
Merged

yeoleobun merged 1 commit into
restsend:mainfrom
FedorKiselev76:codex/fix-fork-ack-cache

Conversation

@FedorKiselev76

Copy link
Copy Markdown
Contributor

Fixes ACK handling when an INVITE receives successful responses from multiple forks.

Previously, only the latest ACK was retained. With responses A → B → retransmitted A, the stack could regenerate A’s ACK with a different Via branch and lose an application-provided SDP answer. After transaction cleanup, it could also replay another fork’s ACK to the wrong destination.

Cache successful ACKs by structured dialog identity and INVITE CSeq, preserving the exact request and resolved destination. Transfer these entries to the finished-transaction cache and expire them through the existing cleanup timer. Retransmissions do not restart Timer M.

Known forks receive their own cached ACK after the transaction owner is dropped. Unknown forks are not acknowledged using another fork’s request; applications must keep driving the Accepted transaction to handle new forks. Proxy responses with an upstream Via remain excluded from automatic ACK replay.

Two public-API UDP regressions cover alternating fork responses, exact ACK replay including SDP, destination selection, replay after drop, unknown forks, and cache expiry. Both reproduce failures before the fix.

Validation:

  • cargo test: 636 library tests, 2 public-API regressions, 7 harness tests, and 68 doctests passed.
  • cargo check --all-targets
  • cargo check --lib --no-default-features --features platform-embassy
  • cargo fmt --all --check
  • All 173 regular PJSIP/SIPp scenarios passed on an isolated checkout. Documented known-gap probes remain excluded.

@yeoleobun
yeoleobun force-pushed the codex/fix-fork-ack-cache branch from 569ec20 to f42ce14 Compare November 12, 2026 07:14
@yeoleobun
yeoleobun merged commit f99b5b6 into restsend:main Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants