@onereach/step-voice 4.0.9 → 4.0.12

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.
@@ -4,10 +4,5 @@ export default class InitiateCall extends VoiceStep<any, any, import("./voice").
4
4
  get autoCancel(): undefined;
5
5
  runStep(): Promise<void>;
6
6
  waitForCall(): Promise<void>;
7
- error: {
8
- name: string;
9
- message: string;
10
- stack: {};
11
- } | undefined;
12
7
  }
13
8
  import VoiceStep from "./voice";
@@ -32,7 +32,7 @@ class InitiateCall extends voice_1.default {
32
32
  }
33
33
  async waitForCall() {
34
34
  const { asr, tts, from: botNumber, endUserNumber, sipHost, sipUser, sipPassword, timeout, headers, enableSpoofCallerId, spoofCallerId, isAMD } = this.data;
35
- const { id: channelId } = await this.getDataOut();
35
+ const { id: channelId } = await this.fetchData();
36
36
  this.triggers.once(`in/voice/${channelId}/event`, async (event) => {
37
37
  switch (event.params.type) {
38
38
  case 'is_flow_ready': {
@@ -44,8 +44,8 @@ class InitiateCall extends voice_1.default {
44
44
  }
45
45
  };
46
46
  });
47
- await this.startConversation({ id: channelId, type: 'voicer', callback: event.params.callback }, { events: [] });
48
- this.log.warn('Confirming that the OB call can be started');
47
+ await this.startConversation(event.params.channel, { events: [] });
48
+ this.log.warn({ channel: event.params.channel, conv: this.conversation, data: this.get(this.conversation) }, 'Confirming that the OB call can be started');
49
49
  return this.exitFlow();
50
50
  }
51
51
  case 'call': {
@@ -107,15 +107,10 @@ class InitiateCall extends voice_1.default {
107
107
  await this.updateData();
108
108
  return this.exitStep('no answer', errorChannel);
109
109
  }
110
- this.error = {
111
- name: event.params.error.name,
112
- message: `${event.params.error.date}: ${event.params.error.originateStatus}`,
113
- stack: {}
114
- };
115
110
  await this.transcript(errorChannel, { action: 'Call Error' });
116
- return this.exitStep('error', {
117
- ...errorChannel,
118
- ...this.error
111
+ return this.throwError({
112
+ name: event.params.error.name,
113
+ message: `${event.params.error.date}: ${event.params.error.originateStatus}`
119
114
  });
120
115
  }
121
116
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "4.0.9",
3
+ "version": "4.0.12",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",
@@ -13,27 +13,27 @@
13
13
  "npm": ">= 6.0.0"
14
14
  },
15
15
  "dependencies": {
16
- "@onereach/step-conversation": "^1.0.32",
16
+ "@onereach/step-conversation": "^1.0.33",
17
17
  "lodash": "^4.17.21",
18
18
  "uuid": "^8.3.2"
19
19
  },
20
20
  "devDependencies": {
21
- "@onereach/flow-sdk": "^3.0.12",
21
+ "@onereach/flow-sdk": "^3.0.14",
22
22
  "@swc/cli": "^0.1.57",
23
- "@swc/core": "^1.2.196",
23
+ "@swc/core": "^1.2.197",
24
24
  "@swc/jest": "^0.2.21",
25
- "@types/jest": "^28.1.0",
25
+ "@types/jest": "^28.1.1",
26
26
  "@types/lodash": "^4.14.182",
27
27
  "@types/timestring": "^6.0.2",
28
28
  "@types/uuid": "^8.3.4",
29
- "aws-sdk": "^2.1148.0",
29
+ "aws-sdk": "^2.1149.0",
30
30
  "babel-runtime": "^6.26.0",
31
31
  "docdash": "^1.2.0",
32
32
  "husky": "^8.0.1",
33
- "jest": "^28.1.0",
33
+ "jest": "^28.1.1",
34
34
  "pinst": "^3.0.0",
35
35
  "ts-standard": "^11.0.0",
36
- "typescript": "^4.7.2"
36
+ "typescript": "^4.7.3"
37
37
  },
38
38
  "files": [
39
39
  "/dst"