diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 1c6ac981..75e397a8 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -364,13 +364,13 @@ class CallSession extends Emitter { async _lccCallHook(opts) { const webhooks = []; let sd; - if (opts.call_hook) webhooks.push(this.requestor.request(opts.call_hook, this.callInfo)); + if (opts.call_hook) webhooks.push(this.requestor.request(opts.call_hook, this.callInfo.toJSON())); if (opts.child_call_hook) { /* child call hook only allowed from a connected Dial state */ const task = this.currentTask; sd = task.sd; if (task && TaskName.Dial === task.name && sd) { - webhooks.push(this.requestor.request(opts.child_call_hook, sd.callInfo)); + webhooks.push(this.requestor.request(opts.child_call_hook, sd.callInfo.toJSON())); } } const [tasks1, tasks2] = await Promise.all(webhooks); @@ -450,7 +450,7 @@ class CallSession extends Emitter { // allow user to provide a url object, a url string, an array of tasks, or a single task if (typeof whisper === 'string' || (typeof whisper === 'object' && whisper.url)) { // retrieve a url - const json = await this.requestor(opts.call_hook, this.callInfo); + const json = await this.requestor(opts.call_hook, this.callInfo.toJSON()); tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata)); } else if (Array.isArray(whisper)) { @@ -916,7 +916,7 @@ class CallSession extends Emitter { // update calls db //this.logger.debug(`updating redis with ${JSON.stringify(this.callInfo)}`); - this.updateCallStatus(Object.assign({}, this.callInfo), this.serviceUrl) + this.updateCallStatus(Object.assign({}, this.callInfo.toJSON()), this.serviceUrl) .catch((err) => this.logger.error(err, 'redis error')); } } diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index f3a1504f..5d8eff14 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -242,7 +242,7 @@ class TaskDial extends Task { this.logger.info(`Dial:_onDtmf got digits on B leg after adulting: ${evt.dtmf}`); } else { - requestor.request(this.dtmfHook, {dtmf: match, ...cs.callInfo}) + requestor.request(this.dtmfHook, {dtmf: match, ...cs.callInfo.toJSON()}) .catch((err) => this.logger.info(err, 'Dial:_onDtmf - error')); } } diff --git a/lib/utils/place-outdial.js b/lib/utils/place-outdial.js index 7e6017e0..fd8f8e9f 100644 --- a/lib/utils/place-outdial.js +++ b/lib/utils/place-outdial.js @@ -255,7 +255,7 @@ class SingleDialer extends Emitter { async _executeApp(confirmHook) { try { // retrieve set of tasks - const tasks = await this.requestor.request(confirmHook, this.callInfo); + const tasks = await this.requestor.request(confirmHook, this.callInfo.toJSON()); // verify it contains only allowed verbs const allowedTasks = tasks.filter((task) => {