From 3cdf568fb637e5df7ade3ada513381a57a5b8d36 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 31 Oct 2023 20:55:39 -0400 Subject: [PATCH] fix logging on child leg after REFER received on A leg (#512) --- lib/tasks/dial.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index 14d33b96..1a04dc7d 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -336,18 +336,14 @@ class TaskDial extends Task { }, httpHeaders); if (json && Array.isArray(json)) { try { - let logger = this.logger; - if (isChild) { - const {parentLogger} = this.srf.locals; - logger = parentLogger.child({callId: cs.callId, callSid: this.sd.callSid}); - } + const logger = isChild ? this.logger : this.sd.logger; const tasks = normalizeJambones(logger, json).map((tdata) => makeTask(this.logger, tdata)); if (tasks && tasks.length > 0) { const legs = isChild ? ['child', 'parent'] : ['parent', 'child']; - this.logger.info(`Dial:handleRefer received REFER on ${legs[0]} leg, setting new app on ${legs[1]} leg`); + logger.info(`Dial:handleRefer received REFER on ${legs[0]} leg, setting new app on ${legs[1]} leg`); if (isChild) this.redirect(cs, tasks); else { - this.logger.info({tasks: json}, 'Dial:handleRefer - new application for for child leg'); + logger.info({tasks: json}, 'Dial:handleRefer - new application for for child leg'); const adultingSession = await this.sd.doAdulting({ logger, application: cs.application,