From 6cf59732fb7492a3539cbb996aedb780b04566ed Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 30 Aug 2023 22:09:28 -0400 Subject: [PATCH] add env var PAD_CRYPTO to pad crypto params (#102) --- lib/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils.js b/lib/utils.js index 8c3c879..44b2d24 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -6,6 +6,8 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, teams = false) { const from = req.getParsedHeader('from'); const rtpCopy = JSON.parse(JSON.stringify(rtpCharacteristics)); const srtpCopy = JSON.parse(JSON.stringify(srtpCharacteristics)); + if (process.env.PAD_CRYPTO) srtpCopy['default'].flags.push('SDES-pad'); + const srtpOpts = teams ? srtpCopy['teams'] : srtpCopy['default']; const dstOpts = dstIsUsingSrtp ? srtpOpts : rtpCopy; const srcOpts = srcIsUsingSrtp ? srtpOpts : rtpCopy;