@routr/rtprelay 2.13.9 → 2.13.12
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/client.js +4 -5
- package/dist/service.js +19 -9
- package/dist/tracer.js +1 -2
- package/dist/types.js +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +5 -5
- package/package.json +4 -4
package/dist/client.js
CHANGED
|
@@ -9,7 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.query = query;
|
|
13
|
+
exports.offer = offer;
|
|
14
|
+
exports.answer = answer;
|
|
15
|
+
exports.del = del;
|
|
13
16
|
const envs_1 = require("./envs");
|
|
14
17
|
const utils_1 = require("./utils");
|
|
15
18
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
@@ -22,7 +25,6 @@ function query(config) {
|
|
|
22
25
|
});
|
|
23
26
|
});
|
|
24
27
|
}
|
|
25
|
-
exports.query = query;
|
|
26
28
|
function offer(config, invertTags = false) {
|
|
27
29
|
return (request) => __awaiter(this, void 0, void 0, function* () {
|
|
28
30
|
const direction = (0, utils_1.getDirectionFromRequest)(request);
|
|
@@ -30,7 +32,6 @@ function offer(config, invertTags = false) {
|
|
|
30
32
|
return yield rtpe.offer(config, Object.assign(Object.assign({}, sdpModifiers), { sdp: request.message.body, "call-id": request.message.callId.callId, "from-tag": invertTags ? request.message.to.tag : request.message.from.tag }));
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
exports.offer = offer;
|
|
34
35
|
function answer(config, invertTags = false) {
|
|
35
36
|
return (request) => __awaiter(this, void 0, void 0, function* () {
|
|
36
37
|
const direction = (0, utils_1.getDirectionFromResponse)(request);
|
|
@@ -40,7 +41,6 @@ function answer(config, invertTags = false) {
|
|
|
40
41
|
: request.message.from.tag, "to-tag": invertTags ? request.message.from.tag : request.message.to.tag }));
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
|
-
exports.answer = answer;
|
|
44
44
|
function del(config) {
|
|
45
45
|
return (request) => __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
return yield rtpe.delete(config, {
|
|
@@ -49,4 +49,3 @@ function del(config) {
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
exports.del = del;
|
package/dist/service.js
CHANGED
|
@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
16
16
|
}) : function(o, v) {
|
|
17
17
|
o["default"] = v;
|
|
18
18
|
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
26
36
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
37
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
38
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -33,6 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
33
43
|
});
|
|
34
44
|
};
|
|
35
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.default = rtprelay;
|
|
36
47
|
/*
|
|
37
48
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
38
49
|
* http://github.com/fonoster/routr
|
|
@@ -78,7 +89,7 @@ function rtprelay(bindAddr, rtpeConfig) {
|
|
|
78
89
|
const direction = processor_1.Helper.isTypeResponse(req)
|
|
79
90
|
? (0, utils_1.getDirectionFromResponse)(req)
|
|
80
91
|
: (0, utils_1.getDirectionFromRequest)(req);
|
|
81
|
-
const sendRequest = (
|
|
92
|
+
const sendRequest = (f_1, ...args_1) => __awaiter(this, [f_1, ...args_1], void 0, function* (f, invertTags = false) {
|
|
82
93
|
const r = yield f(rtpeConfig, invertTags)(req);
|
|
83
94
|
if (r.result === "error") {
|
|
84
95
|
throw new common_1.CommonErrors.BadRequestError(r["error-reason"]);
|
|
@@ -121,4 +132,3 @@ function rtprelay(bindAddr, rtpeConfig) {
|
|
|
121
132
|
}
|
|
122
133
|
}));
|
|
123
134
|
}
|
|
124
|
-
exports.default = rtprelay;
|
package/dist/tracer.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.init =
|
|
6
|
+
exports.init = init;
|
|
7
7
|
/*
|
|
8
8
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/routr
|
|
@@ -50,4 +50,3 @@ function init(serviceName) {
|
|
|
50
50
|
});
|
|
51
51
|
return api_1.default.trace.getTracer("routr-tracer");
|
|
52
52
|
}
|
|
53
|
-
exports.init = init;
|
package/dist/types.js
CHANGED
|
@@ -25,4 +25,4 @@ var Direction;
|
|
|
25
25
|
Direction["WEB_TO_PHONE"] = "web-to-phone";
|
|
26
26
|
Direction["PHONE_TO_WEB"] = "phone-to-web";
|
|
27
27
|
Direction["PHONE_TO_PHONE"] = "phone-to-phone";
|
|
28
|
-
})(Direction
|
|
28
|
+
})(Direction || (exports.Direction = Direction = {}));
|
package/dist/utils.d.ts
CHANGED
|
@@ -22,5 +22,5 @@ export declare function getRTPEParamsByDirection(dir: Direction): {
|
|
|
22
22
|
SDES: string[];
|
|
23
23
|
flags: string[];
|
|
24
24
|
};
|
|
25
|
-
export declare const callInvolvesWebRTC: (direction: Direction) =>
|
|
25
|
+
export declare const callInvolvesWebRTC: (direction: Direction) => direction is Direction.WEB_TO_PHONE | Direction.PHONE_TO_WEB;
|
|
26
26
|
export declare const shouldNotHandleRequest: (req: MessageRequest) => boolean;
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shouldNotHandleRequest = exports.callInvolvesWebRTC =
|
|
3
|
+
exports.shouldNotHandleRequest = exports.callInvolvesWebRTC = void 0;
|
|
4
|
+
exports.getDirectionFromResponse = getDirectionFromResponse;
|
|
5
|
+
exports.getDirectionFromRequest = getDirectionFromRequest;
|
|
6
|
+
exports.getDirection = getDirection;
|
|
7
|
+
exports.getRTPEParamsByDirection = getRTPEParamsByDirection;
|
|
4
8
|
const processor_1 = require("@routr/processor");
|
|
5
9
|
const types_1 = require("./types");
|
|
6
10
|
function getDirectionFromResponse(request) {
|
|
@@ -8,7 +12,6 @@ function getDirectionFromResponse(request) {
|
|
|
8
12
|
const dstTransport = request.message.via[0].transport;
|
|
9
13
|
return getDirection(srcTransport, dstTransport);
|
|
10
14
|
}
|
|
11
|
-
exports.getDirectionFromResponse = getDirectionFromResponse;
|
|
12
15
|
// Will should be able to determine the direction with Request-URI and Route header
|
|
13
16
|
// WARNING: Seems like a duplicated code
|
|
14
17
|
function getDirectionFromRequest(request) {
|
|
@@ -16,7 +19,6 @@ function getDirectionFromRequest(request) {
|
|
|
16
19
|
const dstTransport = request.message.via[0].transport;
|
|
17
20
|
return getDirection(srcTransport, dstTransport);
|
|
18
21
|
}
|
|
19
|
-
exports.getDirectionFromRequest = getDirectionFromRequest;
|
|
20
22
|
function getDirection(srcTransport, dstTransport) {
|
|
21
23
|
if (processor_1.Helper.isWebRTC(srcTransport) && processor_1.Helper.isWebRTC(dstTransport)) {
|
|
22
24
|
return types_1.Direction.WEB_TO_WEB;
|
|
@@ -29,7 +31,6 @@ function getDirection(srcTransport, dstTransport) {
|
|
|
29
31
|
}
|
|
30
32
|
return types_1.Direction.PHONE_TO_PHONE;
|
|
31
33
|
}
|
|
32
|
-
exports.getDirection = getDirection;
|
|
33
34
|
function getRTPEParamsByDirection(dir) {
|
|
34
35
|
switch (dir) {
|
|
35
36
|
case types_1.Direction.WEB_TO_WEB:
|
|
@@ -67,7 +68,6 @@ function getRTPEParamsByDirection(dir) {
|
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
exports.getRTPEParamsByDirection = getRTPEParamsByDirection;
|
|
71
71
|
const callInvolvesWebRTC = (direction) => direction == types_1.Direction.WEB_TO_PHONE || direction == types_1.Direction.PHONE_TO_WEB;
|
|
72
72
|
exports.callInvolvesWebRTC = callInvolvesWebRTC;
|
|
73
73
|
const shouldNotHandleRequest = (req) => !(processor_1.Helper.isInviteOrAckWithSDP(req) ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/rtprelay",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.12",
|
|
4
4
|
"description": "Media Relay for Routr using RTPengine",
|
|
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-base": "^1.0.4",
|
|
30
30
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
31
31
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
32
|
-
"@routr/common": "^2.13.
|
|
33
|
-
"@routr/processor": "^2.13.
|
|
32
|
+
"@routr/common": "^2.13.12",
|
|
33
|
+
"@routr/processor": "^2.13.12",
|
|
34
34
|
"rtpengine-client": "^0.4.11"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"bugs": {
|
|
47
47
|
"url": "https://github.com/fonoster/routr/issues"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9a1e9245707e8da5a9c3817cc24d46f63cccaf10"
|
|
50
50
|
}
|