diff --git a/src/switch_rtp.c b/src/switch_rtp.c index b84795b91b..b8da56b984 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3042,8 +3042,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess memset(policy, 0, sizeof(*policy)); /* many devices can't handle gaps in SRTP streams */ - if (!(var = switch_channel_get_variable(channel, "send_silence_when_idle")) - || !(atoi(var))) { + if (!((var = switch_channel_get_variable(channel, "force_send_silence_when_idle")) + && switch_true(var)) + && (!(var = switch_channel_get_variable(channel, "send_silence_when_idle")) + || !(atoi(var)))) { switch_channel_set_variable(channel, "send_silence_when_idle", "-1"); }