diff --git a/lib/call-session.js b/lib/call-session.js index 37af179..5dc1a16 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -107,6 +107,11 @@ class CallSession extends Emitter { return this._mediaReleased; } + get calleeIsUsingSrtp() { + const tp = this.rtpEngineOpts?.uac?.mediaOpts['transport-protocol']; + return tp && -1 !== tp.indexOf('SAVP'); + } + subscribeForDTMF(dlg) { if (!this._subscribedForDTMF) { this._subscribedForDTMF = true; @@ -627,7 +632,7 @@ Duration=${payload.duration} ` /* if this is a re-invite from the FS to change media anchoring, avoid sending the reinvite out */ let sdp; - if (isReleasingMedia) { + if (isReleasingMedia && !this.calleeIsUsingSrtp) { this.logger.info(`got a reinvite from FS to ${reason}`); sdp = dlg.other.remote.sdp; if (!answerMedia.flags.includes('port latching')) answerMedia.flags.push('port latching');