@penguinpbx
After updating Asterisk from 22.10.1 to 22.11.0 on two FreePBX 17 systems, most BLF keys on our Yealink phones stayed red after fwconsole restart. They only turned green one by one, or as soon as the monitored extension rang. Rebooting the phone didn’t help.
What’s happening
With the PJSIP logger you can see that Asterisk answers the phone’s SUBSCRIBE (Event: dialog) with 200 OK, but for the affected extensions it never sends the initial NOTIFY. The phone doesn’t know the state and shows the key as failed.
The affected extensions all have one thing in common: core show hints shows an empty presence value instead of not_set or available:
20@ext-local : PJSIP/20&Custom:DND20,CustomPresence:20 State:Idle Presence: Watchers 10
32@ext-local : PJSIP/32&Custom:DND32,CustomPresence:32 State:Idle Presence:available Watchers 11
FreePBX adds CustomPresence:<ext> to every extension hint, but the corresponding AstDB entry only exists if someone ever set a presence state (e.g. via UCP). Extensions without that entry are affected. You can check with:
asterisk -rx "database show CustomPresence"
Workaround
Setting a presence value fixes it immediately, and it survives restarts:
asterisk -rx "presencestate change CustomPresence:<ext> available"
To cover all extensions, including newly created ones, I use this script and call it via Advanced Settings → POST_RELOAD (you need to enable “Display/Override Readonly Settings” first), plus a cron job as a safety net:
#!/bin/bash
# Workaround Asterisk 22.11.0: ensure every ext-local hint with CustomPresence
# has an AstDB entry, otherwise BLF subscriptions get no initial NOTIFY.
logger -t fix-custompresence "started (user: $(id -un))"
asterisk -rx "core show hints" \
| awk '/@ext-local/ && /CustomPresence:/ {split($1,a,"@"); print a[1]}' \
| sort -u \
| while read -r e; do
if asterisk -rx "database get CustomPresence $e" | grep -q "not found"; then
asterisk -rx "presencestate change CustomPresence:$e available" >/dev/null
logger -t fix-custompresence "CustomPresence:$e set to available"
fi
done
It only adds missing entries, so presence states set via UCP are left alone.
Status
I’ve reported this upstream: [bug]: No initial NOTIFY for dialog subscriptions when hint references CustomPresence without AstDB entry (regression in 22.11.0) · Issue #2179 · asterisk/asterisk · GitHub. The Asterisk team is investigating. So far they couldn’t reproduce it on a stock 22.11.0, so the exact trigger (possibly startup-related) isn’t clear yet. The symptom looks very similar to an old bug (ASTERISK-25400) from 2015.
If you see the same behavior, feel free to add your details to the GitHub issue.