@onereach/step-voice 7.0.43 → 7.0.44-VOIC1805.1
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.d.ts +2 -0
- package/dst/Initiate Call.js +10 -3
- package/package.json +1 -1
package/dst/Initiate Call.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ interface INPUT {
|
|
|
36
36
|
whisperAnnounceAudio?: TODO[];
|
|
37
37
|
whisperCustomerConversation?: string;
|
|
38
38
|
whisperCustomerConversationThread?: string;
|
|
39
|
+
/** If false, inbound Wait for Call gets a new beginningSessionId. Default true. */
|
|
40
|
+
reuseBeginningSessionId?: boolean;
|
|
39
41
|
}
|
|
40
42
|
export default class InitiateCall extends VoiceStep<INPUT, TODO, CallStartEvent> {
|
|
41
43
|
get conversation(): string | import("@onereach/flow-sdk/types").IMergeField;
|
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, gatewaySettingsMode, sipHost, sipUser, sipPassword, sipProfile, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel, } = this.data;
|
|
50
|
+
const { asr, tts, from: botNumber, endUserNumber, gatewaySettingsMode, sipHost, sipUser, sipPassword, sipProfile, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD, otherCallRef, otherCallRefThread, handleCancel, reuseBeginningSessionId = true, } = 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) {
|
|
@@ -193,6 +193,13 @@ class InitiateCall extends voice_1.default {
|
|
|
193
193
|
gateway,
|
|
194
194
|
maxLoops: this.session.data?.loopPrevention?.enabled && this.session.data.loopPrevention.maxLoops,
|
|
195
195
|
};
|
|
196
|
+
if (reuseBeginningSessionId === false) {
|
|
197
|
+
params.reporting = {
|
|
198
|
+
...this.session.getSessionRef(),
|
|
199
|
+
beginningSessionId: '',
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
this.log.info({ params }, 'Originating call');
|
|
196
203
|
if (otherCallRef) {
|
|
197
204
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
198
205
|
const otherThread = this.process.getSafeThread(otherCallRefThread || this.thread.id);
|
|
@@ -207,14 +214,14 @@ class InitiateCall extends voice_1.default {
|
|
|
207
214
|
await this.thread.emitAsync({
|
|
208
215
|
target: 'provider',
|
|
209
216
|
name: 'out/voice/originate',
|
|
210
|
-
params
|
|
217
|
+
params,
|
|
211
218
|
});
|
|
212
219
|
}
|
|
213
220
|
else {
|
|
214
221
|
await this.thread.emitAsync({
|
|
215
222
|
target: 'provider',
|
|
216
223
|
name: 'out/voice/originate/v2',
|
|
217
|
-
params
|
|
224
|
+
params,
|
|
218
225
|
});
|
|
219
226
|
}
|
|
220
227
|
});
|