I’ve been reading doc  after seeing  being worked on. I’ve got a couple of questions about this.
I will answer your questions here based on the current patch. If you have suggestions on the feature implementation itself, please raise them on the PR itself as a review suggestion.
- If you wanted to prepare today an Asterisk dialplan to this (very interesting) future feature, what would you implement today ? I would be inclined to define 4 AstDB families (one for DND, CFA, CFB and CFNA) and program various service codes.
The dialplan implementation is up to you. This feature is at the SIP level and does not dictate any particular user level implementation. You can set up whatever codes and experiences you like.
Keep in mind the AstDB mentioned in the patch is not meant to be for the Asterisk administrator, just more of a cache.
- How would implement forwarding ? Simply sending calls to phones and letting them reply with 302, 486 or so ?
Again, that is up to you to do. You could do that if you wanted to. The patch only implements the low-level synchronization protocol, it does not actually implement any of the features themselves. Basically the patch is for the SIP side of things, and everything that is not SIP will need to be done by the Asterisk administrator. The phone tells Asterisk that it wants to forward calls to a number, and it’s up to you to both store that in the appropriate place. Read my comments on the PR to see how I do it on my system. I do not use SIP redirects, I have Asterisk itself forward calls as appropriate using my own implementation.
- Have you ever seen a SIP (hard or soft) phone allowing both Do Not Disturb and Call Forward Always to be simultaneously active ?
In such case, what happens when a call is sent over to the phone ?
Keep in mind that the “Do Not Disturb” feature as implemented on a phone, for example, the Polycom SoundPoint or VVX phones, is kind of a “fake” DND feature. Real DND, per the CLASS feature standard, never sends the call to the phone in the first place. The IP phone DND, as it is done client side, basically just disables the ringer but still presents the call.
Actually, with feature synchronization, I think the local DND functionality is disabled, it expects the server to handle DND, which is probably what you want anyways.
Forwarding is also, like most features, done switch-side, and again the phone never sees the call.
Whether DND or call forwarding takes precedence depends on your implementation. I may have seen it both ways, in general, I try to follow the CLASS standards as implemented by the 5ESS and DMS-100, and I don’t recall which one takes precedence, without checking the source code for the switch, but you can do whatever you like.