From 1969ac61c8945f5aa34238a3f60797f3b90f3f5f Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 1 Oct 2024 16:57:02 +0200 Subject: [PATCH] MT#60476 For non-accepted medias print `c=` before all Print the `c=` attribute before all other attributes. Additionally: fix tests accordingly. Change-Id: I338a84d79ed9d7045bcfd0f07a40a16b986d2fcc --- daemon/sdp.c | 5 +++-- t/auto-daemon-tests.pl | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 34343170c..106beee56 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2640,12 +2640,13 @@ static void print_sdp_media_section(GString *s, struct call_media *media, /* add attributes and connection information only when audio is accepted */ if (!address || !address->port || !rtp_ps->selected_sfd) { + /* print zeroed address for the non accepted media, see RFC 3264 */ + sdp_out_add_media_connection(s, media, rtp_ps, NULL, flags); + /* just add the mid before finalizing (see #1361 and #1362). */ if (media->media_id.s) append_attr_to_gstring(s, "mid", &media->media_id, flags, media->type_id); - /* print zeroed address for the non accepted media, see RFC 3264 */ - sdp_out_add_media_connection(s, media, rtp_ps, NULL, flags); return; } diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index c911d1f13..19b02affa 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -298,8 +298,8 @@ a=content:main a=sendrecv a=rtcp:PORT m=application 0 RTP/AVP 0 -a=mid:5 c=IN IP4 0.0.0.0 +a=mid:5 SDP reverse_tags; @@ -596,8 +596,8 @@ a=sendrecv a=rtcp:PORT a=rtcp-mux m=application 0 RTP/AVP 0 -a=mid:5 c=IN IP4 0.0.0.0 +a=mid:5 SDP answer('a=mid mixup', { }, <