@onereach/step-voice 4.0.1 → 4.0.2
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 +4 -14
- package/package.json +1 -1
package/dst/Initiate Call.js
CHANGED
|
@@ -71,23 +71,12 @@ class InitiateCall extends voice_1.default {
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
this.
|
|
75
|
-
|
|
76
|
-
originationId
|
|
77
|
-
});
|
|
74
|
+
await this.setDataOut({ id: originationId });
|
|
75
|
+
this.gotoState('waitForCall');
|
|
78
76
|
}
|
|
79
77
|
async waitForCall() {
|
|
80
78
|
const { from: botNumber, endUserNumber, isAMD, asr, tts, sessionTimeout } = this.data;
|
|
81
|
-
const originationId = this.
|
|
82
|
-
const sessionTimeoutMs = timestring(`${sessionTimeout} min`, 'ms') || defaultSessionTimeout;
|
|
83
|
-
// let channel = await this.getDataOut();
|
|
84
|
-
// if (!_.get(channel, ['originationId'])) {
|
|
85
|
-
// channel = {
|
|
86
|
-
// originationId: require('uuid').v4(),
|
|
87
|
-
// callback: {}
|
|
88
|
-
// };
|
|
89
|
-
// await this.setDataOut(channel);
|
|
90
|
-
// }
|
|
79
|
+
const { id: originationId } = await this.getDataOut();
|
|
91
80
|
this.triggers.once(`in/voice/${originationId}/event`, async (event) => {
|
|
92
81
|
switch (event.params.type) {
|
|
93
82
|
case 'is_flow_ready': {
|
|
@@ -114,6 +103,7 @@ class InitiateCall extends voice_1.default {
|
|
|
114
103
|
delete channel.from;
|
|
115
104
|
delete channel.to;
|
|
116
105
|
if (!this.session.key) {
|
|
106
|
+
const sessionTimeoutMs = timestring(`${sessionTimeout} min`, 'ms') || defaultSessionTimeout;
|
|
117
107
|
await this.session.start({
|
|
118
108
|
key: channel.id,
|
|
119
109
|
timeout: sessionTimeoutMs,
|