@routr/processor 2.16.0 → 2.18.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/README.md +1 -1
- package/dist/target.d.ts +2 -1
- package/dist/target.js +9 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<a href="https://
|
|
1
|
+
<a href="https://docs.routr.io/guides/develop-with-dev-containers"> <img src="https://img.shields.io/badge/Contribute%20with-Dev%20Containers-908a85?logo=docker" alt="Contribute with Dev Containers" />
|
|
2
2
|
|
|
3
3
|
This module is part of the [Routr](https://routr.io) project. By itself, it does not do much. It is intended to be used as a dependency for other modules. For more information about the project, please visit [https://github.com/fonoster/routr](https://github.com/fonoster/routr).
|
package/dist/target.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import { MessageRequest } from "@routr/common";
|
|
|
2
2
|
import { CommonTypes as CT } from "@routr/common";
|
|
3
3
|
export declare const getAOR: (uri: CT.SipURI) => string;
|
|
4
4
|
export declare const getTargetAOR: (request: MessageRequest) => string;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const DEFAULT_EXPIRES = 3600;
|
|
6
|
+
export declare const getTargetExpires: (request: MessageRequest, defaultExpires?: number) => number;
|
package/dist/target.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTargetExpires = exports.getTargetAOR = exports.getAOR = void 0;
|
|
3
|
+
exports.getTargetExpires = exports.DEFAULT_EXPIRES = exports.getTargetAOR = exports.getAOR = void 0;
|
|
4
4
|
const getAOR = (uri) => `${uri.secure ? "sips" : "sip"}:${uri.user ? uri.user + "@" : ""}${uri.host}`;
|
|
5
5
|
exports.getAOR = getAOR;
|
|
6
6
|
const getTargetAOR = (request) => (0, exports.getAOR)(request.message.to.address.uri);
|
|
7
7
|
exports.getTargetAOR = getTargetAOR;
|
|
8
|
-
|
|
8
|
+
// Used when a REGISTER carries neither a Contact expires parameter nor an
|
|
9
|
+
// Expires header (RFC 3261 section 10.3, step 7)
|
|
10
|
+
exports.DEFAULT_EXPIRES = 3600;
|
|
11
|
+
const getTargetExpires = (request, defaultExpires = exports.DEFAULT_EXPIRES) => {
|
|
9
12
|
var _a, _b, _c, _d, _e;
|
|
10
13
|
// The expires value in the Contact header takes presendence over the value
|
|
11
14
|
// on the Expires header
|
|
12
15
|
const expires = (_c = (_b = (_a = request.message) === null || _a === void 0 ? void 0 : _a.contact) === null || _b === void 0 ? void 0 : _b.expires) !== null && _c !== void 0 ? _c : -1;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
if (expires > -1)
|
|
17
|
+
return expires;
|
|
18
|
+
const headerExpires = (_e = (_d = request.message.expires) === null || _d === void 0 ? void 0 : _d.expires) !== null && _e !== void 0 ? _e : -1;
|
|
19
|
+
return headerExpires > -1 ? headerExpires : defaultExpires;
|
|
16
20
|
};
|
|
17
21
|
exports.getTargetExpires = getTargetExpires;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/processor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
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.
|
|
18
|
+
"@routr/common": "^2.17.0",
|
|
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": "53d48803760e0d8d6af1efa63db2414594d79454"
|
|
40
40
|
}
|