mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
add more logs
This commit is contained in:
@@ -68,14 +68,17 @@ class Cognigy extends Task {
|
|||||||
rejector = reject;
|
rejector = reject;
|
||||||
});
|
});
|
||||||
this.taskQueue.push(async(cb) => {
|
this.taskQueue.push(async(cb) => {
|
||||||
|
this.logger.info("EXECUTING SAY TASK");
|
||||||
try {
|
try {
|
||||||
const result = await task.bind(this)();
|
const result = await task();
|
||||||
resolver(result);
|
resolver(result);
|
||||||
cb(result);
|
cb(result);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
this.logger.error({err}, "could not execute task in task queue");
|
||||||
rejector(err);
|
rejector(err);
|
||||||
cb(err);
|
cb(err);
|
||||||
}
|
}
|
||||||
|
this.logger.info("SAY TASK EXECUTED");
|
||||||
});
|
});
|
||||||
this.taskQueue.lastPromise = taskPromise;
|
this.taskQueue.lastPromise = taskPromise;
|
||||||
return taskPromise;
|
return taskPromise;
|
||||||
@@ -253,9 +256,10 @@ class Cognigy extends Task {
|
|||||||
const text = parseBotText(evt);
|
const text = parseBotText(evt);
|
||||||
if (evt.data) this.config.update(evt.data);
|
if (evt.data) this.config.update(evt.data);
|
||||||
if (text) {
|
if (text) {
|
||||||
await this._enqueueTask(async() => {
|
this.logger.info({text}, "received text");
|
||||||
|
await this._enqueueTask((async() => {
|
||||||
await this._makeSayTask(text);
|
await this._makeSayTask(text);
|
||||||
});
|
}).bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -263,13 +267,13 @@ class Cognigy extends Task {
|
|||||||
try {
|
try {
|
||||||
switch (evt.data.type) {
|
switch (evt.data.type) {
|
||||||
case 'hangup':
|
case 'hangup':
|
||||||
await this._enqueueTask(async() => {
|
await this._enqueueTask((async() => {
|
||||||
await this._makeHangupTask(evt.data.reason);
|
await this._makeHangupTask(evt.data.reason);
|
||||||
this.performAction({cognigyResult: 'hangup Succeeded'});
|
this.performAction({cognigyResult: 'hangup Succeeded'});
|
||||||
this.reportedFinalAction = true;
|
this.reportedFinalAction = true;
|
||||||
this.notifyTaskDone();
|
this.notifyTaskDone();
|
||||||
this.kill(cs);
|
this.kill(cs);
|
||||||
});
|
}).bind(this));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
case 'refer':
|
case 'refer':
|
||||||
|
|||||||
Reference in New Issue
Block a user