@onereach/step-voice 5.0.1 → 5.0.2-fixtransfer.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/Transfer.d.ts CHANGED
@@ -17,6 +17,7 @@ interface INPUT {
17
17
  interface EVENT {
18
18
  type: EventType;
19
19
  error?: string | Error;
20
+ originateDisposition?: string;
20
21
  }
21
22
  export default class Transfer extends VoiceStep<INPUT, {}, EVENT> {
22
23
  runStep(): Promise<void>;
package/dst/Transfer.js CHANGED
@@ -21,7 +21,10 @@ class Transfer extends voice_1.default {
21
21
  return this.exitFlow();
22
22
  }
23
23
  case 'bridge/ended': {
24
- if (event.params.error === 'NORMAL_CLEARING') {
24
+ const { error, originateDisposition } = event.params;
25
+ const isSuccess = error === 'NORMAL_CLEARING'
26
+ && (!originateDisposition || originateDisposition === 'SUCCESS');
27
+ if (isSuccess) {
25
28
  await this.transcript(call, {
26
29
  action: 'Transfer Ended - Answered',
27
30
  actionFromBot: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "5.0.1",
3
+ "version": "5.0.2-fixtransfer.1",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",
@@ -44,13 +44,9 @@
44
44
  "build": "npm run clean && tsc -p ./tsconfig.build.json",
45
45
  "build-fast": "npm run clean && swc ./src -d ./dst",
46
46
  "deploy": "./scripts/deploy.sh",
47
- "download-prod": "./scripts/download.sh prod",
48
- "download-dev": "s./scripts/download.sh dev",
49
- "upload-prod": "./scripts/upload.sh prod",
50
- "upload-dev": "./scripts/upload.sh dev",
47
+ "download": "./scripts/download.sh",
48
+ "upload": "./scripts/upload.sh",
51
49
  "pub": "./scripts/publish.sh",
52
- "publish-patch": "echo use: npm run pub; exit 1",
53
- "publish-beta": "echo use: npm run pub; exit 1",
54
50
  "test": "jest"
55
51
  },
56
52
  "repository": {