From b0edf59a8f43b5c2eaf2062188b899537f37b93d Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 24 Apr 2015 11:29:48 -0400 Subject: [PATCH] don't reset certain stream flags for disabled (zero port) streams --- daemon/call.c | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 16a254aaa..bdf7668ad 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2458,15 +2458,17 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams, && other_media->protocol && other_media->protocol->rtp) media->protocol = flags->transport_protocol; - /* copy parameters advertised by the sender of this message */ - bf_copy_same(&other_media->media_flags, &sp->sp_flags, - SHARED_FLAG_RTCP_MUX | SHARED_FLAG_ASYMMETRIC | SHARED_FLAG_ICE - | SHARED_FLAG_TRICKLE_ICE | SHARED_FLAG_ICE_LITE); - - crypto_params_copy(&other_media->sdes_in.params, &sp->crypto); - other_media->sdes_in.tag = sp->sdes_tag; - if (other_media->sdes_in.params.crypto_suite) - MEDIA_SET(other_media, SDES); + if (sp->rtp_endpoint.port) { + /* copy parameters advertised by the sender of this message */ + bf_copy_same(&other_media->media_flags, &sp->sp_flags, + SHARED_FLAG_RTCP_MUX | SHARED_FLAG_ASYMMETRIC | SHARED_FLAG_ICE + | SHARED_FLAG_TRICKLE_ICE | SHARED_FLAG_ICE_LITE); + + crypto_params_copy(&other_media->sdes_in.params, &sp->crypto); + other_media->sdes_in.tag = sp->sdes_tag; + if (other_media->sdes_in.params.crypto_suite) + MEDIA_SET(other_media, SDES); + } __rtp_payload_types(media, &sp->rtp_payload_types); @@ -2476,22 +2478,24 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams, bf_copy(&other_media->media_flags, MEDIA_FLAG_RECV, &sp->sp_flags, SP_FLAG_SEND); bf_copy(&other_media->media_flags, MEDIA_FLAG_SEND, &sp->sp_flags, SP_FLAG_RECV); - /* DTLS stuff */ - __dtls_logic(flags, media, other_media, sp); + if (sp->rtp_endpoint.port) { + /* DTLS stuff */ + __dtls_logic(flags, media, other_media, sp); - /* control rtcp-mux */ - __rtcp_mux_logic(flags, media, other_media); + /* control rtcp-mux */ + __rtcp_mux_logic(flags, media, other_media); - /* SDES and DTLS */ - __generate_crypto(flags, media, other_media); + /* SDES and DTLS */ + __generate_crypto(flags, media, other_media); - /* deduct address family from stream parameters received */ - other_media->desired_family = family_from_address(&sp->rtp_endpoint.ip46); - /* for outgoing SDP, use "direction"/DF or default to what was offered */ - if (!media->desired_family) - media->desired_family = other_media->desired_family; - if (sp->desired_family) - media->desired_family = sp->desired_family; + /* deduct address family from stream parameters received */ + other_media->desired_family = family_from_address(&sp->rtp_endpoint.ip46); + /* for outgoing SDP, use "direction"/DF or default to what was offered */ + if (!media->desired_family) + media->desired_family = other_media->desired_family; + if (sp->desired_family) + media->desired_family = sp->desired_family; + } /* local interface selection */ __init_interface(media, &sp->direction[1]);