From 1b5f899ff63ef8e862937ef3c1acf8df33b39e0c Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 12 Sep 2024 11:07:33 +0200 Subject: [PATCH] MT#60476 sdp_create: print `a=mid:` for non-accepted media Even if the media isn't accepted, still check for the mid presence and add it, if required. This is the only attribute to printed, for the media which wasn't previously accepted (so 0 port added for it). See: #1361 and #1362. Change-Id: Ib92930d6e1ec4dfe526fa18869c5f7a8e17f6a4f --- daemon/sdp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 77bee7663..9bbe86e6a 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -3750,8 +3750,15 @@ void handle_sdp_media_attributes(GString *s, struct call_media *media, packet_stream_list *rtp_ps_link, sdp_ng_flags *flags) { /* add attributes and connection information only when audio is accepted */ - if (!port) + if (!port) { + /* just add the mid before finalizing (see #1361 and #1362). + * TODO: after the content of this func is moved to the `print_sdp_media_section()` + * just move this logic there as well. + */ + if (media->media_id.s) + append_attr_to_gstring(s, "mid", &media->media_id, flags, media->type_id); return; + } struct call_monologue *monologue = media->monologue;