From 36e6bc3c020c70d40799b79381e2fbacd7fa3afe Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 17 Aug 2026 14:59:19 +0000 Subject: [PATCH] Fix: PSTN calls to a personal DID never fell to voicemail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pstn_personal_ring dialed the owner and hung up regardless of DIALSTATUS, so no-answer/busy calls to a personal DID just dropped silently instead of offering voicemail. Now falls to VoiceMail(@default,u) on anything but ANSWER, gated by the owner's existing voicemail=yes/no flag in pstn-permissions.conf. The shared ring-group and group-owned personal DID inbound paths have the same gap but no single owning extension to pick a mailbox for — left as-is pending a decision on what that should do. --- services/pstn-trunk.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/services/pstn-trunk.sh b/services/pstn-trunk.sh index 78a2fc3..8cf6a48 100644 --- a/services/pstn-trunk.sh +++ b/services/pstn-trunk.sh @@ -773,6 +773,12 @@ __ALERT_DENY_PERSONAL_LINE__ same => n,Busy(15) same => n,Hangup() +; Falls to the owner's own voicemail (${PSTN_PERSONAL_OWNER}@default, the +; same mailbox *97/*98 use) on anything but ANSWER, gated by that +; extension's own voicemail=yes/no flag in pstn-permissions.conf. Unambiguous +; here since a personal DID has exactly one owning extension — unlike the +; shared ring-group and group-owned personal DID paths above, which can't +; pick a single mailbox this same way and are left as-is (Hangup() only). exten => pstn_personal_ring,1,Set(PSTN_MAX_IN=${AST_CONFIG(pstn-limits.conf,limits,max_inbound)}) same => n,Set(PSTN_MAX_IN=${IF($["${PSTN_MAX_IN}" = ""]?10:${PSTN_MAX_IN})}) same => n,GotoIf($[${GROUP_COUNT(pstn-in)} >= ${PSTN_MAX_IN}]?pstn_in_busy,1) @@ -781,7 +787,12 @@ exten => pstn_personal_ring,1,Set(PSTN_MAX_IN=${AST_CONFIG(pstn-limits.conf,limi same => n,Dial(PJSIP/${PSTN_PERSONAL_OWNER},20) same => n,Set(PSTN_DUR=$[${EPOCH} - ${PSTN_START}]) same => n,System(printf '%s|in|%s|%s|%s\n' "${PSTN_START}" "${CALLERID(num)}" "${PSTN_DID_CALLED}" "${PSTN_DUR}" >> /var/log/asterisk/pstn-trunk-calls.log) - same => n,Hangup() + same => n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?pstn_personal_ring_end,1) + same => n,Set(PSTN_VM_OK=${AST_CONFIG(pstn-permissions.conf,${PSTN_PERSONAL_OWNER},voicemail)}) + same => n,GotoIf($["${PSTN_VM_OK}" != "yes"]?pstn_personal_ring_end,1) + same => n,VoiceMail(${PSTN_PERSONAL_OWNER}@default,u) + +exten => pstn_personal_ring_end,1,Hangup() EOF if [[ -n "$NTFY_URL" ]]; then