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' }, <