From b1b81e7964e71fea1ef5f2f26e105c80196c0a75 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 (cherry picked from commit a4e3f96b3fa459e9ef6d74fe178ec13b51441d99) --- daemon/sdp.c | 6 +++--- t/auto-daemon-tests.pl | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 9e8621d9b..d4297cdb2 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2604,15 +2604,15 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu copy_up_to_end_of(chop, &sdp_media->s); - if (!sdp_media->port_num || !ps->selected_sfd) - goto next; - if (call_media->media_id.s) { chopper_append_c(chop, "a=mid:"); chopper_append_str(chop, &call_media->media_id); chopper_append_c(chop, "\r\n"); } + if (!sdp_media->port_num || !ps->selected_sfd) + goto next; + if (proto_is_rtp(call_media->protocol)) insert_codec_parameters(chop, call_media); diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index e1aebdec6..df275d77c 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', { }, <