@onereach/step-voice 7.0.10 → 7.0.11-VOIC1606.4

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.
@@ -12,6 +12,10 @@ interface INPUT {
12
12
  recordFileTtl: number;
13
13
  limitLinkTtl: boolean;
14
14
  recordLinkTtl: number;
15
+ loopPrevention: {
16
+ enabled: boolean;
17
+ maxLoops: number;
18
+ };
15
19
  }
16
20
  interface OUTPUT {
17
21
  type: string;
@@ -115,6 +115,14 @@ class GlobalCommand extends voice_1.default {
115
115
  call.recordCall = true;
116
116
  await this.updateData();
117
117
  }
118
+ // Set loop prevention settings on call object
119
+ if (this.data.loopPrevention?.enabled) {
120
+ call.loopPrevention = {
121
+ enabled: this.data.loopPrevention.enabled,
122
+ maxLoops: this.data.loopPrevention.maxLoops
123
+ };
124
+ await this.updateData();
125
+ }
118
126
  // set grammar on voicer
119
127
  await this.sendCommands(call, [
120
128
  {
@@ -209,7 +209,10 @@ class InitiateCall extends voice_1.default {
209
209
  : undefined,
210
210
  timeout: originateTimeout,
211
211
  version: 2,
212
- sessionExpireTime: this.session.expireTime
212
+ sessionExpireTime: this.session.expireTime,
213
+ loopPrevention: call?.loopPrevention ?? {
214
+ v: 1
215
+ }
213
216
  };
214
217
  if (otherCallRef) {
215
218
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
package/dst/Transfer.js CHANGED
@@ -74,7 +74,8 @@ class Transfer extends voice_1.default {
74
74
  password: sipPassword
75
75
  }
76
76
  : undefined,
77
- timeout
77
+ timeout,
78
+ loopPrevention: call.loopPrevention
78
79
  }
79
80
  };
80
81
  const muteAfterTransfer = !!muteRecording;
package/dst/voice.d.ts CHANGED
@@ -25,6 +25,10 @@ export interface IVoiceCall extends IConversationData {
25
25
  asr?: TODO;
26
26
  tts?: TODO;
27
27
  sessionEndedBy?: string;
28
+ loopPrevention?: {
29
+ enabled: boolean;
30
+ maxLoops: number;
31
+ };
28
32
  to?: string;
29
33
  from?: string;
30
34
  headers?: Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.10",
3
+ "version": "7.0.11-VOIC1606.4",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",