@onereach/step-voice 6.1.6 → 6.1.7-customvoiceimp.0

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.
@@ -15,6 +15,8 @@ interface INPUT {
15
15
  phraseList: Array<{
16
16
  phrase: string;
17
17
  }>;
18
+ useRepetitionHandler: boolean;
19
+ repetitionNumber: number;
18
20
  }
19
21
  interface EVENT extends VoiceEvent {
20
22
  callRecording?: TODO;
@@ -104,19 +104,7 @@ class CustomVoiceInput extends voice_1.default {
104
104
  .join(' | ')
105
105
  .value();
106
106
  // On bargeIn, we should stop playback
107
- if (exitExists(exitId)) {
108
- await this.transcript(call, {
109
- message: lodash_1.default.replace(this.getExitStepLabel(exitId) ?? '', /^(\d+\. )?(~ )?/, ''),
110
- voiceProcessResult,
111
- reportingSettingsKey,
112
- action: 'Call Recognition',
113
- actionFromBot: false
114
- });
115
- await this.resumeRecording(call, sensitiveData);
116
- // There might be hooks after this step which we will try to avoid
117
- return this.exitStep(exitId, this.exitChoiceData('voice', params));
118
- }
119
- else if (this.rptsHasMore({ repromptsList }) &&
107
+ if (this.rptsHasMore({ repromptsList }) &&
120
108
  (usePromptsTriggers ? isRepromptTrigger(phrases, this.data.promptsTriggers) : true)) {
121
109
  await this.transcript(call, {
122
110
  message: 'Unrecognized',
@@ -136,6 +124,18 @@ class CustomVoiceInput extends voice_1.default {
136
124
  });
137
125
  return this.exitFlow();
138
126
  }
127
+ else if (exitExists(exitId)) {
128
+ await this.transcript(call, {
129
+ message: lodash_1.default.replace(this.getExitStepLabel(exitId) ?? '', /^(\d+\. )?(~ )?/, ''),
130
+ voiceProcessResult,
131
+ reportingSettingsKey,
132
+ action: 'Call Recognition',
133
+ actionFromBot: false
134
+ });
135
+ await this.resumeRecording(call, sensitiveData);
136
+ // There might be hooks after this step which we will try to avoid
137
+ return this.exitStep(exitId, this.exitChoiceData('voice', params));
138
+ }
139
139
  // There's no more reprompts, should move on to unrecognized direction
140
140
  await this.transcript(call, {
141
141
  message: 'Not Recognized',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "6.1.6",
3
+ "version": "6.1.7-customvoiceimp.0",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",