]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Add force_send_silence_when_idle channel variable
authorTravis Cross <tc@traviscross.com>
Mon, 3 Mar 2014 18:33:25 +0000 (18:33 +0000)
committerTravis Cross <tc@traviscross.com>
Tue, 4 Mar 2014 02:07:30 +0000 (02:07 +0000)
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.

src/switch_rtp.c

index fc4b6a601931e8abc3a409f9ef81fb8f17538d13..7cbfb7089e3384a9de5660c10c0c2cc83a621ee0 100644 (file)
@@ -1796,8 +1796,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");
        }