@routr/connect 2.0.21 → 2.0.31

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.
Files changed (2) hide show
  1. package/dist/router.js +6 -0
  2. package/package.json +5 -5
package/dist/router.js CHANGED
@@ -201,11 +201,14 @@ function agentToPSTN(req, agent, calleeNumber) {
201
201
  // This should never happen
202
202
  throw new Error(`no trunk associated with Number ref: ${(_c = policy.number) === null || _c === void 0 ? void 0 : _c.ref}`);
203
203
  }
204
+ const via = req.message.via[0];
204
205
  const uri = (0, utils_1.getTrunkURI)(trunk);
205
206
  return {
206
207
  user: uri.user,
207
208
  host: uri.host,
208
209
  port: uri.port,
210
+ advertisedHost: via.host,
211
+ advertisedPort: via.port,
209
212
  transport: (_d = uri.transport) === null || _d === void 0 ? void 0 : _d.toUpperCase(),
210
213
  edgePortRef: req.edgePortRef,
211
214
  listeningPoints: req.listeningPoints,
@@ -259,11 +262,14 @@ function peerToPSTN(apiClient, req) {
259
262
  // TODO: Create custom error
260
263
  throw new Error(`no trunk associated with Number ref: ${number.ref}`);
261
264
  }
265
+ const via = req.message.via[0];
262
266
  const uri = (0, utils_1.getTrunkURI)(number.trunk);
263
267
  return {
264
268
  user: uri.user,
265
269
  host: uri.host,
266
270
  port: uri.port,
271
+ advertisedHost: via.host,
272
+ advertisedPort: via.port,
267
273
  transport: uri.transport,
268
274
  edgePortRef: req.edgePortRef,
269
275
  listeningPoints: req.listeningPoints,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/connect",
3
- "version": "2.0.21",
3
+ "version": "2.0.31",
4
4
  "description": "Default processor",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -28,9 +28,9 @@
28
28
  "@opentelemetry/sdk-trace-base": "^1.0.4",
29
29
  "@opentelemetry/sdk-trace-node": "^1.0.4",
30
30
  "@opentelemetry/semantic-conventions": "^1.0.4",
31
- "@routr/common": "^2.0.20",
32
- "@routr/location": "^2.0.21",
33
- "@routr/processor": "^2.0.20",
31
+ "@routr/common": "^2.0.31",
32
+ "@routr/location": "^2.0.31",
33
+ "@routr/processor": "^2.0.31",
34
34
  "jsonwebtoken": "^9.0.0"
35
35
  },
36
36
  "devDependencies": {
@@ -49,5 +49,5 @@
49
49
  "bugs": {
50
50
  "url": "https://github.com/fonoster/routr/issues"
51
51
  },
52
- "gitHead": "cb5ff583117dc1812ea05850b9c7c9324e6e6be7"
52
+ "gitHead": "bef1839e53701906f0739c8116639a1371f69173"
53
53
  }