@onereach/step-voice 7.0.6 → 7.0.7

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.
@@ -36,13 +36,20 @@ class WaitForCall extends voice_1.default {
36
36
  delete call.from;
37
37
  delete call.to;
38
38
  const presetTime = (Number(endOfInputTimeout) || 0) * 60 * 1000;
39
+ const { sessionId: previousSessionId = '', beginningSessionId = '', } = event?.reporting ?? {};
39
40
  await this.session.start({
40
41
  timeout: presetTime || defaultSessionTimeout,
41
42
  reporting: {
42
43
  settingsKey: 'session',
43
44
  startedBy: 'Visitor',
44
- sessionType: 'Phone'
45
- }
45
+ sessionType: 'Phone',
46
+ previousSessionId,
47
+ beginningSessionId
48
+ },
49
+ reportingSessions: [{
50
+ previousSessionId,
51
+ beginningSessionId
52
+ }]
46
53
  });
47
54
  await this.startConversation(call);
48
55
  await this.transcript(call, {
package/dst/voice.js CHANGED
@@ -51,7 +51,7 @@ class VoiceStep extends step_1.default {
51
51
  async sendCommands({ id, type, callback }, commands) {
52
52
  if (lodash_1.default.isEmpty(commands))
53
53
  return;
54
- const result = await this.thread.eventManager.emit({
54
+ const event = {
55
55
  target: this.helpers.providersAccountId,
56
56
  name: `out/voice/${type}`,
57
57
  params: {
@@ -62,8 +62,11 @@ class VoiceStep extends step_1.default {
62
62
  commands,
63
63
  step: { key: this.session.key, trd: this.isGlobal ? this.workerThreadId : this.thread.id } // response should be sent to this session
64
64
  },
65
- reporting: this.session.getSessionRef()
66
- }, {
65
+ reporting: {
66
+ ...this.session.getSessionRef(),
67
+ }
68
+ };
69
+ const result = await this.thread.eventManager.emit(event, {
67
70
  target: callback,
68
71
  invocationType: 'async',
69
72
  timeout: 5000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.6",
3
+ "version": "7.0.7",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",