Skip to content

How to set rtp port range? #439

Answered by sipsorcery
mattiaspihl asked this question in Q&A
Discussion options

You must be logged in to vote

There's currently no option to set the port range used by RTPSession. You can pass a single port to the RTPSession constructor if you have an exact port you want to use.

The reason the port range was removed was to switch to using each Operating Systems' Ephemeral port range. This removed the need for some tricky logic for things like:

  • Tracking which ports had been used (or recently used) and wrapping around,
  • Allocating ports in a pseudo random fashion to avoid a malicious party being able to easily find in use ports,
  • Bring in line with how other applications, such as WebRTC browsers, allocate port.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mattiaspihl
Comment options

Answer selected by mattiaspihl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants