@onereach/step-voice 6.0.13 → 6.0.14-fixpassivegc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dst/Custom Voice Input.d.ts +1 -1
- package/dst/Custom Voice Input.js +3 -1
- package/dst/Global Command.js +5 -3
- package/dst/Send DTMF.js +4 -1
- package/dst/voice.js +3 -2
- package/package.json +1 -1
|
@@ -41,7 +41,9 @@ const isRepromptTrigger = (recogResult, promptsTriggers) => {
|
|
|
41
41
|
return !lodash_1.default.isEmpty(phrases.filter((e) => triggers.includes(e)));
|
|
42
42
|
};
|
|
43
43
|
const alterRecognitionPhrases = (phrases, interpretation) => {
|
|
44
|
-
|
|
44
|
+
if (interpretation.length !== 1)
|
|
45
|
+
return;
|
|
46
|
+
switch (interpretation[0]) {
|
|
45
47
|
case '$POSTALCODE':
|
|
46
48
|
phrases.forEach(p => { p.lexical = p.lexical.replace(/\s+/g, ''); });
|
|
47
49
|
break;
|
package/dst/Global Command.js
CHANGED
|
@@ -67,8 +67,10 @@ class GlobalCommand extends voice_1.default {
|
|
|
67
67
|
this.triggers.otherwise(async () => {
|
|
68
68
|
await this.initGrammar();
|
|
69
69
|
});
|
|
70
|
+
// todo hook once
|
|
70
71
|
this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: types_1.MAIN_THREAD_ID, sync: true }, async () => {
|
|
71
72
|
delete this.waits['@waitEnd']; // TODO is there beter way to unsubscribe?
|
|
73
|
+
delete this.waits.waitEnd; // TODO is there beter way to unsubscribe?
|
|
72
74
|
if (!call.ended) {
|
|
73
75
|
this.state.passive = true;
|
|
74
76
|
await this.sendCommands(call, [{ name: 'grammar', params: {} }]);
|
|
@@ -100,7 +102,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
100
102
|
else {
|
|
101
103
|
this.log.debug('exitId missmatch', { exitId, exits: this.step.exits });
|
|
102
104
|
}
|
|
103
|
-
|
|
105
|
+
break;
|
|
104
106
|
}
|
|
105
107
|
case 'recognition': {
|
|
106
108
|
const params = event.params;
|
|
@@ -123,7 +125,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
123
125
|
else {
|
|
124
126
|
this.log.debug('exitId missmatch', { exitId, exits: this.step.exits });
|
|
125
127
|
}
|
|
126
|
-
|
|
128
|
+
break;
|
|
127
129
|
}
|
|
128
130
|
case 'error': {
|
|
129
131
|
if (event.params.error) {
|
|
@@ -141,7 +143,7 @@ class GlobalCommand extends voice_1.default {
|
|
|
141
143
|
break;
|
|
142
144
|
}
|
|
143
145
|
default:
|
|
144
|
-
|
|
146
|
+
break;
|
|
145
147
|
}
|
|
146
148
|
});
|
|
147
149
|
}
|
package/dst/Send DTMF.js
CHANGED
|
@@ -54,11 +54,14 @@ class SendDTMF extends voice_1.default {
|
|
|
54
54
|
// );
|
|
55
55
|
switch (event.params.type) {
|
|
56
56
|
case 'hangup':
|
|
57
|
-
|
|
57
|
+
await this.handleHangup(call);
|
|
58
|
+
return await this.waitConvEnd();
|
|
58
59
|
case 'dtmf-sent':
|
|
59
60
|
return this.exitStep('next');
|
|
60
61
|
case 'error':
|
|
61
62
|
return this.throwError(event.params.error);
|
|
63
|
+
case 'cancel':
|
|
64
|
+
return this.handleCancel();
|
|
62
65
|
default:
|
|
63
66
|
return this.exitFlow();
|
|
64
67
|
}
|
package/dst/voice.js
CHANGED
|
@@ -222,10 +222,11 @@ class VoiceStep extends step_1.default {
|
|
|
222
222
|
async handleHangup(call) {
|
|
223
223
|
if (call.ended)
|
|
224
224
|
return;
|
|
225
|
+
const isHangedUpByBot = call.sessionEndedBy === 'Bot';
|
|
225
226
|
await this.transcript(call, {
|
|
226
227
|
action: 'Call End',
|
|
227
|
-
reportingSettingsKey: '
|
|
228
|
-
actionFromBot:
|
|
228
|
+
reportingSettingsKey: 'transcriptHangup',
|
|
229
|
+
actionFromBot: isHangedUpByBot
|
|
229
230
|
});
|
|
230
231
|
call.ended = true;
|
|
231
232
|
await this.updateData();
|