update media session to callee (#78)

This commit is contained in:
Hoan Luu Huu
2023-04-13 18:43:29 +07:00
committed by GitHub
parent 5174e140a2
commit e00379d119
+6 -1
View File
@@ -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');