mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 00:58:34 +00:00
fix logging on child leg after REFER received on A leg (#512)
This commit is contained in:
@@ -336,18 +336,14 @@ class TaskDial extends Task {
|
|||||||
}, httpHeaders);
|
}, httpHeaders);
|
||||||
if (json && Array.isArray(json)) {
|
if (json && Array.isArray(json)) {
|
||||||
try {
|
try {
|
||||||
let logger = this.logger;
|
const logger = isChild ? this.logger : this.sd.logger;
|
||||||
if (isChild) {
|
|
||||||
const {parentLogger} = this.srf.locals;
|
|
||||||
logger = parentLogger.child({callId: cs.callId, callSid: this.sd.callSid});
|
|
||||||
}
|
|
||||||
const tasks = normalizeJambones(logger, json).map((tdata) => makeTask(this.logger, tdata));
|
const tasks = normalizeJambones(logger, json).map((tdata) => makeTask(this.logger, tdata));
|
||||||
if (tasks && tasks.length > 0) {
|
if (tasks && tasks.length > 0) {
|
||||||
const legs = isChild ? ['child', 'parent'] : ['parent', 'child'];
|
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);
|
if (isChild) this.redirect(cs, tasks);
|
||||||
else {
|
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({
|
const adultingSession = await this.sd.doAdulting({
|
||||||
logger,
|
logger,
|
||||||
application: cs.application,
|
application: cs.application,
|
||||||
|
|||||||
Reference in New Issue
Block a user