From a4e3f96b3fa459e9ef6d74fe178ec13b51441d99 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 27 Sep 2021 10:01:55 -0400 Subject: [PATCH] TT#14008 always add a=mid to media section closes #1361 Change-Id: I8c3dfb54f47f0cfeb913f27b240eed55e2ca8154 --- daemon/sdp.c | 12 ++++++------ t/auto-daemon-tests.pl | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 6027ca8dd..c1028a03b 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2574,13 +2574,13 @@ static struct packet_stream *print_sdp_media_section(GString *s, struct call_med { struct packet_stream *ps_rtcp = NULL; - if (is_active) { - if (media->media_id.s) { - g_string_append(s, "a=mid:"); - g_string_append_printf(s, STR_FORMAT, STR_FMT(&media->media_id)); - g_string_append(s, "\r\n"); - } + if (media->media_id.s) { + g_string_append(s, "a=mid:"); + g_string_append_printf(s, STR_FORMAT, STR_FMT(&media->media_id)); + g_string_append(s, "\r\n"); + } + if (is_active) { if (proto_is_rtp(media->protocol)) insert_codec_parameters(s, media); diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 5b6d2352d..6888c4db1 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -40,6 +40,37 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, +new_call; + +offer('a=mid on zero streams', { }, <