@routr/connect 2.15.0 → 2.15.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.
@@ -71,6 +71,7 @@ const logger = (0, logger_1.getLogger)({ service: "connect", filePath: __filenam
71
71
  const jwtVerifier = (0, utils_1.getVerifierImpl)();
72
72
  const handleRegister = (apiClient, location) => {
73
73
  return (request, res) => __awaiter(void 0, void 0, void 0, function* () {
74
+ var _a;
74
75
  // Calculate and return challenge
75
76
  if (request.message.authorization) {
76
77
  const auth = Object.assign({}, request.message.authorization);
@@ -118,7 +119,7 @@ const handleRegister = (apiClient, location) => {
118
119
  yield location.addRoute({
119
120
  aor: payload.aor,
120
121
  route: location_1.Helper.createRoute(request),
121
- maxContacts: payload.maxContacts || -1
122
+ maxContacts: (_a = payload.maxContacts) !== null && _a !== void 0 ? _a : -1
122
123
  });
123
124
  res.sendRegisterOk(request);
124
125
  }
@@ -76,7 +76,19 @@ const handleRequest = (location, apiClient) => (request, res) => __awaiter(void
76
76
  try {
77
77
  const req = common_1.Environment.ENFORCE_E164 ? enforceE164(request) : request;
78
78
  let route;
79
- if (processor_1.Extensions.getHeaderValue(req, common_1.CommonTypes.ExtraHeader.EDGEPORT_REF)) {
79
+ // A CANCEL must follow the exact path its INVITE took (RFC 3261 §9.1) — it is
80
+ // never a new call to route. edgeport already forwards it correctly, straight
81
+ // from the INVITE's own client transaction (GRPCSipListener#sendCancel), which
82
+ // does not use the route this handler computes for CANCEL at all; it only needs
83
+ // a non-error response to reach that logic. Routing it fresh through
84
+ // peerToPSTN/agentToPSTN re-applies checks meant for a NEW call — chiefly
85
+ // peerToPSTN's required X-DOD-Number header, which Asterisk's CANCEL does not
86
+ // carry (only the original INVITE does) — and rejects it with a 400 that never
87
+ // reaches edgeport's already-correct CANCEL handling. The result: the CANCEL is
88
+ // silently dropped, the call keeps ringing, and if the callee answers a moment
89
+ // later they connect into a line the caller has already abandoned.
90
+ if (processor_1.Extensions.getHeaderValue(req, common_1.CommonTypes.ExtraHeader.EDGEPORT_REF) ||
91
+ req.method === common_1.CommonTypes.Method.CANCEL) {
80
92
  route = location_1.Helper.createRouteFromLastMessage(req);
81
93
  }
82
94
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/connect",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
4
4
  "description": "Default processor",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -29,8 +29,8 @@
29
29
  "@opentelemetry/sdk-trace-node": "^1.0.4",
30
30
  "@opentelemetry/semantic-conventions": "^1.0.4",
31
31
  "@routr/common": "^2.15.0",
32
- "@routr/location": "^2.15.0",
33
- "@routr/processor": "^2.15.0",
32
+ "@routr/location": "^2.15.1",
33
+ "@routr/processor": "^2.15.1",
34
34
  "jsonwebtoken": "^9.0.3"
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": "4cfe8529e9325b7a2f32aff615cf3db65c71cf29"
52
+ "gitHead": "2784f886cab933977feed3fe50edcaec0e6f7dac"
53
53
  }