From bd1af0e8b7b676f9efbf6351c48588fd022c28ed Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 4 Dec 2024 08:55:45 -0400 Subject: [PATCH] MT#56465 support "other" for SDP media removal Change-Id: I25e68dc250f8edb4e32fedbf0b4e3939cffc09ce --- daemon/call_interfaces.c | 2 +- docs/ng_control_protocol.md | 3 ++ t/auto-daemon-tests.pl | 69 +++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 5ce132b79..a52eff5fe 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -695,7 +695,7 @@ INLINE void ng_sdp_attr_manipulations(const ng_parser_t *parser, sdp_ng_flags *f static void ng_sdp_media_remove_iter(str *media_type, unsigned int i, helper_arg arg) { enum media_type id = codec_get_type(media_type); - if (id == MT_UNKNOWN || id == MT_OTHER) + if (id == MT_UNKNOWN || (id == MT_OTHER && str_cmp(media_type, "other"))) { ilog(LOG_WARN, "SDP manipulations: unsupported SDP section '" STR_FORMAT "' targeted.", STR_FMT(media_type)); diff --git a/docs/ng_control_protocol.md b/docs/ng_control_protocol.md index e4304cfe1..94f632593 100644 --- a/docs/ng_control_protocol.md +++ b/docs/ng_control_protocol.md @@ -1627,6 +1627,9 @@ Examples: "sdp-media-remove" : ["video"] +IANA-registered media types are understood, or the special type `other` can be +given to remove all media sections with types that are not understood. + ## `answer` Message The `answer` message is identical to the `offer` message, with the additional requirement that the diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 5f1428cf3..17fb9cd07 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -21185,6 +21185,75 @@ SDP new_call; +offer('SDP media manipulations - remove "other"', { 'sdp-media-remove' => ['other']}, < 'remove', DTLS => 'off', SDES => [ 'nonew' ], 'sdp-media-remove' => ['audio']}, <