diff --git a/daemon/call.c b/daemon/call.c index a4591eeb1..9e5a65566 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1499,7 +1499,7 @@ static void __generate_crypto(const struct sdp_ng_flags *flags, struct call_medi MEDIA_CLEAR(this, SETUP_PASSIVE); MEDIA_CLEAR(this, SETUP_ACTIVE); - if (MEDIA_ISSET(this, PASSTHRU) && other) { + if (other && (MEDIA_ISSET(this, PASSTHRU) || !other->protocol)) { /* clear crypto for the other leg as well b/c passthrough only * works if it is done for both legs */ MEDIA_CLEAR(other, DTLS); diff --git a/daemon/ice.c b/daemon/ice.c index 85770c312..bdde63425 100644 --- a/daemon/ice.c +++ b/daemon/ice.c @@ -535,7 +535,7 @@ void ice_update(struct ice_agent *ag, struct stream_params *sp, bool allow_reset comps = 0; for (l = media->streams.head; l; l = l->next) components[comps++] = l->data; - if (comps == 2 && MEDIA_ISSET(media, RTCP_MUX)) + if (comps == 2 && (MEDIA_ISSET(media, RTCP_MUX) || !proto_is_rtp(media->protocol))) components[1] = NULL; comps = 0; diff --git a/daemon/sdp.c b/daemon/sdp.c index 1f851b2df..f5ab7bb35 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2343,6 +2343,7 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * if (subst_str) goto strip_with_subst; + // protocol-agnostic attributes switch (attr->attr) { case ATTR_ICE: case ATTR_ICE_UFRAG: @@ -2371,12 +2372,6 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * break; goto strip; - case ATTR_RTCP: - case ATTR_RTCP_MUX: - if (flags->ice_option == ICE_FORCE_RELAY) - break; - goto strip; - case ATTR_IGNORE: case ATTR_END_OF_CANDIDATES: // we strip it here and re-insert it later case ATTR_MID: @@ -2390,6 +2385,21 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * goto strip; break; + default: + break; + } + + // leave everything alone if protocol is unsupported + if (!media->protocol) + continue; + + switch (attr->attr) { + case ATTR_RTCP: + case ATTR_RTCP_MUX: + if (flags->ice_option == ICE_FORCE_RELAY) + break; + goto strip; + case ATTR_RTPMAP: case ATTR_FMTP: if (media->codecs.codec_prefs.length > 0) @@ -2934,12 +2944,13 @@ static struct packet_stream *print_sdp_media_section(GString *s, struct call_med ps_rtcp = print_rtcp(s, media, rtp_ps_link, flags, sdp_media); - insert_crypto(s, media, flags); - insert_dtls(s, media, dtls_ptr(rtp_ps->selected_sfd), flags); + if (proto_is_rtp(media->protocol)) { + insert_crypto(s, media, flags); + insert_dtls(s, media, dtls_ptr(rtp_ps->selected_sfd), flags); - if (proto_is_rtp(media->protocol) && media->ptime) { - append_attr_int_to_gstring(s, "a=ptime:", &media->ptime, flags, - media->type_id); + if (media->ptime) + append_attr_int_to_gstring(s, "a=ptime:", &media->ptime, flags, + media->type_id); } if (MEDIA_ISSET(media, ICE) && media->ice_agent) { diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index caf199e49..83a36ac79 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -20935,6 +20935,99 @@ SDP is($port_a, $port_b, 'port unchanged'); +# GH #1715 + +new_call; +offer('GH #1715', {ICE => 'remove', "transport-protocol" => "RTP/AVP"}, <