]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
no var set on outbound meands forbidden and on inbound it means optional
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 7 Mar 2014 02:05:02 +0000 (20:05 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 7 Mar 2014 02:05:02 +0000 (20:05 -0600)
src/switch_core_media.c

index f78d116c59819977ce85bc0ebdee0470353a8ea3..6f49dc5166f51f51202fc61eea366692b085488b 100644 (file)
@@ -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;