From f9ae4667092624b6062f68ba2a5d3519608903db Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 22 May 2024 12:42:06 -0400 Subject: [PATCH] #142 add option to transcode incoming g729 calls to pcmu (#144) --- lib/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 17886eb..a82a200 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -22,7 +22,7 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, teams = false) { const dstOpts = dstIsUsingSrtp ? srtpOpts : rtpCopy; const srcOpts = srcIsUsingSrtp ? srtpOpts : rtpCopy; - /* Allow Feature server to inject DTMF to both leg except call from Teams*/ + /* Allow Feature server to inject DTMF to both leg except call from Teams */ if (!teams) { dstOpts.flags.push('inject DTMF'); srcOpts.flags.push('inject DTMF'); @@ -30,7 +30,8 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, teams = false) { const common = { 'call-id': req.get('Call-ID'), 'replace': ['origin', 'session-connection'], - 'record call': process.env.JAMBONES_RECORD_ALL_CALLS ? 'yes' : 'no' + 'record call': process.env.JAMBONES_RECORD_ALL_CALLS ? 'yes' : 'no', + ...(process.env.JAMBONES_ACCEPT_G729 && { codec: { mask: 'g729', transcode: 'pcmu'}}) }; return { common,