@onereach/step-voice 7.0.9-VOIC1575.16 → 7.0.9-VOIC1575.17

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.
@@ -19,6 +19,10 @@ interface INPUT {
19
19
  enableSpoofCallerId?: boolean;
20
20
  spoofCallerId?: string;
21
21
  isAMD?: boolean;
22
+ enableWhisperTransfer?: boolean;
23
+ whisperAnnounceAudio?: TODO[];
24
+ textType?: string;
25
+ whisperCustomerConversation?: string;
22
26
  }
23
27
  export default class InitiateCall extends VoiceStep<INPUT, TODO, CallStartEvent> {
24
28
  get conversation(): string | import("@onereach/flow-sdk/types").IMergeField;
@@ -47,7 +47,7 @@ class InitiateCall extends voice_1.default {
47
47
  this.exitStep('cancel');
48
48
  }
49
49
  async waitForCall() {
50
- const { asr, tts, from: botNumber, endUserNumber, sipHost, sipUser, sipPassword, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel } = this.data;
50
+ const { asr, tts, from: botNumber, endUserNumber, sipHost, sipUser, sipPassword, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel, enableWhisperTransfer, whisperAnnounceAudio, textType, whisperCustomerConversation, } = this.data;
51
51
  const call = await this.fetchData();
52
52
  const callALegId = headers?.find(h => h.name === 'X-Leg-A')?.value;
53
53
  this.triggers.once(`in/voice/${call.id}/event`, async (event) => {
@@ -85,7 +85,7 @@ class InitiateCall extends voice_1.default {
85
85
  reportingSettingsKey: 'transcript',
86
86
  actionFromBot: true
87
87
  });
88
- await this.sendCommands(newCall, [
88
+ const commands = [
89
89
  ...isAMD
90
90
  ? [{
91
91
  name: 'start-avmd',
@@ -108,41 +108,45 @@ class InitiateCall extends voice_1.default {
108
108
  id: callALegId
109
109
  }
110
110
  }, */
111
- /* {
112
- name: 'playback',
113
- params: {
114
- 'sections': [
115
- {
116
- 'text': '<speak>This is a live transfer from the automated system. Stand by for connection.</speak>',
117
- 'url': '',
118
- 'bargeInVoice': false,
119
- 'bargeInKeypad': false,
120
- 'textType': 'ssml',
121
- 'provider': 'polly',
122
- 'voiceId': 'Joanna',
123
- 'engine': 'standard',
124
- 'isStream': false,
125
- },
126
- ],
127
- 'useWhisperFeature': false,
128
- 'sensitiveData': {},
129
- resumeAfterGc: true,
130
- }
131
- }, */
132
111
  /* {
133
112
  name: 'whisper.hold_off',
134
113
  params: {
135
114
  id: callALegId
136
115
  }
137
116
  }, */
138
- {
117
+ ];
118
+ if (enableWhisperTransfer === true) {
119
+ const ttsSettings = tts.getSettings(call.tts);
120
+ const announceSpeechSections = whisperAnnounceAudio?.map(section => ({
121
+ text: section.voiceTextMsg,
122
+ url: section.audioUrl,
123
+ bargeInVoice: false,
124
+ bargeInKeypad: false,
125
+ textType,
126
+ provider: ttsSettings.provider,
127
+ ...ttsSettings
128
+ }));
129
+ const announceMessageCommand = {
130
+ name: 'speak',
131
+ params: {
132
+ sections: announceSpeechSections,
133
+ reporterTranscriptEventId: '',
134
+ }
135
+ };
136
+ const transferCommand = {
139
137
  name: 'whisper.transfer',
140
138
  params: {
141
- id: callALegId
139
+ id: callALegId,
140
+ whisperCustomerConversation
142
141
  }
143
- },
144
- { name: 'hangup' }
145
- ]);
142
+ };
143
+ commands.push(...[
144
+ announceMessageCommand,
145
+ transferCommand,
146
+ { name: 'hangup' }
147
+ ]);
148
+ }
149
+ await this.sendCommands(newCall, commands);
146
150
  return this.exitStep('success');
147
151
  }
148
152
  case 'hangup': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.9-VOIC1575.16",
3
+ "version": "7.0.9-VOIC1575.17",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",