Make TURN/STUN port configurable via TURN_PORT env var

UniFi controller uses UDP 3478 for STUN, preventing coturn from
binding. Add TURN_PORT variable (default 3478) so users can set
TURN_PORT=3479 in .env to avoid the conflict.

https://claude.ai/code/session_01Vm6NLaQuzM4VosAotqS1q8
This commit is contained in:
Claude
2026-02-24 01:58:04 +00:00
parent f71bec27e5
commit 61b9235f60
5 changed files with 20 additions and 12 deletions
+10 -4
View File
@@ -8,9 +8,9 @@
# 4. docker exec -it easy-asterisk easy-asterisk
#
# Port forwarding required on your router:
# 5061/tcp → SIP TLS signaling
# 3478/udp → STUN/TURN (NAT traversal + media relay)
# 3478/tcp → TURN TCP fallback (for restrictive networks)
# 5061/tcp → SIP TLS signaling
# 3478/udp+tcp → STUN/TURN (NAT traversal + media relay)
# (change with TURN_PORT if 3478 is taken)
# 10000-20000/udp → RTP media (or your custom range below)
#
# How it works:
@@ -58,7 +58,7 @@ LOCAL_CIDR=
HAS_VLANS=n
VLAN_SUBNETS=
# ── TURN/STUN Credentials ────────────────────────────────────
# ── TURN/STUN Settings ──────────────────────────────────────
# Used by coturn for TURN relay authentication.
# If TURN_PASSWORD is empty, a random password is generated on
# first startup and saved to /etc/easy-asterisk/config.
@@ -68,6 +68,12 @@ VLAN_SUBNETS=
TURN_USERNAME=easyasterisk
TURN_PASSWORD=
# ── TURN/STUN Port ──────────────────────────────────────────
# Default: 3478 (standard STUN/TURN port)
# Change if 3478 is already in use (e.g., UniFi controller uses 3478/udp).
# Common alternative: 3479
TURN_PORT=3478
# ── TURN Relay Port Range ─────────────────────────────────────
# Ports coturn uses for media relay. Forward this range on your router.
# Default is 100 ports (enough for ~50 simultaneous relayed calls).