Skip to content

feat(dialog): add opt-in RFC 4028 session timers - #241

Draft
FedorKiselev76 wants to merge 15 commits into
restsend:mainfrom
FedorKiselev76:codex/session-timers
Draft

FedorKiselev76 wants to merge 15 commits into
restsend:mainfrom
FedorKiselev76:codex/session-timers

Conversation

@FedorKiselev76

@FedorKiselev76 FedorKiselev76 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds opt-in RFC 4028 session timers for UAC and UAS dialogs.

Implements Session-Expires and Min-SE negotiation, refresher selection, bounded 422 retries, automatic UPDATE/re-INVITE refreshes, and termination on refresh failure or expiration. Includes SDP callbacks and timer worker cleanup.

Depends on #240 and #244; #244 depends on #245. This branch includes those prerequisites. Merge the bridge/PRACK chain (#239, #240) and the snapshot/persistence chain (#245, #244) before this PR. The snapshot API's proposed 0.9.0 release boundary still requires maintainer approval.

Updated onto upstream main at 895d443 and integrated with optional persistence. Two additional regressions cover the interactions found during integration:

  • INVITE retries after 422 retain persistence barriers and receipt timestamps. A failed storage commit prevents the retry from being sent.
  • Automatically answered bodyless UPDATE requests record a pending negotiation before the response and persist the refreshed Contact target after completion.

Disabled by default. Session timers operate independently on each dialog leg. Coordinating refresh policies and propagating termination between B2BUA legs remains the application's responsibility.

Validation:

  • cargo test on this branch: 740 library tests, 7 downstream reconstruction tests, 7 harness tests, and 72 documentation tests passed; one documentation test is ignored.
  • All 8 SIPp timer cases passed with RSIPSTACK_INTEROP_CHECKPOINTS=1.
  • The final combined stack, including test(interop): add concurrent session timer soak tests #242, passed all 206 short interop regression scenarios in both default and checkpoint modes, plus all-targets and Embassy checks.

The checkpoint switch configures in-process dialog-peer fixtures. Standalone proxy/B2BUA applications run with their own dialog layers and are not configured by this switch.

Add a public constructor for non-exhaustive lifecycle records so applications can reconstruct persisted history. Keep restore-time history validation unchanged.

Exercise the API from an external integration test across two restores, including absent timestamps and invalid history. Verify the constructor documentation and Embassy build.
Make DialogSnapshot non-exhaustive and require explicit state, CSeq counters and recovery metadata through its public builder. Preserve optional stored values and validate confirmed lifecycle history without discarding pending work.

Document the proposed 0.9.0 release gate, legacy storage migration and changed restore behavior. Exercise downstream reconstruction and snapshot admission around the upstream re-INVITE handlers.
Verify that incoming re-INVITE responses wait for storage and that ACK completion produces a quiescent checkpoint. Exercise successful and failed commits before a deferred outgoing ACK handler.

Clarify that the interop checkpoint switch configures in-process dialog peers, not the standalone proxy and B2BUA applications.
The caller can report CONFIRMED before the proxy forwards ACK. Wait for a SIPp receive marker before requesting hangup, so this scenario tests retransmission of BYE instead of racing it with the initial ACK.
# Conflicts:
#	src/dialog/dialog.rs
#	src/dialog/dialog_layer.rs
#	src/dialog/invite_dialog.rs
#	src/dialog/mod.rs
#	src/transaction/transaction.rs
Retain persistence and receipt timing on 422 retries. Track automatic bodyless UPDATE responses as negotiations and commit the refreshed target after completion. Cover successful and failed retry writes and delayed UPDATE storage with wire regression tests.
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.

1 participant