@bitcall/webrtc-sip-gateway 0.2.4 → 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 +5 -3
- package/lib/constants.js +1 -1
- package/package.json +1 -1
- package/src/index.js +14 -1
- package/templates/.env.template +1 -0
- package/templates/docker-compose.yml.template +1 -0
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.
|
|
8
|
+
sudo npm i -g @bitcall/webrtc-sip-gateway@0.2.5
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Main workflow
|
|
@@ -16,8 +16,10 @@ sudo bitcall-gateway status
|
|
|
16
16
|
sudo bitcall-gateway logs -f
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Default media policy is IPv4-only
|
|
20
|
-
|
|
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.
|
|
21
23
|
|
|
22
24
|
## Commands
|
|
23
25
|
|
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.
|
|
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
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.
|
|
37
|
+
const PACKAGE_VERSION = "0.2.5";
|
|
38
38
|
|
|
39
39
|
function detectComposeCommand() {
|
|
40
40
|
if (run("docker", ["compose", "version"], { check: false }).status === 0) {
|
|
@@ -104,6 +104,7 @@ function envOrder() {
|
|
|
104
104
|
"INTERNAL_WSS_PORT",
|
|
105
105
|
"INTERNAL_WS_PORT",
|
|
106
106
|
"MEDIA_IPV6",
|
|
107
|
+
"MEDIA_FORCE_IPV4",
|
|
107
108
|
"RTPENGINE_MIN_PORT",
|
|
108
109
|
"RTPENGINE_MAX_PORT",
|
|
109
110
|
"WITH_REVERSE_PROXY",
|
|
@@ -474,6 +475,13 @@ async function runWizard(existing = {}, preflight = {}) {
|
|
|
474
475
|
existing.MEDIA_IPV6 === "1"
|
|
475
476
|
);
|
|
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
|
+
|
|
477
485
|
const configureUfw = await prompt.askYesNo("Configure ufw firewall rules now", true);
|
|
478
486
|
|
|
479
487
|
const config = {
|
|
@@ -499,6 +507,7 @@ async function runWizard(existing = {}, preflight = {}) {
|
|
|
499
507
|
turnExternalCredential,
|
|
500
508
|
webphoneOrigin,
|
|
501
509
|
mediaIpv6: mediaIpv6Enabled ? "1" : "0",
|
|
510
|
+
mediaForceIpv4: mediaForceIpv4Enabled ? "1" : "0",
|
|
502
511
|
rtpMin: "10000",
|
|
503
512
|
rtpMax: "20000",
|
|
504
513
|
acmeListenPort: deployMode === "reverse-proxy" ? "8080" : "80",
|
|
@@ -517,6 +526,7 @@ async function runWizard(existing = {}, preflight = {}) {
|
|
|
517
526
|
console.log(` Allowed SIP domains: ${config.allowedDomains || "(empty/dev-mode)"}`);
|
|
518
527
|
console.log(` TURN mode: ${config.turnMode}`);
|
|
519
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"}`);
|
|
520
530
|
|
|
521
531
|
const proceed = await prompt.askYesNo("Proceed with provisioning", true);
|
|
522
532
|
if (!proceed) {
|
|
@@ -566,6 +576,7 @@ function renderEnvContent(config, tlsCert, tlsKey) {
|
|
|
566
576
|
INTERNAL_WSS_PORT: config.internalWssPort,
|
|
567
577
|
INTERNAL_WS_PORT: config.internalWsPort,
|
|
568
578
|
MEDIA_IPV6: config.mediaIpv6,
|
|
579
|
+
MEDIA_FORCE_IPV4: config.mediaForceIpv4,
|
|
569
580
|
});
|
|
570
581
|
|
|
571
582
|
let extra = "";
|
|
@@ -782,6 +793,7 @@ function statusCommand() {
|
|
|
782
793
|
console.log(`Port 5060: ${formatMark(p5060.inUse)} listening`);
|
|
783
794
|
console.log(`rtpengine control: ${formatMark(rtpReady)} reachable`);
|
|
784
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"}`);
|
|
785
797
|
if (envMap.TURN_MODE && envMap.TURN_MODE !== "none") {
|
|
786
798
|
console.log(`/turn-credentials: ${formatMark(turnReady)} reachable`);
|
|
787
799
|
}
|
|
@@ -800,6 +812,7 @@ function statusCommand() {
|
|
|
800
812
|
console.log(`ALLOWED_SIP_DOMAINS=${envMap.ALLOWED_SIP_DOMAINS || ""}`);
|
|
801
813
|
console.log(`TURN_MODE=${envMap.TURN_MODE || "none"}`);
|
|
802
814
|
console.log(`MEDIA_IPV6=${envMap.MEDIA_IPV6 || "0"}`);
|
|
815
|
+
console.log(`MEDIA_FORCE_IPV4=${envMap.MEDIA_FORCE_IPV4 || "1"}`);
|
|
803
816
|
}
|
|
804
817
|
|
|
805
818
|
function certStatusCommand() {
|
package/templates/.env.template
CHANGED