Files
mattia aee2b7da29 res_pjsip: Add per-endpoint RTP port range configuration
Add rtp_port_start and rtp_port_end options to PJSIP endpoint
configuration, allowing each endpoint to use a dedicated RTP port
range instead of the global rtp.conf setting.

This is useful for scenarios where different endpoints need isolated
port ranges, such as firewall rules per trunk, multi-tenant systems,
or network QoS policies tied to port ranges.

The implementation adds ast_rtp_instance_new_with_port_range() to the
RTP engine API, which sets the port range on the instance before the
engine allocates the transport. The default RTP engine
(res_rtp_asterisk) checks for per-instance overrides in
rtp_allocate_transport() and falls back to the global range when
none is set.

Both options must be set together, with values >= 1024 and
rtp_port_end > rtp_port_start. Setting both to 0 (the default)
preserves existing behavior.

Resolves: https://github.com/asterisk/asterisk-feature-requests/issues/71

UserNote: PJSIP endpoints now support rtp_port_start and
rtp_port_end options to configure a dedicated RTP port range per
endpoint, overriding the global rtp.conf setting.

UpgradeNote: An alembic database migration has been added to add
the rtp_port_start and rtp_port_end columns to the ps_endpoints
table. Run "alembic upgrade head" to apply the schema change.

DeveloperNote: New public API: ast_rtp_instance_new_with_port_range()
creates an RTP instance with a per-instance port range.
ast_rtp_instance_get_port_start() and ast_rtp_instance_get_port_end()
allow RTP engines to query the override. Third-party RTP engines can
use these getters to support per-instance port ranges.
2026-04-28 17:45:52 +00:00
..
2025-02-20 21:46:27 +00:00
2025-02-20 21:46:27 +00:00
2025-02-20 21:46:27 +00:00
2025-02-20 21:46:27 +00:00
2023-12-08 13:11:48 +00:00
2025-02-20 21:46:27 +00:00
2023-12-08 13:11:48 +00:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2025-01-16 15:32:48 +00:00
2025-08-06 15:37:46 +00:00
2026-03-02 16:43:24 +00:00
2021-12-02 15:02:09 -06:00
2022-07-07 08:19:14 -05:00
2025-02-20 21:46:27 +00:00
2020-06-10 09:33:28 -05:00
2021-12-02 15:02:09 -06:00
2025-02-20 21:46:27 +00:00
2024-08-12 15:21:31 +00:00
2021-12-02 15:02:09 -06:00
2021-11-15 17:33:27 -06:00
2026-03-05 12:52:37 +00:00
2021-12-02 15:02:09 -06:00
2025-04-02 12:16:35 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2026-03-17 18:17:28 +00:00
2025-04-21 13:29:27 +00:00
2021-12-02 15:02:09 -06:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00
2025-01-29 14:17:54 +00:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2025-02-20 21:46:27 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2021-12-02 15:02:09 -06:00
2021-11-15 17:33:27 -06:00
2021-12-02 15:02:09 -06:00
2021-11-18 14:46:42 -06:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-06-02 16:35:27 +00:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00
2022-03-24 12:00:58 -05:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00