提交 5a7ea956 authored 作者: Travis Cross's avatar Travis Cross

Add force_send_silence_when_idle channel variable

If set to true, this prevents us from overriding the value of
send_silence_when_idle.  When that is unset or set to zero and SRTP is
engaged, we typically override the value because many devices can't
handle gaps in the SRTP stream.

This variable is mostly for testing whether particular devices can
handle this behavior.  Use at your own risk.
上级 e650939b
......@@ -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");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论