@onereach/step-voice 6.0.15 → 6.0.16

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.
@@ -81,10 +81,13 @@ class GlobalCommand extends voice_1.default {
81
81
  this.triggers.otherwise(async () => {
82
82
  await this.initGrammar(call);
83
83
  });
84
- this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: types_1.MAIN_THREAD_ID, sync: true }, async () => {
85
- // todo: hook once
86
- delete this.waits['@waitEnd']; // TODO is there beter way to unsubscribe?
87
- delete this.waits.waitEnd; // TODO is there beter way to unsubscribe?
84
+ this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: types_1.MAIN_THREAD_ID, sync: true, times: 1 }, async () => {
85
+ // TODO: this is not required in newer versions, delete in v6.1+
86
+ const allowAck = this.canVoicerAck(call);
87
+ if (!allowAck) {
88
+ delete this.waits['@waitEnd'];
89
+ delete this.waits.waitEnd;
90
+ }
88
91
  if (!call.ended) {
89
92
  this.state.passive = true;
90
93
  await this.sendCommands(call, [{ name: 'grammar', params: {} }]);
package/dst/step.js CHANGED
@@ -128,7 +128,7 @@ class ConvStep extends step_1.default {
128
128
  async waitGlobEnd() {
129
129
  const gcThreadId = this.workerThreadId;
130
130
  // wait for glob thread end (if exists)
131
- this.triggers.hook({ name: "end" /* ACTION.end */, thread: gcThreadId }, async () => await this.onConvEnd());
131
+ this.triggers.hook({ name: "end" /* ACTION.end */, thread: gcThreadId, times: 1 }, async () => await this.onConvEnd());
132
132
  if (!this.process.getThread(gcThreadId))
133
133
  await this.onConvEnd();
134
134
  }
package/dst/voice.js CHANGED
@@ -62,7 +62,8 @@ class VoiceStep extends step_1.default {
62
62
  dataThread.waits[`thread/end/${this.thread.id}`] = {};
63
63
  return;
64
64
  }
65
- this.triggers.hook({ name: "ending" /* ACTION.ending */, thread: this.dataThreadId, sync: true }, async () => {
65
+ this.triggers.hook({ name: "ending" /* ACTION.ending */, thread: this.dataThreadId, sync: true, times: 1 }, async () => {
66
+ // TODO: this is not required in newer versions, delete in v6.1+
66
67
  delete this.waits['@ending'];
67
68
  delete this.waits.ending;
68
69
  if (dataThread.state.name === this.sleepUntilHangup.name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "6.0.15",
3
+ "version": "6.0.16",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",
@@ -19,7 +19,7 @@
19
19
  "uuid": "^9.0.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@onereach/flow-sdk": "^3.2.16",
22
+ "@onereach/flow-sdk": "^3.2.45",
23
23
  "@onereach/step-voice": "./test",
24
24
  "@swc/cli": "^0.1.62",
25
25
  "@swc/core": "^1.3.57",