From 088c4d9201cc8b709a5a184975130734188171c8 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 28 Feb 2023 08:42:26 -0500 Subject: [PATCH] MT#56128 add SDP manipulations to ng-client Change-Id: I876aba63cc6875c9c2677f4a2bb2bde729a02f73 --- utils/rtpengine-ng-client | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/utils/rtpengine-ng-client b/utils/rtpengine-ng-client index e8e698b62..db16a3adc 100755 --- a/utils/rtpengine-ng-client +++ b/utils/rtpengine-ng-client @@ -131,6 +131,16 @@ my @replace_opts = qw( force-increment-sdp-version ); +my @sdp_attr_sections = qw( + global + audio + video +); +my @sdp_attr_commands = qw( + add + remove +); + my %getopt = ( 'json' => \$options{'json'}, 'proxy-address=s' => \$options{'proxy-address'}, @@ -161,6 +171,11 @@ for my $flag (@codec_opts) { for my $flag (@replace_opts) { $getopt{"replace-$flag"} = \$options{"replace-$flag"}; } +for my $sect (@sdp_attr_sections) { + for my $cmd (@sdp_attr_commands) { + $getopt{"sdp-attr-$sect-$cmd=s@"} = \$options{"sdp-attr-$sect-$cmd"}; + } +} GetOptions(%getopt) or die; @@ -206,6 +221,13 @@ for my $x (@codec_opts) { } } } +for my $sect (@sdp_attr_sections) { + for my $cmd (@sdp_attr_commands) { + if ($options{"sdp-attr-$sect-$cmd"} && @{$options{"sdp-attr-$sect-$cmd"}}) { + $packet{'sdp-attr'}{$sect}{$cmd} = $options{"sdp-attr-$sect-$cmd"}; + } + } +} sub slurp_file { local $/ = undef;