@routr/edgeport 2.0.7-alpha.0 → 2.0.8-alpha.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.
- package/dist/config/schema.js +2 -2
- package/dist/create_listening_points.js +3 -3
- package/dist/create_sip_provider.js +2 -3
- package/dist/create_sip_stack.d.ts +4 -2
- package/dist/create_sip_stack.js +2 -7
- package/dist/server_properties.d.ts +4 -2
- package/dist/server_properties.js +21 -20
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/config/schema.js
CHANGED
|
@@ -62,7 +62,7 @@ exports.schema = {
|
|
|
62
62
|
type: "string"
|
|
63
63
|
},
|
|
64
64
|
uniqueItems: true,
|
|
65
|
-
minItems:
|
|
65
|
+
minItems: 0
|
|
66
66
|
},
|
|
67
67
|
localnets: {
|
|
68
68
|
description: "Networks considered to be in the same local network",
|
|
@@ -71,7 +71,7 @@ exports.schema = {
|
|
|
71
71
|
type: "string"
|
|
72
72
|
},
|
|
73
73
|
uniqueItems: true,
|
|
74
|
-
minItems:
|
|
74
|
+
minItems: 0
|
|
75
75
|
},
|
|
76
76
|
methods: {
|
|
77
77
|
description: "Acceptable SIP Methods",
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
* @return {ListeningPoint[]}
|
|
9
9
|
*/
|
|
10
10
|
function createListeningPoints(sipStack, config) {
|
|
11
|
+
var _a;
|
|
11
12
|
const listeningPoints = [];
|
|
12
|
-
|
|
13
|
-
for (const trans of config.spec.transport) {
|
|
13
|
+
(_a = config.spec.transport) === null || _a === void 0 ? void 0 : _a.forEach((trans) => {
|
|
14
14
|
const proto = trans.protocol.toLowerCase();
|
|
15
15
|
// If none was found we use the global bindAddr
|
|
16
16
|
if (trans.bindAddr === undefined) {
|
|
@@ -23,7 +23,7 @@ function createListeningPoints(sipStack, config) {
|
|
|
23
23
|
catch (e) {
|
|
24
24
|
throw new Error(`unable to bind ${proto}://${trans.bindAddr}:${trans.port}`);
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
});
|
|
27
27
|
return listeningPoints;
|
|
28
28
|
}
|
|
29
29
|
exports.default = createListeningPoints;
|
|
@@ -9,10 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
*/
|
|
10
10
|
function createSipProvider(sipStack, listeningPoints) {
|
|
11
11
|
const sipProvider = sipStack.createSipProvider(listeningPoints[0]);
|
|
12
|
-
|
|
13
|
-
for (const lp1 of listeningPoints === null || listeningPoints === void 0 ? void 0 : listeningPoints.filter((lp, index) => index > 0)) {
|
|
12
|
+
listeningPoints === null || listeningPoints === void 0 ? void 0 : listeningPoints.filter((_, index) => index > 0).forEach((lp1) => {
|
|
14
13
|
sipProvider.addListeningPoint(lp1);
|
|
15
|
-
}
|
|
14
|
+
});
|
|
16
15
|
return sipProvider;
|
|
17
16
|
}
|
|
18
17
|
exports.default = createSipProvider;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SipStack } from "./types";
|
|
2
|
+
declare const Properties: any;
|
|
2
3
|
/**
|
|
3
4
|
* Takes a properties map and returns an instance of the SipStack(Java object).
|
|
4
5
|
*
|
|
5
|
-
* @param {
|
|
6
|
+
* @param {Properties} properties - Properties map
|
|
6
7
|
* @return {SipStack}
|
|
7
8
|
*/
|
|
8
|
-
export default function createSipStack(
|
|
9
|
+
export default function createSipStack(properties: typeof Properties): SipStack;
|
|
10
|
+
export {};
|
package/dist/create_sip_stack.js
CHANGED
|
@@ -5,15 +5,10 @@ const Properties = Java.type("java.util.Properties");
|
|
|
5
5
|
/**
|
|
6
6
|
* Takes a properties map and returns an instance of the SipStack(Java object).
|
|
7
7
|
*
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {Properties} properties - Properties map
|
|
9
9
|
* @return {SipStack}
|
|
10
10
|
*/
|
|
11
|
-
function createSipStack(
|
|
12
|
-
const properties = new Properties();
|
|
13
|
-
// eslint-disable-next-line no-loops/no-loops
|
|
14
|
-
for (const entry of props) {
|
|
15
|
-
properties.setProperty(entry[0], entry[1]);
|
|
16
|
-
}
|
|
11
|
+
function createSipStack(properties) {
|
|
17
12
|
const sipFactory = SipFactory.getInstance();
|
|
18
13
|
sipFactory.setPathName("gov.nist");
|
|
19
14
|
return sipFactory.createSipStack(properties);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { EdgePortConfig } from "./types";
|
|
2
|
+
declare const Properties: any;
|
|
2
3
|
/**
|
|
3
4
|
* Returns a Map object with the properties for the server's SipStack.
|
|
4
5
|
* For more options see:
|
|
5
6
|
* https://github.com/RestComm/jain-sip/blob/master/src/gov/nist/javax/sip/SipStackImpl.java
|
|
6
7
|
*
|
|
7
8
|
* @param {EdgePortConfig} config - Configuration object
|
|
8
|
-
* @return {
|
|
9
|
+
* @return {Properties}
|
|
9
10
|
*/
|
|
10
|
-
export default function getServerProperties(config: EdgePortConfig):
|
|
11
|
+
export default function getServerProperties(config: EdgePortConfig): typeof Properties;
|
|
12
|
+
export {};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Properties = Java.type("java.util.Properties");
|
|
3
4
|
/**
|
|
4
5
|
* Returns a Map object with the properties for the server's SipStack.
|
|
5
6
|
* For more options see:
|
|
6
7
|
* https://github.com/RestComm/jain-sip/blob/master/src/gov/nist/javax/sip/SipStackImpl.java
|
|
7
8
|
*
|
|
8
9
|
* @param {EdgePortConfig} config - Configuration object
|
|
9
|
-
* @return {
|
|
10
|
+
* @return {Properties}
|
|
10
11
|
*/
|
|
11
12
|
function getServerProperties(config) {
|
|
12
13
|
var _a, _b;
|
|
13
|
-
const properties = new
|
|
14
|
-
properties.
|
|
15
|
-
properties.
|
|
16
|
-
properties.
|
|
17
|
-
properties.
|
|
18
|
-
properties.
|
|
19
|
-
properties.
|
|
20
|
-
properties.
|
|
21
|
-
properties.
|
|
14
|
+
const properties = new Properties();
|
|
15
|
+
properties.setProperty("javax.sip.STACK_NAME", "routr");
|
|
16
|
+
properties.setProperty("javax.sip.AUTOMATIC_DIALOG_SUPPORT", "OFF");
|
|
17
|
+
properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", "gov.nist.javax.sip.stack.NioMessageProcessorFactory");
|
|
18
|
+
properties.setProperty("gov.nist.javax.sip.PATCH_SIP_WEBSOCKETS_HEADERS", "false");
|
|
19
|
+
properties.setProperty("gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "true");
|
|
20
|
+
properties.setProperty("gov.nist.javax.sip.REENTRANT_LISTENER", "false");
|
|
21
|
+
properties.setProperty("gov.nist.javax.sip.THREAD_POOL_SIZE", "16");
|
|
22
|
+
properties.setProperty("gov.nist.javax.sip.NIO_BLOCKING_MODE", "NONBLOCKING");
|
|
22
23
|
// Guard against denial of service attack.
|
|
23
|
-
properties.
|
|
24
|
-
properties.
|
|
24
|
+
properties.setProperty("gov.nist.javax.sip.MAX_MESSAGE_SIZE", "1048576");
|
|
25
|
+
properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true");
|
|
25
26
|
// Default host
|
|
26
|
-
properties.
|
|
27
|
+
properties.setProperty("javax.sip.IP_ADDRESS", config.spec.bindAddr);
|
|
27
28
|
if (config.spec.securityContext) {
|
|
28
|
-
properties.
|
|
29
|
+
properties.setProperty("gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS", (_a = config.spec.securityContext.client) === null || _a === void 0 ? void 0 : _a.protocols.join());
|
|
29
30
|
// This must be set to 'Disabled' when using WSS
|
|
30
|
-
properties.
|
|
31
|
-
properties.
|
|
32
|
-
properties.
|
|
33
|
-
properties.
|
|
34
|
-
properties.
|
|
35
|
-
properties.
|
|
31
|
+
properties.setProperty("gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE", (_b = config.spec.securityContext.client) === null || _b === void 0 ? void 0 : _b.authType);
|
|
32
|
+
properties.setProperty("javax.net.ssl.keyStore", config.spec.securityContext.keyStore);
|
|
33
|
+
properties.setProperty("javax.net.ssl.trustStore", config.spec.securityContext.trustStore);
|
|
34
|
+
properties.setProperty("javax.net.ssl.keyStorePassword", config.spec.securityContext.keyStorePassword);
|
|
35
|
+
properties.setProperty("javax.net.ssl.trustStorePassword", config.spec.securityContext.trustStorePassword);
|
|
36
|
+
properties.setProperty("javax.net.ssl.keyStoreType", config.spec.securityContext.keyStoreType);
|
|
36
37
|
}
|
|
37
38
|
return properties;
|
|
38
39
|
}
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/edgeport",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8-alpha.1",
|
|
4
4
|
"description": "SIP endpoint at the edge of the network",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"fp-ts": "^2.11.8"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "0824e725362fae3df83467f0f8989a2e4fa1f794"
|
|
35
35
|
}
|