@onereach/step-voice 6.0.9 → 6.0.10
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/Initiate Call.js +8 -3
- package/package.json +1 -1
package/dst/Initiate Call.js
CHANGED
|
@@ -47,7 +47,7 @@ class InitiateCall extends voice_1.default {
|
|
|
47
47
|
this.exitStep('cancel');
|
|
48
48
|
}
|
|
49
49
|
async waitForCall() {
|
|
50
|
-
const { asr, tts, from: botNumber, endUserNumber, sipHost, sipUser, sipPassword, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread } = this.data;
|
|
50
|
+
const { asr, tts, from: botNumber, endUserNumber, sipHost, sipUser, sipPassword, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel } = this.data;
|
|
51
51
|
const call = await this.fetchData();
|
|
52
52
|
this.triggers.once(`in/voice/${call.id}/event`, async (event) => {
|
|
53
53
|
switch (event.params.type) {
|
|
@@ -106,8 +106,13 @@ class InitiateCall extends voice_1.default {
|
|
|
106
106
|
}
|
|
107
107
|
case 'hangup': {
|
|
108
108
|
await this.handleHangup(call);
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
if (handleCancel && event.params.error?.name === 'CancelError') {
|
|
110
|
+
return this.exitStep('cancel');
|
|
111
|
+
}
|
|
112
|
+
return this.throwError(event.params.error ?? {
|
|
113
|
+
name: 'HangupError',
|
|
114
|
+
message: 'unpexpected hangup during init call'
|
|
115
|
+
});
|
|
111
116
|
}
|
|
112
117
|
case 'error': {
|
|
113
118
|
const error = event.params.error;
|