diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 1f136390bd..35c0c99716 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1173,10 +1173,12 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh #endif switch_b64_encode(key, SUITES[ctype].keylen, b64_key, sizeof(b64_key)); - p = strrchr((char *) b64_key, '='); + if (!switch_channel_var_true(channel, "rtp_pad_srtp_keys")) { + p = strrchr((char *) b64_key, '='); - while (p && *p && *p == '=') { - *p-- = '\0'; + while (p && *p && *p == '=') { + *p-- = '\0'; + } } if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1;