From b5f75a0f435fe80cd143d3c5b8eb3961a8e2d97f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 27 May 2015 16:48:16 -0500 Subject: [PATCH] FS-7582 #resolve #comment port from 1.6 its probably better to start working on 1.6 for any webrtc or dtls stuff --- src/switch_core_media.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 48ea843cfe..4128b50f69 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -5885,6 +5885,15 @@ static const char *get_media_profile_name(switch_core_session_t *session, int se } +static char *get_setup(switch_core_session_t *session) +{ + if (switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_INBOUND && !switch_channel_test_flag(session->channel, CF_RECOVERING)) { + return "active"; + } + + return "actpass"; +} + //? static void generate_m(switch_core_session_t *session, char *buf, size_t buflen, switch_port_t port, const char *family, const char *ip, @@ -6041,10 +6050,10 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen, } if (!zstr(a_engine->local_dtls_fingerprint.type) && secure) { - switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=fingerprint:%s %s\n", a_engine->local_dtls_fingerprint.type, - a_engine->local_dtls_fingerprint.str); + switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=fingerprint:%s %s\na=setup:%s\n", a_engine->local_dtls_fingerprint.type, + a_engine->local_dtls_fingerprint.str, get_setup(session)); } - + if (smh->mparams->rtcp_audio_interval_msec) { if (a_engine->rtcp_mux > 0) { switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtcp-mux\n"); @@ -6649,8 +6658,8 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess if (!zstr(a_engine->local_dtls_fingerprint.type)) { - switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=fingerprint:%s %s\n", a_engine->local_dtls_fingerprint.type, - a_engine->local_dtls_fingerprint.str); + switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=fingerprint:%s %s\na=setup:%s\n", a_engine->local_dtls_fingerprint.type, + a_engine->local_dtls_fingerprint.str, get_setup(session)); } if (smh->mparams->rtcp_audio_interval_msec) { @@ -7046,8 +7055,8 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess if (!zstr(v_engine->local_dtls_fingerprint.type)) { - switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=fingerprint:%s %s\n", v_engine->local_dtls_fingerprint.type, - v_engine->local_dtls_fingerprint.str); + switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=fingerprint:%s %s\na=setup:%s\n", v_engine->local_dtls_fingerprint.type, + v_engine->local_dtls_fingerprint.str, get_setup(session)); }