diff --git a/lib/utils/place-outdial.js b/lib/utils/place-outdial.js index 6cbf7798..59414320 100644 --- a/lib/utils/place-outdial.js +++ b/lib/utils/place-outdial.js @@ -279,7 +279,12 @@ class SingleDialer extends Emitter { this.logger.info('dial is onhold, emit event'); this.emit('reinvite', req, res); } else { - const newSdp = await this.ep.modify(req.body); + let newSdp = await this.ep.modify(req.body); + // in case of reINVITE if video call is enabled in FS and the call is not a video call, + // remove video media from the SDP + if (process.env.JAMBONES_VIDEO_CALLS_ENABLED_IN_FS && !this.opts?.isVideoCall) { + newSdp = removeVideoSdp(newSdp); + } res.send(200, {body: newSdp}); this.logger.info({offer: req.body, answer: newSdp}, 'SingleDialer:exec: handling reINVITE'); } @@ -565,7 +570,8 @@ function placeOutdial({ }) { const myOpts = deepcopy(opts); const sd = new SingleDialer({ - logger, sbcAddress, target, myOpts, application, callInfo, accountInfo, rootSpan, startSpan, dialTask, onHoldMusic + logger, sbcAddress, target, opts: myOpts, application, callInfo, + accountInfo, rootSpan, startSpan, dialTask, onHoldMusic }); sd.exec(srf, ms, myOpts); return sd;