@onereach/step-voice 7.0.11 → 7.0.12

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;
@@ -93,6 +93,14 @@ class GlobalCommand extends voice_1.default {
93
93
  await this.initGrammar(call);
94
94
  }
95
95
  });
96
+ // Set loop prevention settings on call object
97
+ if (this.data.loopPrevention?.enabled) {
98
+ this.session.data.loopPrevention = {
99
+ enabled: this.data.loopPrevention.enabled,
100
+ maxLoops: this.data.loopPrevention.maxLoops
101
+ };
102
+ await this.updateData();
103
+ }
96
104
  if (allowAck) {
97
105
  this.triggers.local('ack', ({ params: { ack } }) => {
98
106
  const worker = this.process.getThread(this.workerThreadId);
@@ -223,6 +223,7 @@ class InitiateCall extends voice_1.default {
223
223
  version: 2,
224
224
  sessionExpireTime: this.session.expireTime,
225
225
  gateway,
226
+ maxLoops: this.session.data?.loopPrevention?.enabled && this.session.data.loopPrevention.maxLoops,
226
227
  };
227
228
  if (otherCallRef) {
228
229
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
package/dst/Transfer.js CHANGED
@@ -86,7 +86,8 @@ class Transfer extends voice_1.default {
86
86
  transferTo: destination,
87
87
  headers,
88
88
  gateway,
89
- timeout
89
+ timeout,
90
+ maxLoops: this.session.data?.loopPrevention?.enabled ? this.session.data.loopPrevention.maxLoops : undefined,
90
91
  }
91
92
  };
92
93
  const muteAfterTransfer = !!muteRecording;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.11",
3
+ "version": "7.0.12",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",