@bitcall/webrtc-sip-gateway 0.2.3 → 0.2.5

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.5
9
9
  ```
10
10
 
11
11
  ## Main workflow
@@ -16,6 +16,11 @@ sudo bitcall-gateway status
16
16
  sudo bitcall-gateway logs -f
17
17
  ```
18
18
 
19
+ Default media policy is IPv4-only (`MEDIA_IPV6=0` and `MEDIA_FORCE_IPV4=1`),
20
+ including IPv6 candidate stripping on SIP->WebRTC SDP. Set `MEDIA_IPV6=1`
21
+ and `MEDIA_FORCE_IPV4=0` in `/opt/bitcall-gateway/.env` only if you want
22
+ IPv6 candidates.
23
+
19
24
  ## Commands
20
25
 
21
26
  - `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.5",
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.5",
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.5";
38
38
 
39
39
  function detectComposeCommand() {
40
40
  if (run("docker", ["compose", "version"], { check: false }).status === 0) {
@@ -103,6 +103,8 @@ function envOrder() {
103
103
  "WSS_LISTEN_PORT",
104
104
  "INTERNAL_WSS_PORT",
105
105
  "INTERNAL_WS_PORT",
106
+ "MEDIA_IPV6",
107
+ "MEDIA_FORCE_IPV4",
106
108
  "RTPENGINE_MIN_PORT",
107
109
  "RTPENGINE_MAX_PORT",
108
110
  "WITH_REVERSE_PROXY",
@@ -468,6 +470,18 @@ async function runWizard(existing = {}, preflight = {}) {
468
470
  existing.WEBPHONE_ORIGIN || DEFAULT_WEBPHONE_ORIGIN
469
471
  );
470
472
 
473
+ const mediaIpv6Enabled = await prompt.askYesNo(
474
+ "Enable IPv6 media candidates? (default: No)",
475
+ existing.MEDIA_IPV6 === "1"
476
+ );
477
+
478
+ const mediaForceIpv4Enabled = await prompt.askYesNo(
479
+ "Force IPv4-only SDP candidates? (default: Yes)",
480
+ existing.MEDIA_FORCE_IPV4
481
+ ? existing.MEDIA_FORCE_IPV4 === "1"
482
+ : !mediaIpv6Enabled
483
+ );
484
+
471
485
  const configureUfw = await prompt.askYesNo("Configure ufw firewall rules now", true);
472
486
 
473
487
  const config = {
@@ -492,6 +506,8 @@ async function runWizard(existing = {}, preflight = {}) {
492
506
  turnExternalUsername,
493
507
  turnExternalCredential,
494
508
  webphoneOrigin,
509
+ mediaIpv6: mediaIpv6Enabled ? "1" : "0",
510
+ mediaForceIpv4: mediaForceIpv4Enabled ? "1" : "0",
495
511
  rtpMin: "10000",
496
512
  rtpMax: "20000",
497
513
  acmeListenPort: deployMode === "reverse-proxy" ? "8080" : "80",
@@ -509,6 +525,8 @@ async function runWizard(existing = {}, preflight = {}) {
509
525
  console.log(` SIP provider URI: ${config.sipProviderUri}`);
510
526
  console.log(` Allowed SIP domains: ${config.allowedDomains || "(empty/dev-mode)"}`);
511
527
  console.log(` TURN mode: ${config.turnMode}`);
528
+ console.log(` IPv6 media candidates: ${config.mediaIpv6 === "1" ? "enabled" : "disabled (IPv4-only)"}`);
529
+ console.log(` Force IPv4 SDP strip: ${config.mediaForceIpv4 === "1" ? "enabled" : "disabled"}`);
512
530
 
513
531
  const proceed = await prompt.askYesNo("Proceed with provisioning", true);
514
532
  if (!proceed) {
@@ -557,6 +575,8 @@ function renderEnvContent(config, tlsCert, tlsKey) {
557
575
  WSS_LISTEN_PORT: config.wssListenPort,
558
576
  INTERNAL_WSS_PORT: config.internalWssPort,
559
577
  INTERNAL_WS_PORT: config.internalWsPort,
578
+ MEDIA_IPV6: config.mediaIpv6,
579
+ MEDIA_FORCE_IPV4: config.mediaForceIpv4,
560
580
  });
561
581
 
562
582
  let extra = "";
@@ -772,6 +792,8 @@ function statusCommand() {
772
792
  console.log(`Port ${envMap.WSS_LISTEN_PORT || "443"}: ${formatMark(p443.inUse)} listening`);
773
793
  console.log(`Port 5060: ${formatMark(p5060.inUse)} listening`);
774
794
  console.log(`rtpengine control: ${formatMark(rtpReady)} reachable`);
795
+ console.log(`IPv6 media candidates: ${(envMap.MEDIA_IPV6 || "0") === "1" ? "enabled" : "disabled (IPv4-only)"}`);
796
+ console.log(`Force IPv4 SDP strip: ${(envMap.MEDIA_FORCE_IPV4 || "1") === "1" ? "enabled" : "disabled"}`);
775
797
  if (envMap.TURN_MODE && envMap.TURN_MODE !== "none") {
776
798
  console.log(`/turn-credentials: ${formatMark(turnReady)} reachable`);
777
799
  }
@@ -789,6 +811,8 @@ function statusCommand() {
789
811
  console.log(`DEPLOY_MODE=${envMap.DEPLOY_MODE || ""}`);
790
812
  console.log(`ALLOWED_SIP_DOMAINS=${envMap.ALLOWED_SIP_DOMAINS || ""}`);
791
813
  console.log(`TURN_MODE=${envMap.TURN_MODE || "none"}`);
814
+ console.log(`MEDIA_IPV6=${envMap.MEDIA_IPV6 || "0"}`);
815
+ console.log(`MEDIA_FORCE_IPV4=${envMap.MEDIA_FORCE_IPV4 || "1"}`);
792
816
  }
793
817
 
794
818
  function certStatusCommand() {
@@ -23,3 +23,5 @@ 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__
27
+ MEDIA_FORCE_IPV4=__MEDIA_FORCE_IPV4__
@@ -10,6 +10,9 @@ services:
10
10
  security_opt:
11
11
  - no-new-privileges:true
12
12
  env_file: .env
13
+ environment:
14
+ - MEDIA_IPV6=${MEDIA_IPV6:-0}
15
+ - MEDIA_FORCE_IPV4=${MEDIA_FORCE_IPV4:-1}
13
16
  volumes:
14
17
  - ${TLS_CERT}:/etc/ssl/cert.pem:ro
15
18
  - ${TLS_KEY}:/etc/ssl/key.pem:ro