@routr/connect 2.2.0 → 2.3.0

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/dist/router.js CHANGED
@@ -108,19 +108,23 @@ function router(location, apiClient) {
108
108
  switch (routingDirection) {
109
109
  case types_1.RoutingDirection.AGENT_TO_AGENT: {
110
110
  const route = yield agentToAgent(location, request);
111
- return Object.assign(Object.assign({}, route), { metadata: caller.extended });
111
+ return route
112
+ ? Object.assign(Object.assign({}, route), { metadata: caller.extended }) : null;
112
113
  }
113
114
  case types_1.RoutingDirection.AGENT_TO_PEER: {
114
115
  const route = yield agentToPeer(location, callee, request);
115
- return Object.assign(Object.assign({}, route), { metadata: caller.extended });
116
+ return route
117
+ ? Object.assign(Object.assign({}, route), { metadata: caller.extended }) : null;
116
118
  }
117
119
  case types_1.RoutingDirection.AGENT_TO_PSTN: {
118
120
  const route = yield agentToPSTN(request, caller, requestURI.user);
119
- return Object.assign(Object.assign({}, route), { metadata: caller.extended });
121
+ return route
122
+ ? Object.assign(Object.assign({}, route), { metadata: caller.extended }) : null;
120
123
  }
121
124
  case types_1.RoutingDirection.FROM_PSTN: {
122
125
  const route = yield fromPSTN(apiClient, location, callee, request);
123
- return Object.assign(Object.assign({}, route), { metadata: callee.extended });
126
+ return route
127
+ ? Object.assign(Object.assign({}, route), { metadata: callee.extended }) : null;
124
128
  }
125
129
  case types_1.RoutingDirection.PEER_TO_PSTN:
126
130
  return yield peerToPSTN(apiClient, request);
package/dist/service.js CHANGED
@@ -57,8 +57,9 @@ function connectProcessor(config) {
57
57
  // If it is a response simply forwards to uac
58
58
  if (processor_1.Helper.isTypeResponse(req)) {
59
59
  // Remove the proxy and overwrite the contact with the sender info
60
- // NOTE: We should consider making the overwriteContactWithSenderInfo at the endpoint level
61
- return res.send((0, function_1.pipe)(req, processor_1.Alterations.overwriteContactWithSenderInfo, processor_1.Alterations.removeTopVia));
60
+ return res.send(
61
+ // NOTE: We should consider making the overwriteContactWithSenderInfo an Agent/Peer level alteration
62
+ (0, function_1.pipe)(req, processor_1.Alterations.overwriteContactWithSenderInfo, processor_1.Alterations.removeTopVia));
62
63
  }
63
64
  switch (req.method) {
64
65
  case common_1.Method.PUBLISH:
package/dist/tailor.js CHANGED
@@ -22,5 +22,8 @@ exports.tailor = void 0;
22
22
  const processor_1 = require("@routr/processor");
23
23
  const function_1 = require("fp-ts/function");
24
24
  // Q: Should we add support for strict routing?
25
- const tailor = (route, req) => (0, function_1.pipe)(req, processor_1.Alterations.decreaseMaxForwards, processor_1.Alterations.removeAuthorization, processor_1.Alterations.removeSelfRoutes, processor_1.Alterations.removeXEdgePortRef, processor_1.Alterations.fixInvalidContact, processor_1.Alterations.fixRequestURI(route), processor_1.Alterations.addSelfVia(route), processor_1.Alterations.applyXHeaders(route), processor_1.Alterations.addSelfRecordRoute(route), processor_1.Alterations.addRouteToNextHop(route));
25
+ const tailor = (route, req) => (0, function_1.pipe)(req, processor_1.Alterations.decreaseMaxForwards, processor_1.Alterations.removeAuthorization, processor_1.Alterations.removeSelfRoutes, processor_1.Alterations.removeXEdgePortRef,
26
+ // NOTE: We should consider making the overwriteContactWithSenderInfo an Agent/Peer level alteration
27
+ // A.overwriteContactWithSenderInfo,
28
+ processor_1.Alterations.fixInvalidContact, processor_1.Alterations.fixRequestURI(route), processor_1.Alterations.addSelfVia(route), processor_1.Alterations.applyXHeaders(route), processor_1.Alterations.addSelfRecordRoute(route), processor_1.Alterations.addRouteToNextHop(route));
26
29
  exports.tailor = tailor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/connect",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
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.2.0",
32
- "@routr/location": "^2.2.0",
33
- "@routr/processor": "^2.2.0",
31
+ "@routr/common": "^2.3.0",
32
+ "@routr/location": "^2.3.0",
33
+ "@routr/processor": "^2.3.0",
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": "924c7d8711a7855635e52184d8ece28587febf48"
52
+ "gitHead": "a07009852c37cf04303a5adef42bdac75a747a32"
53
53
  }