Skip to content

Refine SIP session timer negotiation behavior#198

Merged
shenjinti merged 1 commit intorestsend:mainfrom
yeoleobun:refine-sip-session-timer-behavior
Apr 22, 2026
Merged

Refine SIP session timer negotiation behavior#198
shenjinti merged 1 commit intorestsend:mainfrom
yeoleobun:refine-sip-session-timer-behavior

Conversation

@yeoleobun
Copy link
Copy Markdown
Collaborator

Summary

  • separate the basic session_timer switch from a new session_timer_always option
  • align session timer negotiation and refresher selection with PJPROJECT behavior
  • keep local refresh ownership in always mode when a successful refresh response omits Session-Expires

Why

The previous implementation mixed negotiated and forced session-timer behavior behind one flag, which made it hard to match PJPROJECT semantics. It also had a caller-leg bug in always mode: when the peer replied to a refresh without Session-Expires, the code forced the refresher to uac unconditionally, which could flip ownership to the remote side on the inbound leg and stop further local refreshes.

Impact

  • session_timer=true keeps the normal negotiated behavior
  • session_timer_always=true forces PJPROJECT-style always behavior without using Require: timer
  • inbound and outbound legs now choose the refresher consistently with PJPROJECT
  • the caller leg no longer stops refreshing after a header-less 200 OK in always mode

Validation

  • cargo test test_session_timer_mode -- --nocapture
  • cargo test session_timer -- --nocapture
  • cargo test apply_refresh_response -- --nocapture
  • cargo test test_init_callee_timer_disabled_without_session_expires -- --nocapture

@yeoleobun yeoleobun marked this pull request as ready for review April 21, 2026 14:26
@shenjinti shenjinti merged commit aa19fde into restsend:main Apr 22, 2026
3 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