@routr/location 2.0.25 → 2.0.32
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/helper.js +7 -0
- package/package.json +4 -4
package/dist/helper.js
CHANGED
|
@@ -12,6 +12,7 @@ const processor_1 = require("@routr/processor");
|
|
|
12
12
|
// and https://github.com/fonoster/routr/blob/ee5d339888344013939d06c734385f17f0cd75c2/mod/registrar/utils.js#L131
|
|
13
13
|
function buildRoute(request, uri) {
|
|
14
14
|
var _a;
|
|
15
|
+
const via = request.message.via[0];
|
|
15
16
|
const sessionCount = processor_1.Extensions.getHeaderValue(request, common_1.CommonTypes.ExtraHeader.SESSION_COUNT)
|
|
16
17
|
? parseInt(processor_1.Extensions.getHeaderValue(request, common_1.CommonTypes.ExtraHeader.SESSION_COUNT))
|
|
17
18
|
: -1;
|
|
@@ -20,6 +21,8 @@ function buildRoute(request, uri) {
|
|
|
20
21
|
user: uri.user,
|
|
21
22
|
host: uri.host,
|
|
22
23
|
port: uri.port,
|
|
24
|
+
advertisedHost: via.host,
|
|
25
|
+
advertisedPort: via.port,
|
|
23
26
|
transport: (_a = uri.transportParam) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
24
27
|
registeredOn: Date.now(),
|
|
25
28
|
sessionCount,
|
|
@@ -49,6 +52,10 @@ exports.createRoute = createRoute;
|
|
|
49
52
|
*/
|
|
50
53
|
function createRouteFromLastMessage(request) {
|
|
51
54
|
const uri = request.message.requestUri;
|
|
55
|
+
const via = request.message.via[0];
|
|
56
|
+
// WARNING: Temporary to avoid defaulting to UDP
|
|
57
|
+
// Please see SipURIConverter.java for more details
|
|
58
|
+
uri.transportParam = via.transport.toUpperCase();
|
|
52
59
|
return buildRoute(request, uri);
|
|
53
60
|
}
|
|
54
61
|
exports.createRouteFromLastMessage = createRouteFromLastMessage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/location",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"description": "Creates and maintains a list of routes to all registered endpoints",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
|
36
36
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
37
37
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
38
|
-
"@routr/common": "^2.0.
|
|
39
|
-
"@routr/processor": "^2.0.
|
|
38
|
+
"@routr/common": "^2.0.31",
|
|
39
|
+
"@routr/processor": "^2.0.31",
|
|
40
40
|
"ajv": "^6.12.6",
|
|
41
41
|
"fp-ts": "^2.11.8",
|
|
42
42
|
"redis": "^4.0.4"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"bugs": {
|
|
49
49
|
"url": "https://github.com/fonoster/routr/issues"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "a460ed44d9bca57f59f2a460f8f0ec7afb9fd56d"
|
|
52
52
|
}
|