Changing DND via CLI

Hi all,

I’m using the DND script from the great @lgaetz for a while now… which works as expected.

However, since I need to fire this script a lot, it is causing a high CPU usage.
First guess would be because of the

include ‘/etc/freepbx.conf’; and $FreePBX = FreePBX::Create();

Is there a more “light weight” way to do this? Something like:

  1. database del DND XXX
  2. devstate change Custom:DNDXXX NOT_INUSE
  3. devstate change Custom:DEVDNDXXX NOT_INUSE

Thanks!

Yeah you can adjust the the value in asterisk db. To turn on:

database put DND 100 YES
devstate change Custom:DND100 INUSE

To turn off:

database del DND 100
devstate change Custom:DND100 NOT_INUSE
1 Like

Thank you sir, testing now :slight_smile:

It seems the correct way to turn DND off is:

database del DND 100
devstate change Custom:DND100 UNAVAILABLE

And maybe:
devstate change Custom:DEVDND100 UNAVAILABLE

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.