]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11642: [core] add audio and video versions of the variables set for the rtp_retain...
authorMike Jerris <mike@signalwire.com>
Sat, 2 Feb 2019 02:24:38 +0000 (21:24 -0500)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 19:32:55 +0000 (23:32 +0400)
src/switch_rtp.c

index 392c5c49bf576f632a85b3cb5070a4d318472499..02ee86c82f3d455e6e2e3482573f0c3cd79ca485 100644 (file)
@@ -3959,6 +3959,43 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
                        default:
                                break;
                }
+
+               if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
+                       switch(direction) {
+                       case SWITCH_RTP_CRYPTO_SEND:
+                               switch_channel_set_variable(channel, "srtp_local_video_crypto_key", (const char *)b64_key);
+                               break;
+                       case SWITCH_RTP_CRYPTO_RECV:
+                               switch_channel_set_variable(channel, "srtp_remote_video_crypto_key", (const char *)b64_key);
+                               break;
+                       case SWITCH_RTP_CRYPTO_SEND_RTCP:
+                               switch_channel_set_variable(channel, "srtcp_local_video_crypto_key", (const char *)b64_key);
+                               break;
+                       case SWITCH_RTP_CRYPTO_RECV_RTCP:
+                               switch_channel_set_variable(channel, "srtcp_remote_video_crypto_key", (const char *)b64_key);
+                               break;
+                       default:
+                               break;
+                       }
+
+               } else {
+                       switch(direction) {
+                       case SWITCH_RTP_CRYPTO_SEND:
+                               switch_channel_set_variable(channel, "srtp_local_audio_crypto_key", (const char *)b64_key);
+                               break;
+                       case SWITCH_RTP_CRYPTO_RECV:
+                               switch_channel_set_variable(channel, "srtp_remote_audio_crypto_key", (const char *)b64_key);
+                               break;
+                       case SWITCH_RTP_CRYPTO_SEND_RTCP:
+                               switch_channel_set_variable(channel, "srtcp_local_audio_crypto_key", (const char *)b64_key);
+                               break;
+                       case SWITCH_RTP_CRYPTO_RECV_RTCP:
+                               switch_channel_set_variable(channel, "srtcp_remote_audio_crypto_key", (const char *)b64_key);
+                               break;
+                       default:
+                               break;
+                       }
+               }
        }
 
        crypto_key = switch_core_alloc(rtp_session->pool, sizeof(*crypto_key));