From 4e8a0725b73919bc615cbf3f7088a1e00a30db6d Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 28 May 2009 13:53:23 +0000 Subject: [PATCH] keep you from doing both zrtp and srtp at the same time. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13486 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_rtp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index db4e9ad80b..9f93efc1cf 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1108,6 +1108,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_channel_t *channel = switch_core_session_get_channel(session); const char *zrtp_enabled = switch_channel_get_variable(channel, "zrtp_secure_media"); + const char *srtp_enabled = switch_channel_get_variable(channel, "sip_secure_media"); + + if (switch_true(srtp_enabled)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You can not have ZRTP and SRTP enabled simultaneously, ZRTP will be disabled for this call!\n"); + switch_channel_set_variable(channel, "zrtp_secure_media", NULL); + zrtp_enabled = NULL; + } if (switch_true(zrtp_enabled)) { if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {