From 87e0dda3d3f068525d46c490b4b5db132fa0498c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 6 Mar 2014 20:05:02 -0600 Subject: [PATCH] no var set on outbound meands forbidden and on inbound it means optional --- src/switch_core_media.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index f78d116c59..6f49dc5166 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1105,7 +1105,15 @@ static void switch_core_session_parse_crypto_prefs(switch_core_session_t *sessio suites = (char *) switch_channel_get_variable(session->channel, "rtp_secure_media_suites"); } - if (zstr(val) || !strcasecmp(val, "optional")) { + if (zstr(val)) { + if (switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_INBOUND) { + val = "optional"; + } else { + val = "forbidden"; + } + } + + if (!strcasecmp(val, "optional")) { smh->crypto_mode = CRYPTO_MODE_OPTIONAL; } else if (switch_true(val) || !strcasecmp(val, "mandatory")) { smh->crypto_mode = CRYPTO_MODE_MANDATORY;