From 41b4db7bda5e4970cb51686b9983d6cdb1264942 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 2ed622ef0..30655f1cf 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2382,15 +2382,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 aab70e769..438082e74 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -38,6 +38,37 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $resp, # DTLS early start with ICE (GH 1035 TT 84804) +new_call; + +offer('a=mid on zero streams', { ICE => 'remove' }, <