fix ConfirmCallSession in placeCall does not have access to tmpFiles for removing tmp file later (#1356)

This commit is contained in:
Hoan Luu Huu
2025-09-11 06:39:43 +07:00
committed by GitHub
parent 859132bb1c
commit f950d19d1c
2 changed files with 6 additions and 4 deletions

View File

@@ -676,7 +676,8 @@ class TaskDial extends Task {
rootSpan: cs.rootSpan, rootSpan: cs.rootSpan,
startSpan: this.startSpan.bind(this), startSpan: this.startSpan.bind(this),
dialTask: this, dialTask: this,
onHoldMusic: this.cs.onHoldMusic onHoldMusic: this.cs.onHoldMusic,
tmpFiles: this.cs.tmpFiles,
}); });
this.dials.set(sd.callSid, sd); this.dials.set(sd.callSid, sd);

View File

@@ -20,7 +20,7 @@ const { createMediaEndpoint } = require('./media-endpoint');
class SingleDialer extends Emitter { class SingleDialer extends Emitter {
constructor({logger, sbcAddress, target, opts, application, callInfo, accountInfo, rootSpan, startSpan, dialTask, constructor({logger, sbcAddress, target, opts, application, callInfo, accountInfo, rootSpan, startSpan, dialTask,
onHoldMusic}) { onHoldMusic, tmpFiles}) {
super(); super();
assert(target.type); assert(target.type);
@@ -44,6 +44,7 @@ class SingleDialer extends Emitter {
this.callSid = crypto.randomUUID(); this.callSid = crypto.randomUUID();
this.dialTask = dialTask; this.dialTask = dialTask;
this.onHoldMusic = onHoldMusic; this.onHoldMusic = onHoldMusic;
this.tmpFiles = tmpFiles;
this.on('callStatusChange', this._notifyCallStatusChange.bind(this)); this.on('callStatusChange', this._notifyCallStatusChange.bind(this));
} }
@@ -536,12 +537,12 @@ class SingleDialer extends Emitter {
function placeOutdial({ function placeOutdial({
logger, srf, ms, sbcAddress, target, opts, application, callInfo, accountInfo, rootSpan, startSpan, dialTask, logger, srf, ms, sbcAddress, target, opts, application, callInfo, accountInfo, rootSpan, startSpan, dialTask,
onHoldMusic onHoldMusic, tmpFiles
}) { }) {
const myOpts = deepcopy(opts); const myOpts = deepcopy(opts);
const sd = new SingleDialer({ const sd = new SingleDialer({
logger, sbcAddress, target, opts: myOpts, application, callInfo, logger, sbcAddress, target, opts: myOpts, application, callInfo,
accountInfo, rootSpan, startSpan, dialTask, onHoldMusic accountInfo, rootSpan, startSpan, dialTask, onHoldMusic, tmpFiles
}); });
sd.exec(srf, ms, myOpts); sd.exec(srf, ms, myOpts);
return sd; return sd;