@routr/processor 2.31.5 → 2.31.6
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/alterations.d.ts +5 -0
- package/dist/alterations.js +10 -2
- package/package.json +3 -3
package/dist/alterations.d.ts
CHANGED
|
@@ -32,6 +32,11 @@ export declare const isAnonymous: (uri: CommonTypes.SipURI) => boolean;
|
|
|
32
32
|
* domain. The tag and display name stay, so the dialog is unchanged for Routr,
|
|
33
33
|
* which matches on tags and Call-ID. An anonymous From is left as it is.
|
|
34
34
|
*
|
|
35
|
+
* To moves to the Trunk URI's host and port, so it matches the Request-URI
|
|
36
|
+
* (RFC 3261 section 8.1.1.1): WhatsApp Business Calling answers 403 when the
|
|
37
|
+
* digest uri, the Request-URI, differs from To. Its user stays as
|
|
38
|
+
* normalizeToE164 left it, and an anonymous From doesn't change that.
|
|
39
|
+
*
|
|
35
40
|
* @param {Route} route - the route; does nothing unless route.rewriteFrom is set
|
|
36
41
|
* @return {Function} the alteration
|
|
37
42
|
*/
|
package/dist/alterations.js
CHANGED
|
@@ -349,15 +349,23 @@ exports.isAnonymous = isAnonymous;
|
|
|
349
349
|
* domain. The tag and display name stay, so the dialog is unchanged for Routr,
|
|
350
350
|
* which matches on tags and Call-ID. An anonymous From is left as it is.
|
|
351
351
|
*
|
|
352
|
+
* To moves to the Trunk URI's host and port, so it matches the Request-URI
|
|
353
|
+
* (RFC 3261 section 8.1.1.1): WhatsApp Business Calling answers 403 when the
|
|
354
|
+
* digest uri, the Request-URI, differs from To. Its user stays as
|
|
355
|
+
* normalizeToE164 left it, and an anonymous From doesn't change that.
|
|
356
|
+
*
|
|
352
357
|
* @param {Route} route - the route; does nothing unless route.rewriteFrom is set
|
|
353
358
|
* @return {Function} the alteration
|
|
354
359
|
*/
|
|
355
360
|
const rewriteFromWithNumber = (route) => (request) => {
|
|
356
361
|
if (!route.rewriteFrom)
|
|
357
362
|
return request;
|
|
358
|
-
if ((0, exports.isAnonymous)(request.message.from.address.uri))
|
|
359
|
-
return request;
|
|
360
363
|
const req = common_1.Helper.deepCopy(request);
|
|
364
|
+
const to = req.message.to.address.uri;
|
|
365
|
+
to.host = route.host;
|
|
366
|
+
to.port = route.port;
|
|
367
|
+
if ((0, exports.isAnonymous)(req.message.from.address.uri))
|
|
368
|
+
return req;
|
|
361
369
|
const uri = req.message.from.address.uri;
|
|
362
370
|
uri.user = route.rewriteFrom.user;
|
|
363
371
|
uri.host = route.rewriteFrom.host;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/processor",
|
|
3
|
-
"version": "2.31.
|
|
3
|
+
"version": "2.31.6",
|
|
4
4
|
"description": "Processor server and API",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@fonoster/logger": "0.6.0",
|
|
16
16
|
"@grpc/grpc-js": "~1.14.6",
|
|
17
17
|
"@grpc/proto-loader": "~0.7.10",
|
|
18
|
-
"@routr/common": "^2.31.
|
|
18
|
+
"@routr/common": "^2.31.6",
|
|
19
19
|
"fp-ts": "^2.11.8",
|
|
20
20
|
"phone": "^3.1.68"
|
|
21
21
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"bugs": {
|
|
37
37
|
"url": "https://github.com/fonoster/routr/issues"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "6b8037538e00b4465bafc9b57118a79b82b56e41"
|
|
40
40
|
}
|