From 487b6446d7a0558404854d1a510b2660f80dc3d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Jul 2026 17:35:08 +0000 Subject: [PATCH] Rebuild dialplan on every container start as a safety net MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Devices/rooms trigger a dialplan rebuild themselves via the web admin now, but that only fixes the problem going forward — endpoints added before that fix (or by any future path that misses the call) stay registrable-but-uncallable with no obvious cause until someone thinks to run --rebuild-dialplan by hand. Call it unconditionally once Asterisk is up, before the PJSIP transport check. Cheap and idempotent — it just regenerates extensions.conf from the current pjsip.conf/rooms.conf state. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015X1jRGHwrvovz2qkhKfDZi --- vendor/easy-asterisk/docker/entrypoint.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vendor/easy-asterisk/docker/entrypoint.sh b/vendor/easy-asterisk/docker/entrypoint.sh index 1181c3e..1cadc6d 100755 --- a/vendor/easy-asterisk/docker/entrypoint.sh +++ b/vendor/easy-asterisk/docker/entrypoint.sh @@ -479,6 +479,16 @@ for i in $(seq 1 60); do sleep 1 done +# Rebuild the dialplan from the current pjsip.conf/rooms.conf on every start. +# Devices/rooms are meant to trigger this themselves when added via the web +# admin, but this is a cheap safety net against any path that misses it +# (or config restored/edited outside the web admin) — without it, endpoints +# can register fine yet be uncallable ("extension not found in context +# 'intercom'") with no obvious cause. +if [[ -x /usr/local/bin/easy-asterisk ]]; then + /usr/local/bin/easy-asterisk --rebuild-dialplan >/dev/null 2>&1 || true +fi + # Verify PJSIP transports are listening. res_pjsip finishes binding its # transports a beat after "core show version" first responds, so a single # immediate check can catch it mid-startup and misreport TLS as down even