From b5b0edef621e5d0458e5d66992e71c1a0e43e95d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Jul 2026 20:54:43 +0000 Subject: [PATCH] Dedupe RING_EXTS before generating the inbound dialplan Confirmed live: a ring-group list with a repeated extension ("201 301 313 312 313") generated duplicate ring/skip priority labels in the same [from-pstn-trunk] extension. Asterisk doesn't error on this - it silently resolves Goto() to the wrong occurrence and loops between the two blocks forever, so the call never reaches the actual Dial() and nothing ever rings, with no error to point at the cause. Dedupes (first-occurrence order preserved) regardless of how the duplicate got in there. --- services/pstn-trunk.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/pstn-trunk.sh b/services/pstn-trunk.sh index f0f969a..8cbc163 100644 --- a/services/pstn-trunk.sh +++ b/services/pstn-trunk.sh @@ -252,6 +252,14 @@ MEMBER # embedded-delimiter risk since every field here is digits/hostnames). _pstn_write_dialplan_include() { local FILE="$1" DID="$2" RING_EXTS="$3" NTFY_URL="$4" + # Dedupe: a repeated extension (typo, copy-paste, or a settings file + # edited by hand) would otherwise generate two identical ring/ + # skip priority labels in the same [from-pstn-trunk] extension. + # Confirmed live: Asterisk doesn't error on the duplicate labels, it + # silently resolves Goto() to the wrong one and loops between the two + # blocks forever — the call never reaches the actual Dial(), and no + # ring/notification ever happens, with no error anywhere to point at it. + RING_EXTS="$(echo "$RING_EXTS" | xargs -n1 | awk '!seen[$0]++' | xargs)" cat > "$FILE" << 'EOF' ; PSTN outbound/inbound — US-only (NANP). Concurrent-call caps (both ; directions) AND tiered permissions (internal / restricted / full) are read