Description
The SIP presence of a main extension is calculated using all devices associated with the user, plus a custom device used by FreePBX to handle DND status.
Example:
nethvoice*CLI> core show hint 269
269@ext-local : PJSIP/269&PJSIP/91269&PJSIP/92269&PJSIP/93269&Custom:DND269, State:Idle Presence:available Watchers 1
The following devices contribute to the presence of the main extension:
269
91269
92269
93269
Custom:DND269
Custom:DND269 is used by FreePBX to set the presence to Busy when DND is enabled.
The issue starts after DND is enabled for the first time. At that point, the custom device is set to BUSY, which correctly changes the presence of the main extension to Busy.
However, when DND is disabled, the custom device is set to NOT_INUSE:
asterisk -rx "devstate list" | grep 269
--- Name: 'Custom:DND269' State: 'NOT_INUSE'
As a result, when all real devices are offline, the main extension presence remains NOT_INUSE, because Custom:DND269 is still considered by the hint and has state NOT_INUSE.
Steps to reproduce
-
Configure a main extension with multiple associated devices.
-
Check the hint for the main extension:
-
Enable DND for the main extension.
-
Verify that Custom:DND269 is set to BUSY.
-
Disable DND.
-
Verify the custom device state:
asterisk -rx "devstate list" | grep 269
-
Turn off or unregister all real devices associated with the user.
-
Check the presence of the main extension.
Expected behavior
When DND is disabled and all real devices are offline, the presence of the main extension should reflect the real device state and should not remain NOT_INUSE because of the DND custom device.
The Custom:DND269 device should not keep the main extension presence as available/not in use when no real devices are registered.
Actual behavior
After DND is disabled, Custom:DND269 remains in NOT_INUSE state.
Since this custom device is part of the hint, the main extension presence remains NOT_INUSE even when all real devices are offline.
Additional context
The issue appears to be caused by the DND custom device being included in the hint used to calculate the main extension presence. After DND is disabled, the custom device still contributes a NOT_INUSE state, which prevents the main extension presence from correctly reflecting that all real devices are offline.
Description
The SIP presence of a main extension is calculated using all devices associated with the user, plus a custom device used by FreePBX to handle DND status.
Example:
The following devices contribute to the presence of the main extension:
Custom:DND269is used by FreePBX to set the presence to Busy when DND is enabled.The issue starts after DND is enabled for the first time. At that point, the custom device is set to
BUSY, which correctly changes the presence of the main extension to Busy.However, when DND is disabled, the custom device is set to
NOT_INUSE:As a result, when all real devices are offline, the main extension presence remains
NOT_INUSE, becauseCustom:DND269is still considered by the hint and has stateNOT_INUSE.Steps to reproduce
Configure a main extension with multiple associated devices.
Check the hint for the main extension:
Enable DND for the main extension.
Verify that
Custom:DND269is set toBUSY.Disable DND.
Verify the custom device state:
Turn off or unregister all real devices associated with the user.
Check the presence of the main extension.
Expected behavior
When DND is disabled and all real devices are offline, the presence of the main extension should reflect the real device state and should not remain
NOT_INUSEbecause of the DND custom device.The
Custom:DND269device should not keep the main extension presence as available/not in use when no real devices are registered.Actual behavior
After DND is disabled,
Custom:DND269remains inNOT_INUSEstate.Since this custom device is part of the hint, the main extension presence remains
NOT_INUSEeven when all real devices are offline.Additional context
The issue appears to be caused by the DND custom device being included in the hint used to calculate the main extension presence. After DND is disabled, the custom device still contributes a
NOT_INUSEstate, which prevents the main extension presence from correctly reflecting that all real devices are offline.