@onereach/step-voice 6.0.12 → 6.0.13

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.
@@ -70,6 +70,7 @@ class GlobalCommand extends voice_1.default {
70
70
  this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: types_1.MAIN_THREAD_ID, sync: true }, async () => {
71
71
  delete this.waits['@waitEnd']; // TODO is there beter way to unsubscribe?
72
72
  if (!call.ended) {
73
+ this.state.passive = true;
73
74
  await this.sendCommands(call, [{ name: 'grammar', params: {} }]);
74
75
  }
75
76
  if (this.thread.background)
@@ -146,12 +147,19 @@ class GlobalCommand extends voice_1.default {
146
147
  }
147
148
  async hangup(call) {
148
149
  if (this.event.params.zombie) {
149
- this.log.debug('ignore zombie hangup');
150
- return this.exitFlow();
150
+ if (this.state.passive) {
151
+ this.log.debug('ignore zombie hangup waiting for full hangup');
152
+ return this.exitFlow();
153
+ }
154
+ this.log.debug('this gc was ignored because call is aleady hang up');
155
+ return this.end();
151
156
  }
152
157
  await this.handleHangup(call);
153
158
  const isHangedUpByBot = call.sessionEndedBy === 'Bot';
154
- const hangUpType = isHangedUpByBot ? 'bot hang up' : 'user hang up';
159
+ let hangUpType = isHangedUpByBot ? 'bot hang up' : 'user hang up';
160
+ if (this.event.params.error != null) {
161
+ hangUpType = 'unexpected hang up';
162
+ }
155
163
  let processHangUp = this.data.processHangUp;
156
164
  // process call recording in hangup event
157
165
  if (call.recordCall && this.event.params.callRecording != null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "6.0.12",
3
+ "version": "6.0.13",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",