From 415af36ae62d6fc9f50a5a797ef5681009d8aa0f Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 23 Jan 2019 12:13:19 -0500 Subject: [PATCH] don't add rtpmap or mid attributes for deleted/silenced streams fixes #686 Change-Id: Ie9a155072a8b6acb8edcf59a5dd164f78a503616 --- daemon/sdp.c | 6 +++--- t/auto-daemon-tests.pl | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index d4414df29..f15d11f07 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2085,6 +2085,9 @@ 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); @@ -2102,9 +2105,6 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu assert(j->data == ps_rtcp); } - if (!sdp_media->port_num || !ps->selected_sfd) - goto next; - if (!flags->original_sendrecv) { if (MEDIA_ARESET2(call_media, SEND, RECV)) chopper_append_c(chop, "a=sendrecv\r\n"); diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 17ccc7857..ae5b24f94 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -465,6 +465,36 @@ a=candidate:ICEBASE 2 UDP 2130706430 203.0.113.1 PORT typ host a=candidate:ICEBASE 2 UDP 2130706174 2001:db8:4321::1 PORT typ host SDP +# github issue #686 + +new_call; + +offer('gh 686', { ICE => 'remove' }, <