]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Send silent packets when idle with SRTP
authorTravis Cross <tc@traviscross.com>
Fri, 28 Feb 2014 23:12:29 +0000 (23:12 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 28 Feb 2014 23:14:42 +0000 (23:14 +0000)
Originally we did the same thing with SRTP that we do without SRTP,
which is to simply not send packets when e.g. sleep is called.

At commits d63323977fa611b141441f12af9a94ec19b5f829 and
5259814aee16ede974456490a79e8a98de1d6d2e we enabled sending silence
packets with comfort noise when SRTP is active.  We appear to have
done this for interop purposes; many devices can't handle gaps in the
stream of SRTP packets.

But our current comfort noise implementation doesn't take the codec
rate into account (FS-6291), so on 16kHz codecs the constant we chose
created an annoying level of static between sound file playback.

With this commit we preserve the sending of SRTP packets during idle
periods, but make those packets completely silent.

Thanks-to: Anthony Minessale <anthm@freeswitch.org>
FS-5053 --resolve

src/switch_rtp.c

index 0c0963155eb26286fcaeb469a718aabcdbc55b30..abbfd72324e27bb97af91f992c99575512e225a3 100644 (file)
@@ -1794,7 +1794,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
 
        memset(policy, 0, sizeof(*policy));
 
-       switch_channel_set_variable(channel, "send_silence_when_idle", "400");
+       switch_channel_set_variable(channel, "send_silence_when_idle", "-1");
 
        switch (crypto_key->type) {
        case AES_CM_128_HMAC_SHA1_80: