Fix: PSTN calls to a personal DID never fell to voicemail

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(<owner>@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.
This commit is contained in:
Claude
2026-08-17 14:59:19 +00:00
parent 17203aa0f9
commit 36e6bc3c02
+12 -1
View File
@@ -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<ext> 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