Fix 27s call ringing delay: TURN credential mismatch and STUN DNS TTL=0

Two bugs caused ICE candidate gathering to fail and timeout (~27 seconds)
before falling back to direct media on every call:

1. TURN credential mismatch — when TURN_PASSWORD was empty in .env,
   coturn defaulted to "changeme" but the entrypoint auto-generated a
   different random password for Asterisk. Every TURN auth attempt failed
   ("check_stun_auth: user easyasterisk credentials are incorrect").

2. STUN DNS TTL=0 — using the FQDN as stunaddr caused DNS resolution
   that returned TTL=0, making Asterisk cancel recurring STUN resolution
   entirely. Since coturn runs on the same host (network_mode: host),
   rtp.conf now uses 127.0.0.1 which needs no DNS at all.

Also documents the Android Call Integration audio issue (ConnectionService
routes audio through the native telephony path, breaking VoIP RTP).

https://claude.ai/code/session_01KWVtEt9MmZdywcu7WmgchX
This commit is contained in:
Claude
2026-02-24 22:07:33 +00:00
parent cbccaa4218
commit de46202ab4
4 changed files with 36 additions and 16 deletions
+2 -2
View File
@@ -60,8 +60,8 @@ VLAN_SUBNETS=
# ── 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.
# Both coturn and Asterisk must use the SAME password.
# If empty, both default to "changeme" — set a real password here.
#
# These credentials are shared between coturn and Asterisk.
# SIP clients do NOT need these - only the server uses them.