As of Noojee Receptionist 3.0.4 we have introduced a somewhat experimental method for tracking the DND status of a phone.
For this to work the phone needs to set the DND status on the Asterisk server rather than just using the phones own DND status.
Asterisk doesn't have direct support for DND so we need to do the work ourselves.
To make this work you need to dial a specialised DND extension on the Asterisk server to record the DND status of each phone. The easiest way to do this is to store the state in the asterisk DB as this is persistent across restarts of asterisk. You also need to modify your dial plan to recognise the DND state of the extension.
Noojee Receptionist expects you to store the DND state in a asterisk db key of the form 'SIP/DND/XXX'
Where XXX is the extension of the phone.
e.g. if your extension is 115 then the db entry should be:
SIP/DND/115
The value of the key should be '1' to indicate that DND is enabled and '0' to indicate that DND is not on. If the key is missing NJ Receptionist will assume that DND isn't on.
Whenever you change the DND state you need to send a user event from the dialplan to notify NJ Receptionist that the DND state has changed so that it can update the consoles UI to reflect the state change.
exten =>*78,1,Verbose(5, 'Enabling DND on ${CALLERID(num)}')
exten =>*78,n,Answer
exten =>*78,n,Set(DB(SIP/DND/${CALLERID(num)})=1)
exten =>*78,n,UserEvent(NJRDND,State: on,Extension: ${CALLERID(num)})
exten =>*78,n,Playback(beep)
exten =>*78,n,Wait(2)
exten =>*78,n,Hangup
exten =>*79,1,Verbose(5, 'Disable DND on ${CALLERID(num)}')
exten =>*79,n,Answer
exten =>*79,n,Set(DB(SIP/DND/${CALLERID(num)})=0)
exten =>*79,n,UserEvent(NJRDND,State: off,Extension: ${CALLERID(num)})
exten =>*79,n,Playback(beep)
exten =>*79,n,Wait(2)
exten =>*79,n,Hangup
Finally you need to modify the dialplan where you dial internal extensions to check the state of the DB key.