fix ConfirmCallSession cannot be played (#993)

* fix ConfirmCallSession cannot be played

* fix review comments

* fix review comments
This commit is contained in:
Hoan Luu Huu
2024-12-11 07:36:42 +07:00
committed by GitHub
parent 3bb4f1a29f
commit a929a649f9
6 changed files with 12 additions and 7 deletions

View File

@@ -1043,8 +1043,8 @@ class CallSession extends Emitter {
this.logger.info({tasks: listTaskNames(this.tasks)}, `CallSession:exec starting ${this.tasks.length} tasks`); this.logger.info({tasks: listTaskNames(this.tasks)}, `CallSession:exec starting ${this.tasks.length} tasks`);
// calculate if inbandDTMF tone is used // calculate if inbandDTMF tone is used
const voip_carrier_sid = this.req.has('X-Voip-Carrier-Sid') ? this.req.get('X-Voip-Carrier-Sid') : const voip_carrier_sid = this.req?.has('X-Voip-Carrier-Sid') ? this.req.get('X-Voip-Carrier-Sid') :
this.req.has('X-Requested-Carrier-Sid') ? this.req.get('X-Requested-Carrier-Sid') : null; this.req?.has('X-Requested-Carrier-Sid') ? this.req.get('X-Requested-Carrier-Sid') : null;
if (voip_carrier_sid) { if (voip_carrier_sid) {
const {lookupVoipCarrierBySid} = dbUtils(this.logger, this.srf); const {lookupVoipCarrierBySid} = dbUtils(this.logger, this.srf);

View File

@@ -8,7 +8,7 @@ const CallSession = require('./call-session');
*/ */
class ConfirmCallSession extends CallSession { class ConfirmCallSession extends CallSession {
constructor({logger, application, dlg, ep, tasks, callInfo, accountInfo, memberId, confName, rootSpan}) { constructor({logger, application, dlg, ep, tasks, callInfo, accountInfo, memberId, confName, rootSpan, req}) {
super({ super({
logger, logger,
application, application,
@@ -23,6 +23,7 @@ class ConfirmCallSession extends CallSession {
}); });
this.dlg = dlg; this.dlg = dlg;
this.ep = ep; this.ep = ep;
this.req = req;
} }
/** /**

View File

@@ -653,7 +653,8 @@ class Conference extends Task {
memberId: this.memberId, memberId: this.memberId,
confName: this.confName, confName: this.confName,
tasks, tasks,
rootSpan: cs.rootSpan rootSpan: cs.rootSpan,
req: cs.req
}); });
await this._playSession.exec(); await this._playSession.exec();
this._playSession = null; this._playSession = null;

View File

@@ -1048,7 +1048,8 @@ class TaskDial extends Task {
callInfo: this.cs.callInfo, callInfo: this.cs.callInfo,
accountInfo: this.cs.accountInfo, accountInfo: this.cs.accountInfo,
tasks, tasks,
rootSpan: this.cs.rootSpan rootSpan: this.cs.rootSpan,
req: this.cs.req
}); });
await this._onHoldSession.exec(); await this._onHoldSession.exec();
this._onHoldSession = null; this._onHoldSession = null;

View File

@@ -369,7 +369,8 @@ class TaskEnqueue extends Task {
callInfo: cs.callInfo, callInfo: cs.callInfo,
accountInfo: cs.accountInfo, accountInfo: cs.accountInfo,
tasks: tasksToRun, tasks: tasksToRun,
rootSpan: cs.rootSpan rootSpan: cs.rootSpan,
req: cs.req
}); });
await this._playSession.exec(); await this._playSession.exec();
this._playSession = null; this._playSession = null;

View File

@@ -381,7 +381,8 @@ class SingleDialer extends Emitter {
callInfo: this.callInfo, callInfo: this.callInfo,
accountInfo: this.accountInfo, accountInfo: this.accountInfo,
tasks, tasks,
rootSpan: this.rootSpan rootSpan: this.rootSpan,
req: this.req
}); });
await cs.exec(); await cs.exec();