@onereach/step-voice 7.0.43 → 7.0.44-VOIC1805.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.
@@ -36,6 +36,8 @@ interface INPUT {
36
36
  whisperAnnounceAudio?: TODO[];
37
37
  whisperCustomerConversation?: string;
38
38
  whisperCustomerConversationThread?: string;
39
+ /** If false, inbound Wait for Call gets a new beginningSessionId. Default true. */
40
+ reuseBeginningSessionId?: boolean;
39
41
  }
40
42
  export default class InitiateCall extends VoiceStep<INPUT, TODO, CallStartEvent> {
41
43
  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, gatewaySettingsMode, sipHost, sipUser, sipPassword, sipProfile, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel, } = this.data;
50
+ const { asr, tts, from: botNumber, endUserNumber, gatewaySettingsMode, sipHost, sipUser, sipPassword, sipProfile, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel, reuseBeginningSessionId = true, } = this.data;
51
51
  const call = await this.fetchData();
52
52
  this.triggers.once(`in/voice/${call.id}/event`, async (event) => {
53
53
  switch (event.params.type) {
@@ -193,6 +193,13 @@ class InitiateCall extends voice_1.default {
193
193
  gateway,
194
194
  maxLoops: this.session.data?.loopPrevention?.enabled && this.session.data.loopPrevention.maxLoops,
195
195
  };
196
+ if (reuseBeginningSessionId === false) {
197
+ params.reporting = {
198
+ ...this.session.getSessionRef(),
199
+ beginningSessionId: '',
200
+ };
201
+ }
202
+ this.log.info({ params }, 'Originating call');
196
203
  if (otherCallRef) {
197
204
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
198
205
  const otherThread = this.process.getSafeThread(otherCallRefThread || this.thread.id);
@@ -207,14 +214,14 @@ class InitiateCall extends voice_1.default {
207
214
  await this.thread.emitAsync({
208
215
  target: 'provider',
209
216
  name: 'out/voice/originate',
210
- params
217
+ params,
211
218
  });
212
219
  }
213
220
  else {
214
221
  await this.thread.emitAsync({
215
222
  target: 'provider',
216
223
  name: 'out/voice/originate/v2',
217
- params
224
+ params,
218
225
  });
219
226
  }
220
227
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.43",
3
+ "version": "7.0.44-VOIC1805.1",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",