Asterisk 16.3 Wrong devstate when contact missing

After the expiry of a contact due to “maximum_expiration” or by manually removing it: “database del registrar/contact …” it appears that Asterisk is sometimes unaware of an extension’s devstate and it’s impossible to correct/refresh those devstates automatically.

For example: when a device is registered to another node (multi PBX environment), the devstate on this node falsely remains “NOT_INUSE”.

The only workaround I have is to temporarily disable the aor from pjsip.conf and to a “pjsip reload” to reset it to the default “UNAVAIBLE”.

Is there any way I can make Asterisk regenerate its devstates by looping over all existing contacts for example?

You might configure a script to connect to Asterisk and parse out the NOT_INUSE devices, then do something else with that list eg. try to qualify them.

You’re going to need to describe your set up further. I haven’t heard any reports of such problems under normal usage.