Skip to content

NethVoice: Main extension presence remains NOT_INUSE after disabling DND when all real devices are offline #7990

@andrea-marchionni

Description

@andrea-marchionni

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

  1. Configure a main extension with multiple associated devices.

  2. Check the hint for the main extension:

    core show hint 269
    
  3. Enable DND for the main extension.

  4. Verify that Custom:DND269 is set to BUSY.

  5. Disable DND.

  6. Verify the custom device state:

    asterisk -rx "devstate list" | grep 269
    
  7. Turn off or unregister all real devices associated with the user.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoiceBug or features releted to the NethVoice project

    Type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions