asterisk vendor: always append TURN port even when TURN_SERVER is host-only
entrypoint.sh's turn_server fallback only appended :TURN_PORT when TURN_SERVER was completely unset — a TURN_SERVER carried over from an older install (or set to a bare host by hand) passed straight through with no port, so the Sipnetic QR export's "st=turn:user:pass@host" field ended up missing the port entirely. Append it whenever the configured value has no colon at all, not just when it's empty.
This commit is contained in:
+9
@@ -134,6 +134,15 @@ mkdir -p "$CONFIG_DIR"
|
||||
|
||||
# Determine TURN/STUN server address
|
||||
turn_server="${TURN_SERVER:-${DOMAIN_NAME:-$local_ip}:${TURN_PORT:-3478}}"
|
||||
# TURN_SERVER may be set (e.g. carried over in .env from an older install)
|
||||
# to a bare host with no port — the fallback above only appends one when
|
||||
# TURN_SERVER is unset/empty entirely. Append it here too so every client
|
||||
# that reads this config (Sipnetic QR export, the web admin's own display)
|
||||
# always gets a host:port it can actually dial, not a host that silently
|
||||
# depends on the client guessing the default port.
|
||||
if [[ -n "$TURN_SERVER" && "$TURN_SERVER" != *:* ]]; then
|
||||
turn_server="${TURN_SERVER}:${TURN_PORT:-3478}"
|
||||
fi
|
||||
|
||||
cat > "$CONFIG_FILE" << EOF
|
||||
# Easy Asterisk Configuration (Docker) - $(date)
|
||||
|
||||
Reference in New Issue
Block a user