Skip to content

fix(sip): bound RTP allocation to configured range - #71

Merged
ryanmurf merged 1 commit into
masterfrom
fix/70-bounded-rtp-ports
Jul 13, 2026
Merged

fix(sip): bound RTP allocation to configured range#71
ryanmurf merged 1 commit into
masterfrom
fix/70-bounded-rtp-ports

Conversation

@ryanmurf

Copy link
Copy Markdown
Owner

Summary

  • load Asterisk-compatible [general] rtpstart/rtpend settings from rtp.conf and fail startup on invalid configured ranges
  • reserve UDP sockets through one bounded allocator shared by inbound and outbound SIP call paths
  • return SIP 503 and remove transient call state when the range is exhausted
  • release the reservation with channel teardown and update the inbound media E2E to assert the advertised port is bounded

Asterisk documents rtpstart/rtpend as the inclusive RTP range in its canonical rtp.conf sample: https://github.com/asterisk/asterisk/blob/master/configs/samples/rtp.conf.sample

The SDP answer continues to advertise the actual bound UDP port in the media description, per RFC 4566 section 5.14: https://www.rfc-editor.org/rfc/rfc4566#section-5.14

Regression coverage

  • parses and validates Asterisk-style RTP range settings
  • exhausts a one-port allocator, then reuses the port after the session drops
  • exhausts a one-port call range, then reuses it after ChannelDriver::hangup tears down the first call
  • verifies inbound exhaustion returns 100 then 503 with no live handler or driver call state
  • verifies the authenticated inbound RTP echo path advertises a port inside the default bounded range

Validation

  • cargo +1.97.0 clippy --workspace --exclude pjsip-shim -- -D warnings
  • cargo +1.97.0 test --workspace --exclude pjsip-shim

Fixes #70

@ryanmurf
ryanmurf merged commit 9663aaa into master Jul 13, 2026
3 checks passed
@ryanmurf
ryanmurf deleted the fix/70-bounded-rtp-ports branch July 13, 2026 23:44
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.

SIP call paths allocate RTP from unbounded kernel-ephemeral ports

1 participant