@bitcall/webrtc-sip-gateway 0.2.3 → 0.2.4

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 CHANGED
@@ -5,7 +5,7 @@ Linux-only CLI to install and operate the Bitcall WebRTC-to-SIP gateway.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- sudo npm i -g @bitcall/webrtc-sip-gateway@0.2.3
8
+ sudo npm i -g @bitcall/webrtc-sip-gateway@0.2.4
9
9
  ```
10
10
 
11
11
  ## Main workflow
@@ -16,6 +16,9 @@ sudo bitcall-gateway status
16
16
  sudo bitcall-gateway logs -f
17
17
  ```
18
18
 
19
+ Default media policy is IPv4-only candidates (`MEDIA_IPV6=0`). Set
20
+ `MEDIA_IPV6=1` in `/opt/bitcall-gateway/.env` only if you want IPv6 candidates.
21
+
19
22
  ## Commands
20
23
 
21
24
  - `sudo bitcall-gateway init`
package/lib/constants.js CHANGED
@@ -14,7 +14,7 @@ module.exports = {
14
14
  SSL_DIR: path.join(GATEWAY_DIR, "ssl"),
15
15
  ENV_PATH: path.join(GATEWAY_DIR, ".env"),
16
16
  COMPOSE_PATH: path.join(GATEWAY_DIR, "docker-compose.yml"),
17
- DEFAULT_GATEWAY_IMAGE: "ghcr.io/bitcallio/webrtc-sip-gateway:0.2.3",
17
+ DEFAULT_GATEWAY_IMAGE: "ghcr.io/bitcallio/webrtc-sip-gateway:0.2.4",
18
18
  DEFAULT_PROVIDER_HOST: "sip.example.com",
19
19
  DEFAULT_WEBPHONE_ORIGIN: "*",
20
20
  RENEW_HOOK_PATH: "/etc/letsencrypt/renewal-hooks/deploy/bitcall-gateway.sh",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitcall/webrtc-sip-gateway",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Linux CLI for bootstrapping and managing the Bitcall WebRTC-to-SIP Gateway",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.js CHANGED
@@ -34,7 +34,7 @@ const {
34
34
  } = require("../lib/system");
35
35
  const { readTemplate, renderTemplate } = require("../lib/template");
36
36
 
37
- const PACKAGE_VERSION = "0.2.3";
37
+ const PACKAGE_VERSION = "0.2.4";
38
38
 
39
39
  function detectComposeCommand() {
40
40
  if (run("docker", ["compose", "version"], { check: false }).status === 0) {
@@ -103,6 +103,7 @@ function envOrder() {
103
103
  "WSS_LISTEN_PORT",
104
104
  "INTERNAL_WSS_PORT",
105
105
  "INTERNAL_WS_PORT",
106
+ "MEDIA_IPV6",
106
107
  "RTPENGINE_MIN_PORT",
107
108
  "RTPENGINE_MAX_PORT",
108
109
  "WITH_REVERSE_PROXY",
@@ -468,6 +469,11 @@ async function runWizard(existing = {}, preflight = {}) {
468
469
  existing.WEBPHONE_ORIGIN || DEFAULT_WEBPHONE_ORIGIN
469
470
  );
470
471
 
472
+ const mediaIpv6Enabled = await prompt.askYesNo(
473
+ "Enable IPv6 media candidates? (default: No)",
474
+ existing.MEDIA_IPV6 === "1"
475
+ );
476
+
471
477
  const configureUfw = await prompt.askYesNo("Configure ufw firewall rules now", true);
472
478
 
473
479
  const config = {
@@ -492,6 +498,7 @@ async function runWizard(existing = {}, preflight = {}) {
492
498
  turnExternalUsername,
493
499
  turnExternalCredential,
494
500
  webphoneOrigin,
501
+ mediaIpv6: mediaIpv6Enabled ? "1" : "0",
495
502
  rtpMin: "10000",
496
503
  rtpMax: "20000",
497
504
  acmeListenPort: deployMode === "reverse-proxy" ? "8080" : "80",
@@ -509,6 +516,7 @@ async function runWizard(existing = {}, preflight = {}) {
509
516
  console.log(` SIP provider URI: ${config.sipProviderUri}`);
510
517
  console.log(` Allowed SIP domains: ${config.allowedDomains || "(empty/dev-mode)"}`);
511
518
  console.log(` TURN mode: ${config.turnMode}`);
519
+ console.log(` IPv6 media candidates: ${config.mediaIpv6 === "1" ? "enabled" : "disabled (IPv4-only)"}`);
512
520
 
513
521
  const proceed = await prompt.askYesNo("Proceed with provisioning", true);
514
522
  if (!proceed) {
@@ -557,6 +565,7 @@ function renderEnvContent(config, tlsCert, tlsKey) {
557
565
  WSS_LISTEN_PORT: config.wssListenPort,
558
566
  INTERNAL_WSS_PORT: config.internalWssPort,
559
567
  INTERNAL_WS_PORT: config.internalWsPort,
568
+ MEDIA_IPV6: config.mediaIpv6,
560
569
  });
561
570
 
562
571
  let extra = "";
@@ -772,6 +781,7 @@ function statusCommand() {
772
781
  console.log(`Port ${envMap.WSS_LISTEN_PORT || "443"}: ${formatMark(p443.inUse)} listening`);
773
782
  console.log(`Port 5060: ${formatMark(p5060.inUse)} listening`);
774
783
  console.log(`rtpengine control: ${formatMark(rtpReady)} reachable`);
784
+ console.log(`IPv6 media candidates: ${(envMap.MEDIA_IPV6 || "0") === "1" ? "enabled" : "disabled (IPv4-only)"}`);
775
785
  if (envMap.TURN_MODE && envMap.TURN_MODE !== "none") {
776
786
  console.log(`/turn-credentials: ${formatMark(turnReady)} reachable`);
777
787
  }
@@ -789,6 +799,7 @@ function statusCommand() {
789
799
  console.log(`DEPLOY_MODE=${envMap.DEPLOY_MODE || ""}`);
790
800
  console.log(`ALLOWED_SIP_DOMAINS=${envMap.ALLOWED_SIP_DOMAINS || ""}`);
791
801
  console.log(`TURN_MODE=${envMap.TURN_MODE || "none"}`);
802
+ console.log(`MEDIA_IPV6=${envMap.MEDIA_IPV6 || "0"}`);
792
803
  }
793
804
 
794
805
  function certStatusCommand() {
@@ -23,3 +23,4 @@ ACME_LISTEN_PORT=__ACME_LISTEN_PORT__
23
23
  WSS_LISTEN_PORT=__WSS_LISTEN_PORT__
24
24
  INTERNAL_WSS_PORT=__INTERNAL_WSS_PORT__
25
25
  INTERNAL_WS_PORT=__INTERNAL_WS_PORT__
26
+ MEDIA_IPV6=__MEDIA_IPV6__
@@ -10,6 +10,8 @@ services:
10
10
  security_opt:
11
11
  - no-new-privileges:true
12
12
  env_file: .env
13
+ environment:
14
+ - MEDIA_IPV6=${MEDIA_IPV6:-0}
13
15
  volumes:
14
16
  - ${TLS_CERT}:/etc/ssl/cert.pem:ro
15
17
  - ${TLS_KEY}:/etc/ssl/key.pem:ro