@onereach/step-voice 6.0.11 → 6.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.
@@ -26,6 +26,7 @@ interface EVENT extends VoiceEvent {
26
26
  tags?: string[];
27
27
  out?: string;
28
28
  background?: boolean;
29
+ zombie?: boolean;
29
30
  }
30
31
  export default class GlobalCommand extends VoiceStep<Partial<INPUT>, OUTPUT, EVENT> {
31
32
  get isGlobal(): boolean;
@@ -77,10 +77,8 @@ class GlobalCommand extends voice_1.default {
77
77
  });
78
78
  this.triggers.local(`in/voice/${call.id}`, async (event) => {
79
79
  switch (event.params.type) {
80
- case 'hangup': {
81
- await this.hangup(call);
82
- return;
83
- }
80
+ case 'hangup':
81
+ return await this.hangup(call);
84
82
  case 'avm-detected':
85
83
  return await this.exitThread(event, 'AMD', 'AMD');
86
84
  case 'digit':
@@ -147,6 +145,10 @@ class GlobalCommand extends voice_1.default {
147
145
  });
148
146
  }
149
147
  async hangup(call) {
148
+ if (this.event.params.zombie) {
149
+ this.log.debug('ignore zombie hangup');
150
+ return this.exitFlow();
151
+ }
150
152
  await this.handleHangup(call);
151
153
  const isHangedUpByBot = call.sessionEndedBy === 'Bot';
152
154
  const hangUpType = isHangedUpByBot ? 'bot hang up' : 'user hang up';
package/dst/voice.js CHANGED
@@ -364,7 +364,6 @@ class VoiceStep extends step_1.default {
364
364
  // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
365
365
  delete this.waits[this.event.name];
366
366
  }
367
- this.log.debug('>>> sleepUntilHangup', { name: this.event.name, waits: this.waits });
368
367
  }
369
368
  }
370
369
  exports.default = VoiceStep;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "6.0.11",
3
+ "version": "6.0.12",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",