@onereach/step-voice 7.0.19 → 7.0.20
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/voice.d.ts +1 -1
- package/dst/voice.js +4 -4
- package/package.json +1 -1
package/dst/voice.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export default class VoiceStep<TIn = unknown, TOut = unknown, TParams extends Vo
|
|
|
109
109
|
rptsHasMore({ repromptsList }: TODO): boolean;
|
|
110
110
|
get rptsIndex(): number;
|
|
111
111
|
get rptsStarted(): boolean;
|
|
112
|
-
|
|
112
|
+
canVoicerHeartbeat(call: IVoiceCall): boolean;
|
|
113
113
|
canVoicerAck(call: IVoiceCall): boolean;
|
|
114
114
|
getInterruptionMetadata(event: IEvent<TParams>): VoiceInterruptionMetadata | null;
|
|
115
115
|
handleInterruption(params: HandleInterruptionParams<TParams>): Promise<void>;
|
package/dst/voice.js
CHANGED
|
@@ -75,14 +75,14 @@ class VoiceStep extends step_1.default {
|
|
|
75
75
|
throw new Error(`failed to send command to call: ${id}`);
|
|
76
76
|
}
|
|
77
77
|
async handleHeartbeat(call) {
|
|
78
|
-
const allowHeartbeat = this.
|
|
78
|
+
const allowHeartbeat = this.session.key && this.canVoicerHeartbeat(call);
|
|
79
79
|
if (allowHeartbeat) {
|
|
80
80
|
if (this.thread.background) {
|
|
81
81
|
delete this.waits.timeout;
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
const
|
|
85
|
-
this.triggers.deadline(
|
|
84
|
+
const expectHeartbeatBefore = Date.now() + 290000;
|
|
85
|
+
this.triggers.deadline(expectHeartbeatBefore, () => {
|
|
86
86
|
this.thread.background = true;
|
|
87
87
|
if (call.ended) {
|
|
88
88
|
this.log.warn('missing heartbeat, call is ended');
|
|
@@ -401,7 +401,7 @@ class VoiceStep extends step_1.default {
|
|
|
401
401
|
get rptsStarted() {
|
|
402
402
|
return this.rptsIndex !== 0;
|
|
403
403
|
}
|
|
404
|
-
|
|
404
|
+
canVoicerHeartbeat(call) {
|
|
405
405
|
return call.vv >= 1;
|
|
406
406
|
}
|
|
407
407
|
canVoicerAck(call) {
|