diff --git a/daemon/sdp.c b/daemon/sdp.c index 9e8621d9b..d4297cdb2 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2604,15 +2604,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 e1aebdec6..df275d77c 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -40,6 +40,37 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, +new_call; + +offer('a=mid on zero streams', { }, <