when handling reinvites for SIPREC incoming calls just respond 200 OK with existing sdp

This commit is contained in:
Dave Horton
2023-02-17 09:12:54 -05:00
parent 9b21b65478
commit ae688ddc7e

View File

@@ -1450,9 +1450,15 @@ class CallSession extends Emitter {
async _onReinvite(req, res) {
try {
if (this.ep) {
const newSdp = await this.ep.modify(req.body);
res.send(200, {body: newSdp});
this.logger.info({offer: req.body, answer: newSdp}, 'handling reINVITE');
if (this.isSipRecCallSession) {
this.logger.info('handling reINVITE for siprec call');
res.send(200, {body: this.ep.local.sdp});
}
else {
const newSdp = await this.ep.modify(req.body);
res.send(200, {body: newSdp});
this.logger.info({offer: req.body, answer: newSdp}, 'handling reINVITE');
}
}
else if (this.currentTask && this.currentTask.name === TaskName.Dial) {
this.logger.info('handling reINVITE after media has been released');