Summary:ASTERISK-14181: hints : DEVSTATE UNAVAILABLE presence state of "terminated" not interpreted correctly on Grandstream devices
Reporter:Tolmino Muccitelli (tolmino)Labels:
Date Opened:2009-12-19 11:00:52.000-0600Date Closed:2017-12-14 13:53:36.000-0600
Versions:Frequency of
Description:I have noticed that problem when asterisk notify to Grandstram phone devstate Unavaiable (using hints) led is green and not red.

with grandstream we have noticed that:
In the Asterisk test, you can see the NOTIFY response shows that the subscription state is active on the offline number. (should be terminated state if you do not want to see GREEN). Our phones do not support the RED state!

In our Grandstream PBX test, you can see the the NOTIFY response shows that the subscription state is terminated on the offline number. In the offline, terminated state, our phones will not light up the LED.

Therefore the LEDs support only thes three states as I had mentioned, idle (green), busy (red), ringing (blinking red). Offline will be just blank.

It is up to Asterisk if they want to use "terminated" state for offline instead of "active".

Thanks.... Tolmino from Italy


there is a open ticket with grandstream and they have made some dumps avaiable there:

Comments:By: Francesco Romano (francesco_r) 2009-12-19 12:10:54.000-0600

See this bug for a partial solution: ASTERISK-10568
Related to wrong device state in asterisk, i opened also another ticket two months ago but it's still open: ASTERISK-14954

By: Leif Madsen (lmadsen) 2009-12-21 09:24:10.000-0600

I'm wondering if this issue and ASTERISK-14954 are from the same underlying problem? I'm just going to mark these as related for now, and someone can correct me if I'm wrong :)

By: Leif Madsen (lmadsen) 2009-12-22 15:24:20.000-0600

Could you provide a SIP debug for when this is happening? This is required to move this issue forward.

By: Tolmino Muccitelli (tolmino) 2009-12-22 17:36:05.000-0600

Yes, take a look here.....


there are two files attached....

i have tested with Grandstream.....  and maybe that
chan_sip.c (case AST_EXTENSION_UNAVAILABLE) must change from:
statestring = "terminated";
statestring = "confirmed";

By: Clod Patry (junky) 2011-09-27 22:15:20.556-0500

Did you have time to test with latest 1.8 ?

By: Corey Farrell (coreyfarrell) 2017-12-14 13:53:36.804-0600

The linked grandstream ticket is gone.  If this is still an issue you may reopen by commenting and attaching the requested SIP debug directly to this ticket.

By: Benjamin Renard (brenard@easter-eggs.com) 2018-08-30 11:36:47.256-0500

This problem still exists today : I tried again to ask Grandstream support for a solution and this is their answer :

Asterisk is associating the "terminated" state which is normally indication to BLF that the extension is "available" and "not in use" to the event: "unavailable", and as I explained for end devices with BLF support, the "terminated" state is equivalent to available ( LED will light up).

The work-arround to change "statestring" to "confirmed" in chan_sip.c (case AST_EXTENSION_UNAVAILABLE) is still work, but when using distribution package (to take benefit of security updates), we have to recompile package on each release.

Even if the current behavior is correct, it is possible to add a parameter to permit to turn on this other behavior.