MT#62053 add support for RTP port ranges

Change-Id: I1dc734b954772c03077c6576331e117c919d3d5c
master
Richard Fuchs 3 months ago
parent b5b92cae0f
commit 2b40e7b986

@ -80,6 +80,8 @@ IF status.item(hosts.$X_host.status);
name = X_name
address = X_ip
adv_addr = X_adv_ip
port_min = X_ifc.rtp_port_min || 0
port_max = X_ifc.rtp_port_max || 0
};
out.push(X_obj);
ELSE;
@ -111,6 +113,8 @@ IF status.item(hosts.$X_host.status);
X_obj = {
name = X_name
address = X_ip
port_min = X_ifc.rtp_port_min || 0
port_max = X_ifc.rtp_port_max || 0
};
out.push(X_obj);
ELSE;

@ -70,6 +70,8 @@ FOREACH X_ifc IN argv.instance.interfaces;
name = X_name
address = X_ip
adv_addr = X_adv_ip
port_min = X_ifc.rtp_port_min || 0
port_max = X_ifc.rtp_port_max || 0
};
out.push(X_obj);
ELSE;
@ -101,6 +103,8 @@ FOREACH X_ifc IN argv.instance.interfaces;
X_obj = {
name = X_name
address = X_ip
port_min = X_ifc.rtp_port_min || 0
port_max = X_ifc.rtp_port_max || 0
};
out.push(X_obj);
ELSE;

@ -68,6 +68,7 @@ my $peer;
my @remove_host;
my @remove_interface;
my @roles;
my $rtp_ports,
my @set_interface;
my $shared_ip;
my $shared_ip_only;
@ -125,6 +126,7 @@ GetOptions(
'peer=s' => \$peer,
'remove-host=s' => \@remove_host,
'remove-interface=s' => \@remove_interface,
'rtp-ports=s' => \$rtp_ports,
'role=s' => \@roles,
'set-interface=s' => \@set_interface,
'shared-ip=s' => \$shared_ip,
@ -192,6 +194,27 @@ foreach my $opt (
}
}
my ($rtp_port_min, $rtp_port_max);
if (defined $rtp_ports) {
if ($rtp_ports =~ /^none$|^delete$/msx) {
$rtp_port_min = "none";
$rtp_port_max = "none";
}
elsif ($rtp_ports =~ /^(\d+),(\d+)$/msx) {
($rtp_port_min, $rtp_port_max) = ($1, $2);
if ($rtp_port_min <= 0 || $rtp_port_max <= 0
|| $rtp_port_min > 65535 || $rtp_port_max > 65535
|| $rtp_port_min >= $rtp_port_max) {
logger("invalid RTP port range $rtp_ports");
croak "Invalid RTP port range '$rtp_ports'";
}
}
else {
logger("invalid RTP port range $rtp_ports");
croak "Invalid RTP port range '$rtp_ports'";
}
}
# }}}
logger("reading input file $inputfile");
@ -335,6 +358,8 @@ sub set_interface {
'openvpn_key_template' => $openvpn_key_template,
'openvpn_key_inline' => $openvpn_key_inline,
'v6netmask' => $netmask_ip_v6,
'rtp_port_max' => $rtp_port_max,
'rtp_port_min' => $rtp_port_min,
'shared_ip' => $shared_ip,
'shared_ip_only' => $shared_ip_only,
'shared_v6ip' => $shared_ip_v6,
@ -865,6 +890,12 @@ Can be specified multiple times (B<--remove-interface=eth5 --remove-interface=et
Set role configuration for host to specified argument.
Can be specified multiple times (B<--role=lb --role=proxy ...>).
=item B<--rtp-ports>=I<min>,I<max>B<|none|delete>
Set a port range to be used for RTP media if different from the globally set
port range. Set to B<none> or B<delete> to remove the setting and revert to the
global port range.
=item B<--set-interface>=I<name>
Add specified network interface. Can be combined with options like B<--hwaddr>,

Loading…
Cancel
Save