add test log

This commit is contained in:
akirilyuk
2022-02-01 12:01:53 +01:00
parent 2ce902c00d
commit b8ef1dba73

View File

@@ -104,7 +104,7 @@ class Cognigy extends Task {
this.client.on('error', this._onBotError.bind(this, cs, ep));
this.client.on('finalPing', this._onBotFinalPing.bind(this, cs, ep));
await this.client.connect();
this.client.sendMessage('', {...this.data, ...cs.callInfo});
this.client.sendMessage('welcome message', {...this.data, ...cs.callInfo});
await this.awaitTaskDone();
} catch (err) {
@@ -165,6 +165,7 @@ class Cognigy extends Task {
}
async _onBotFinalPing(cs, ep) {
this.logger.info({}, "TEST FROM ALEX")
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
if (this.prompts.length) {
const text = this.prompts.join('.');
@@ -225,6 +226,7 @@ class Cognigy extends Task {
this.client.sendMessage(utterance);
}
else {
// if the bot is not connected, should we maybe throw an error here?
this.logger.info('Cognigy_onTranscription - not sending user utterance as bot is disconnected');
}
} catch (err) {
@@ -244,6 +246,7 @@ class Cognigy extends Task {
this.client.sendMessage(evt.digits);
}
else {
// if the bot is not connected, should we maybe throw an error here?
this.logger.info('Cognigy_onTranscription - not sending user dtmf as bot is disconnected');
}
} catch (err) {