generate trace id before outdial so we can include it in custom header (#418)

* generate trace id before outdial so we can include it in custom header

* logging

* logging

* fix #420 race condition on rest outdial when ws is used

* revert unnecessary logging change
This commit is contained in:
Dave Horton
2023-08-08 13:00:34 -04:00
committed by GitHub
parent 82939214a2
commit ad722a55ee
4 changed files with 50 additions and 14 deletions

View File

@@ -63,6 +63,7 @@ class TaskRestDial extends Task {
this.canCancel = false;
const cs = this.callSession;
cs.setDialog(dlg);
this.logger.debug('TaskRestDial:_onConnect - call connected');
try {
const b3 = this.getTracingPropagation();
@@ -90,8 +91,10 @@ class TaskRestDial extends Task {
}
let tasks;
if (this.app_json) {
this.logger.debug('TaskRestDial: using app_json from task data');
tasks = JSON.parse(this.app_json);
} else {
this.logger.debug({call_hook: this.call_hook}, 'TaskRestDial: retrieving application');
tasks = await cs.requestor.request('session:new', this.call_hook, params, httpHeaders);
}
if (tasks && Array.isArray(tasks)) {