@onereach/step-voice 4.0.37-master.0 → 4.0.38

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
@@ -8,6 +8,11 @@ interface INPUT {
8
8
  value: string;
9
9
  }>;
10
10
  refer: boolean;
11
+ gatewaySettigsMode?: string;
12
+ from?: string;
13
+ sipHost?: string;
14
+ sipUser?: string;
15
+ sipPassword?: string;
11
16
  }
12
17
  interface EVENT {
13
18
  type: EventType;
package/dst/Transfer.js CHANGED
@@ -48,19 +48,26 @@ class Transfer extends voice_1.default {
48
48
  return this.exitFlow();
49
49
  });
50
50
  this.triggers.otherwise(async () => {
51
- const { phoneNumber, sessionTimeout, destination, sipHeaders = [], refer } = this.data;
51
+ const { phoneNumber, sessionTimeout, destination, sipHeaders = [], sipHost, sipUser, sipPassword, refer, gatewaySettigsMode, from } = this.data;
52
52
  const destinationIsSip = (/^sip:/i).test(destination);
53
53
  const destinationIsUser = (/^user:/i).test(destination);
54
54
  const callerID = phoneNumber;
55
55
  const timeout = Number(sessionTimeout);
56
+ const inheritGatewaySetting = gatewaySettigsMode === 'inherit';
56
57
  const headers = Object.fromEntries(sipHeaders.map(({ name, value }) => [name, value]));
57
58
  const command = {
58
59
  name: destinationIsSip ? (refer ? 'refer' : 'bridge_sip') : (destinationIsUser ? 'bridge_user' : 'bridge'),
59
60
  params: {
60
- botNumber: channel.botNumber,
61
+ botNumber: inheritGatewaySetting ? from : channel.botNumber,
61
62
  transferFrom: callerID,
62
63
  transferTo: destination,
63
64
  headers,
65
+ gateway: sipHost ? {
66
+ host: sipHost,
67
+ user: sipUser,
68
+ username: sipUser,
69
+ password: sipPassword
70
+ } : undefined,
64
71
  timeout
65
72
  }
66
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "4.0.37-master.0",
3
+ "version": "4.0.38",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",