@onereach/step-voice 6.0.5 → 6.0.6
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.
- package/dst/Global Command.js +17 -13
- package/package.json +1 -1
package/dst/Global Command.js
CHANGED
|
@@ -71,16 +71,18 @@ class GlobalCommand extends voice_1.default {
|
|
|
71
71
|
this.triggers.otherwise(async () => {
|
|
72
72
|
await this.initGrammar();
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
const dataThread = this.process.getThread(this.dataThreadId);
|
|
75
|
+
if (this.dataThreadId !== types_1.MAIN_THREAD_ID && dataThread != null && !dataThread.ending) {
|
|
75
76
|
this.triggers.hook({ name: "ending" /* ACTION.ending */, thread: this.dataThreadId, sync: true }, async () => {
|
|
76
|
-
this.log.debug('sleep data thread', { thread: this.dataThreadId });
|
|
77
77
|
delete this.waits['@ending'];
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
if (dataThread.waits[`in/voice/${call.id}`]) {
|
|
79
|
+
this.log.debug('sleep data thread', { thread: this.dataThreadId });
|
|
80
|
+
dataThread.gotoState({
|
|
81
|
+
direct: true,
|
|
82
|
+
step: this.currentStepId,
|
|
83
|
+
name: this.sleepUntilHangup.name
|
|
84
|
+
});
|
|
85
|
+
}
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
this.triggers.hook({ name: "waitEnd" /* ACTION.waitEnd */, thread: types_1.MAIN_THREAD_ID, sync: true }, async () => {
|
|
@@ -94,11 +96,13 @@ class GlobalCommand extends voice_1.default {
|
|
|
94
96
|
switch (event.params.type) {
|
|
95
97
|
case 'hangup': {
|
|
96
98
|
await this.hangup(call);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
if (dataThread?.state.name === this.sleepUntilHangup.name) {
|
|
100
|
+
this.log.debug('wake data thread', { thread: this.dataThreadId });
|
|
101
|
+
this.process.enqueue({
|
|
102
|
+
thread: this.dataThreadId,
|
|
103
|
+
name: LocalEvents.hangup
|
|
104
|
+
});
|
|
105
|
+
}
|
|
102
106
|
return;
|
|
103
107
|
}
|
|
104
108
|
case 'avm-detected':
|