Questions on Device Feature Key Sync

Hello,

I’ve been reading doc [2] after seeing [1] being worked on. I’ve got a couple of questions about this.

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

  2. How would implement forwarding ? Simply sending calls to phones and letting them reply with 302, 486 or so ?

  3. 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 ?

[1] https://github.com/asterisk/asterisk/pull/128
[2] https://community.poly.com/polycom/attachments/polycom/VoIP/2234/1/DeviceFeatureKeySynchronizationFD.pdf

Best regards

Hello,

I’ve been reading doc [2] after seeing [1] 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.

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

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

  1. Have you ever seen a SIP (hard or soft) phone allowing both Do Not Disturb and Call Forward Always to be simultaneously active ?

Yes.

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.

[1] https://github.com/asterisk/asterisk/pull/128
[2] https://community.poly.com/polycom/attachments/polycom/VoIP/2234/1/DeviceFeatureKeySynchronizationFD.pdf

Best regards

For SNOM phones, activating DND will make the phone reject calls with a busy response code, while using “Do not disturb” as the response text.

The entire response line looks like this:

SIP/2.0 480 Do Not Disturb

So I guess what the DND button does, is different between phone models.

also on snom you can also programe it to send a code to asterisk that dnd is enabled/disabled and still accept calls
so you can handle the behaviure in asterisk and allow calls to overwrit DND on the phone and still call the phone as normal, for VIP callers

the cool thing about that is you can create custom BLF for that extension to show it as busy if DND is enabled

I know you can reprogram the DND button, to do a speed dial instead, and that you can make the phone send HTTP requests on certain actions (Like DND on and off).

Is that what you mean, or is there another feature I’ve missed, that can BOTH enable DND visually on the display of the phone, and tell Asterisk about it, using a regular call?

@InterLinked
Thank you very much for your informative reply !

How will an Asterisk sysadmin interact with this SIP level if you want for instance, to control the target of a CFA (ie Alice wants to forward calls to Bob’s phone but Bob’s phone doesn’t exist anymore) ?

How will an Asterisk sysadmin interact with this SIP level if you want for instance, to control the target of a CFA (ie Alice wants to forward calls to Bob’s phone but Bob’s phone doesn’t exist anymore) ?

As I said, that’s up to you. None of this logic is prescribed.

I wonder if this is a FreePBX user who thinks FreePBX is a thin configuration veneer on Asterisk, and therefore all the abstraction in FreePBX, like call forward, are explicitly present in Asterisk?

I think I understand it’s up to the sysadmin to program the behaviour (s)he looking after but which tools can (s)he use for this ?
Shall (s)he use the AMI (with a program spying on some specific events) or something else ?

yes it is possible to get snom to indicate dnd status on the display and get to make a call to asterisk where it indicate to asterisk where DND is enabled or not
and it is also possible to configure snom to still accept calls when it is displaying that DND is on

https://service.snom.com/display/wiki/using_server_managed_dnd
https://service.snom.com/display/wiki/dnd_on_code
https://service.snom.com/display/wiki/dnd_off_code

just add a custom hint that is beeing set or cleard when calling the on/off code
and the have your dialplan react on that hint

Shall (s)he use the AMI (with a program spying on some specific events) or something else ?

Sure, that would work. You’d need to use AMI to receive events, and what you do with those is up to you.

Ah… I’ve completely missed those settings. If I understand it correctly, if I configure 123 as the on code, and 321 as the off code, then set server managed to on, it will work like this:

When user presses DND to turn it on, the phone will dial 123, and display DND on display as it normally would.
When user presses DND to turn it off, the phone dials 321, and DND on the display is cleared as normal
If server managed is on, the phone will disregard the local DND state, and behave as if DND were off, regardless of status, and it’s up to Asterisk to handle the settings?

I just can’t see how you would sync the status from Asterisk with the phone, eg. when changing DND through some other means. From the docs you linked to, it seems it’s not possible directly through SIP, but you’d need an external program to update the DND state in the phone? (Unless you just accept using a BLF button of course. )

you can push the change out with sip notify

https://service.snom.com/display/wiki/Via+SIP+NOTIFY
https://service.snom.com/display/wiki/uaCSTA+over+SIP+-+Requests+and+Events#uaCSTAoverSIPRequestsandEvents-SetDoNotDisturb(since8.7.4)

you may need to duplicate this, to make it avalible from the dialplan
https://docs.asterisk.org/Asterisk_21_Documentation/API_Documentation/AMI_Actions/PJSIPNotify/

So there should an AMI Event to notify Asterisk about phone requests and an AMI Command to let Asterisk reply to these requests.
If Asterisk doesn’t explicitly receives such AMI Command, it won’t send any SIP NOTIFY message to phones confirming it request has been proceeded, right ?

I would probably not bother to mess with the Asterisk source, as I already collect events, and sending the notify can be triggered by my event handler instead.

But worth looking into, when time permits.

oliv2831 the only time you want to do this (AMI) is if you want to sync DND on 2 diffrent phones
or have an App where you want to enable/disable DND and have the phone relect the updated state

I have only done this via SIP notify via Kamailio

@TheMark
For me, one anticipated benefit from this DFKS feature is be able to control targets of forwarding requests when, for instance, Alice requests unconditional forwarding to Bob’s phone but Bob’s extension doesn’t exist anymore.
To my knowledge, this can’t be done at phone’s level (even simpler things like disabling forwarding to costly destination can’t be programmed when configuring IP phones).

Other use case: at some point in time Bob’s extension is removed and you want to remove it from any forwarding target.

For me, to implement this control, the phone must request forwarding to a server and wait for confirmation.
Then an internal or external process, spying corresponding AMI events or treating incoming calls (which requires sound files and related resources), analyses this request content and either denies or confirms it (using an AMI command or SIP notifies).

Can you imagine a different way to implement this ?
For me, this DFKS seems like a promising standardized way to handle forwarding/DND.

Yes I prefree DFKS as I want Asterisk/Kamailio to controle the state of the User/Extension
on the platforms I have been working on we have stored DND (off/on/external) / ForwadAllways / ForwardNoAnswer / ForwardBusy in astDB for the extension
and the users can have (1:M) extension and (1:M) devices (SIP / Mobile / SipTrunkExtension)
User → Extensions → Devices

they also have there own Queue used for CampOn as well at there own parking spaces
all managed by asterisk
but they can change settings via:

  • special extensions (mobile phones / sip phones) with BLF
  • AMI (PC / mobile app)

Do you allow the users to access AMI directly, or do you have some middleware inbetween?

we have oure own AMI to CSTA stack