Hopefully I can help.
You have found a small documentation error, The
Contact.show property will be an empty string to indicate either offline state, or that there is insufficient permission to get state information from that contact; Viewing the
Contact.states property will show what data is available to build the
show value from.
Also please note that the contact object cannot show whether a device is 'DnD' as 'handset DnD is internalised in the handset and is not available via the API. The Contact state shows the contact's XMPP/Chat state only.
Regarding the voicemail line, this is not something I've tried before, it depends how detailed or real-time your tracking needs to be. For very real-time results you would need to track calls on the trunk device coming into the PABX, and ignore calls that are not bridged to voicemail,
Call.name === 'Voicemail' also,
Call.number will represent the voicemail box number currently being called. More simply, monitor the number of read/unread messages in the mailbox by using the relevant mailbox object.
I imagine that the above will trigger further questions, but feel free to ask.