@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.
@@ -62,7 +62,7 @@ exports.schema = {
62
62
  type: "string"
63
63
  },
64
64
  uniqueItems: true,
65
- minItems: 1
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: 1
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
- // eslint-disable-next-line no-loops/no-loops
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
- // eslint-disable-next-line no-loops/no-loops
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 {Map<string, string>} props - Properties map
6
+ * @param {Properties} properties - Properties map
6
7
  * @return {SipStack}
7
8
  */
8
- export default function createSipStack(props: Map<string, string>): SipStack;
9
+ export default function createSipStack(properties: typeof Properties): SipStack;
10
+ export {};
@@ -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 {Map<string, string>} props - Properties map
8
+ * @param {Properties} properties - Properties map
9
9
  * @return {SipStack}
10
10
  */
11
- function createSipStack(props) {
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 {Map<string, string>}
9
+ * @return {Properties}
9
10
  */
10
- export default function getServerProperties(config: EdgePortConfig): Map<string, string>;
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 {Map<string, string>}
10
+ * @return {Properties}
10
11
  */
11
12
  function getServerProperties(config) {
12
13
  var _a, _b;
13
- const properties = new Map();
14
- properties.set("javax.sip.STACK_NAME", "routr");
15
- properties.set("javax.sip.AUTOMATIC_DIALOG_SUPPORT", "OFF");
16
- properties.set("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", "gov.nist.javax.sip.stack.NioMessageProcessorFactory");
17
- properties.set("gov.nist.javax.sip.PATCH_SIP_WEBSOCKETS_HEADERS", "false");
18
- properties.set("gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "true");
19
- properties.set("gov.nist.javax.sip.REENTRANT_LISTENER", "false");
20
- properties.set("gov.nist.javax.sip.THREAD_POOL_SIZE", "16");
21
- properties.set("gov.nist.javax.sip.NIO_BLOCKING_MODE", "NONBLOCKING");
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.set("gov.nist.javax.sip.MAX_MESSAGE_SIZE", "1048576");
24
- properties.set("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true");
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.set("javax.sip.IP_ADDRESS", config.spec.bindAddr);
27
+ properties.setProperty("javax.sip.IP_ADDRESS", config.spec.bindAddr);
27
28
  if (config.spec.securityContext) {
28
- properties.set("gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS", (_a = config.spec.securityContext.client) === null || _a === void 0 ? void 0 : _a.protocols.join());
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.set("gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE", (_b = config.spec.securityContext.client) === null || _b === void 0 ? void 0 : _b.authType);
31
- properties.set("javax.net.ssl.keyStore", config.spec.securityContext.keyStore);
32
- properties.set("javax.net.ssl.trustStore", config.spec.securityContext.trustStore);
33
- properties.set("javax.net.ssl.keyStorePassword", config.spec.securityContext.keyStorePassword);
34
- properties.set("javax.net.ssl.trustStorePassword", config.spec.securityContext.trustStorePassword);
35
- properties.set("javax.net.ssl.keyStoreType", config.spec.securityContext.keyStoreType);
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
@@ -10,7 +10,7 @@ export interface EdgePortConfig {
10
10
  processor: {
11
11
  addr: string;
12
12
  };
13
- externalAddrs: string[];
13
+ externalAddrs?: string[];
14
14
  localnets: string[];
15
15
  securityContext?: {
16
16
  debugging: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/edgeport",
3
- "version": "2.0.7-alpha.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": "1c08d04c570d1fa156729a8f61e43c3c51b68f96"
34
+ "gitHead": "0824e725362fae3df83467f0f8989a2e4fa1f794"
35
35
  }