@bitcall/webrtc-sip-gateway 0.3.8 → 0.3.10
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 +4 -2
- package/package.json +1 -1
- package/src/index.js +28 -0
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@ Latest updates:
|
|
|
9
9
|
the gateway's own `:5060` listener does not trigger false port conflicts.
|
|
10
10
|
- `update` now syncs `BITCALL_GATEWAY_IMAGE` to the CLI target image tag,
|
|
11
11
|
pulls, and force-recreates containers so new image layers are applied.
|
|
12
|
+
- `up`/`restart`/`update` auto-migrate legacy compose files by removing stale
|
|
13
|
+
`/etc/kamailio` volume mounts that can override image-shipped config.
|
|
12
14
|
- Docker image includes `sngrep` and `tcpdump` for SIP troubleshooting.
|
|
13
15
|
- `sip-trace` opens a live SIP message viewer using `sngrep` in the container
|
|
14
16
|
via compose service execution.
|
|
@@ -16,8 +18,8 @@ Latest updates:
|
|
|
16
18
|
(nft-compatible port ranges and rule action order).
|
|
17
19
|
- Media firewall status now checks both nft and ip6tables marker rules so
|
|
18
20
|
legacy ip6tables protections are reported correctly.
|
|
19
|
-
- In-dialog
|
|
20
|
-
now attempt alias/usrloc fallback before 404.
|
|
21
|
+
- In-dialog non-ACK handling is hardened: in-dialog requests with broken/missing
|
|
22
|
+
route-set now attempt alias/usrloc fallback before 404.
|
|
21
23
|
- `TURN_MODE=coturn` now generates a compose stack with a dedicated coturn
|
|
22
24
|
container.
|
|
23
25
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1011,6 +1011,30 @@ function writeComposeTemplate(config = {}) {
|
|
|
1011
1011
|
writeFileWithMode(COMPOSE_PATH, `${compose}\n`, 0o644);
|
|
1012
1012
|
}
|
|
1013
1013
|
|
|
1014
|
+
function stripLegacyKamailioVolume(composeContent) {
|
|
1015
|
+
const lines = composeContent.split(/\r?\n/);
|
|
1016
|
+
const filtered = lines.filter((line) => !line.includes("/etc/kamailio"));
|
|
1017
|
+
if (filtered.length === lines.length) {
|
|
1018
|
+
return { changed: false, content: composeContent };
|
|
1019
|
+
}
|
|
1020
|
+
const content = `${filtered.join("\n").replace(/\n*$/, "")}\n`;
|
|
1021
|
+
return { changed: true, content };
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
function migrateLegacyComposeIfNeeded() {
|
|
1025
|
+
if (!fs.existsSync(COMPOSE_PATH)) {
|
|
1026
|
+
return false;
|
|
1027
|
+
}
|
|
1028
|
+
const original = fs.readFileSync(COMPOSE_PATH, "utf8");
|
|
1029
|
+
const migrated = stripLegacyKamailioVolume(original);
|
|
1030
|
+
if (!migrated.changed) {
|
|
1031
|
+
return false;
|
|
1032
|
+
}
|
|
1033
|
+
writeFileWithMode(COMPOSE_PATH, migrated.content, 0o644);
|
|
1034
|
+
console.log("Detected legacy /etc/kamailio compose volume override. Removed automatically.");
|
|
1035
|
+
return true;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1014
1038
|
function provisionCustomCert(config) {
|
|
1015
1039
|
validateCustomCert(config.customCertPath, config.customKeyPath, config.domain);
|
|
1016
1040
|
|
|
@@ -1373,6 +1397,7 @@ function runSystemctl(args, fallbackComposeArgs) {
|
|
|
1373
1397
|
|
|
1374
1398
|
function upCommand() {
|
|
1375
1399
|
ensureInitialized();
|
|
1400
|
+
migrateLegacyComposeIfNeeded();
|
|
1376
1401
|
runSystemctl(["start", SERVICE_NAME], ["up", "-d", "--remove-orphans"]);
|
|
1377
1402
|
}
|
|
1378
1403
|
|
|
@@ -1383,6 +1408,7 @@ function downCommand() {
|
|
|
1383
1408
|
|
|
1384
1409
|
function restartCommand() {
|
|
1385
1410
|
ensureInitialized();
|
|
1411
|
+
migrateLegacyComposeIfNeeded();
|
|
1386
1412
|
runSystemctl(["reload", SERVICE_NAME], ["restart"]);
|
|
1387
1413
|
}
|
|
1388
1414
|
|
|
@@ -1617,6 +1643,7 @@ async function certInstallCommand(options) {
|
|
|
1617
1643
|
|
|
1618
1644
|
function updateCommand() {
|
|
1619
1645
|
ensureInitialized();
|
|
1646
|
+
migrateLegacyComposeIfNeeded();
|
|
1620
1647
|
const envMap = loadEnvFile(ENV_PATH);
|
|
1621
1648
|
const currentImage = envMap.BITCALL_GATEWAY_IMAGE || "";
|
|
1622
1649
|
const targetImage = DEFAULT_GATEWAY_IMAGE;
|
|
@@ -1861,6 +1888,7 @@ module.exports = {
|
|
|
1861
1888
|
buildSecurityNotes,
|
|
1862
1889
|
buildQuickFlowDefaults,
|
|
1863
1890
|
shouldRequireAllowlist,
|
|
1891
|
+
stripLegacyKamailioVolume,
|
|
1864
1892
|
isOriginWildcard,
|
|
1865
1893
|
isSingleProviderConfigured,
|
|
1866
1894
|
printRequiredPorts,
|