Asterisk updated to 20.21.0, 22.11.0 and 23.5.0

There were multiple relevant performance improvements in the latest releases of Asterisk from August 27th, particularly w/r/t ami manager event handling, and some more WebSocket work for better AI-LLM integrations, along with security fixes in the included PJSIP project from their upstream, which you may now access in FreePBX by running on the command line the following:

$ sudo apt update
$ sudo asterisk-version-switch

Links to each relevant GH issue that you can dig into for access to the Changelogs:

Related previous topic: Asterisk versions updated with asterisk-version-switch - #2

@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.

Update: There’s a second regression in 22.11.0 from the same change: the dialog-info NOTIFY for a ringing extension no longer contains the caller identity, so Yealink pickup displays show 25 <- without the caller’s number. No workaround for that one.

Root cause of the BLF issue is confirmed: FreePBX’s modules.conf has preload = pbx_config.so, so hints are created before func_presencestate is loaded (29× “No provider found for label: CustomPresence” at startup).

I’ve downgraded both systems to 22.10.1 and put the packages on hold until a fixed release is available:

PKGS=$(dpkg -l | awk '/^ii +asterisk22/ && $3=="22.11.0-1.sng12" {print $2}')
V="22.10.1-1.sng12"
apt install -s --allow-downgrades $(for p in $PKGS; do echo "$p=$V"; done)   # simulate first
fwconsole stop
apt install -y --allow-downgrades $(for p in $PKGS; do echo "$p=$V"; done)
apt-mark hold $PKGS
fwconsole start

Issues: [bug]: No initial NOTIFY for dialog subscriptions when hint references CustomPresence without AstDB entry (regression in 22.11.0) · Issue #2179 · asterisk/asterisk · GitHub and the follow-up for the missing caller ID: [bug]: dialog-info NOTIFY for ringing extension no longer contains <remote> identity (caller ID) since 22.11.0 · Issue #2186 · asterisk/asterisk · GitHub

Thanks for both of these reports, analysis, workarounds, etc., and for following up on the issue Friday. Fixes will likely be part of the next regular releases of Asterisk – currently scheduled for mid-October – and FreePBX will then begin testing shortly after that. But in the interim, we may consider changing the preload order to address the first issue, so any reports of issues for those that choose to manually modify the order would be most appreciated.

That seems optimistic; 22.12 RC1 was released 10 days ago so at best I’d expect the fixes in 22.13. Or if you’re lucky, it could take even longer.

The fix is already in for the first issue from OP and addresses a relatively minor regression from an immediately preceding version which was able to be reproduced quickly.

Appreciate the link to the other issue, but it’s a bit of :red_apple: and :tangerine: comparison with OP. Also IIRC there’s other ways to solve that problem with those particular phones when dealing with chan_sip → chan_pjsip migrations.

Fix is included in RC2s out today Asterisk Release Candidate 22.12.0-rc2 - Development - Asterisk Community and release timeline was discussed in related FreePBX GH issue comments [bug]: custompresence blf fail in latest asterisk package 22.11.0 for freepbx · Issue #1337 · FreePBX/issue-tracker · GitHub