Queue toggle hints always idle

Hello,

I’m running asterisk 1.4.30 with backported devstate on freepbx 2.8.0.1.

I have my phones (snom300’s) setup with a button to toggle my agents status via the queue toggle feature(*45). This works great. However, I’m trying to get the status light to turn on when their logged in. I have the key on the Snom setup for BLF and it appears to subscribe correctly. The phones shows a subscription to the agent queue hint, and asterisk shows it being monitored in show hints. However, sip show subscriptions ALWAYS shows the state as idle.

There seems to be next to zero documentation on this feature so I may just be missing something. Suggestions would be greatly appreciated.

Thanks,

why don’t you provide a few more details and maybe someone can get to the bottom of the issue.

What is your queue number, the specific extension and device number, and then the specific code you are subscribing to on the phone?

Then, provide a snapshot of show hints and the CustomDevstate Astdb settings. Here are a couple helpful commands:

asterisk -rx 'database show' | grep "QUEUE
asterisk -rx 'show hints' | grep QUEUE

that will help narrow down the output.

Hi,

The queue is 8900, the extension and device is 8099. In the phone I’m entering sip:*458099*8900@pbx|4580998900 into the button.

One thing that concerned me was all the subscriptions show the NAT address of the phones. However, the mwi subscriptions work correctly even with that. If there’s any other output you think would be useful please let me know.

database show | grep QUEUE had no output

[root@pbx ~]# asterisk -rx ‘show hints’ | grep QUEUE
4589998900@ext-queues : Custom:QUEUE8999890 State:Unavailable Watchers 0
4580998900@ext-queues : Custom:QUEUE8099
890 State:Unavailable Watchers 1
4580958900@ext-queues : Custom:QUEUE8095890 State:Unavailable Watchers 0
4580948900@ext-queues : Custom:QUEUE8094
890 State:Unavailable Watchers 0
4580938900@ext-queues : Custom:QUEUE8093890 State:Unavailable Watchers 0
4580928900@ext-queues : Custom:QUEUE8092
890 State:Unavailable Watchers 0
4580918900@ext-queues : Custom:QUEUE8091890 State:Unavailable Watchers 0
4580778900@ext-queues : Custom:QUEUE8077
890 State:Unavailable Watchers 0
4580318900@ext-queues : Custom:QUEUE8031890 State:Unavailable Watchers 0
45803018900@ext-queues : Custom:QUEUE80301
89 State:Unavailable Watchers 0
4580308900@ext-queues : Custom:QUEUE8030890 State:Unavailable Watchers 0
45802918900@ext-queues : Custom:QUEUE80291
89 State:Unavailable Watchers 0
4580298900@ext-queues : Custom:QUEUE8029890 State:Unavailable Watchers 0
4580288900@ext-queues : Custom:QUEUE8028
890 State:Unavailable Watchers 0
45802718900@ext-queues : Custom:QUEUE8027189 State:Unavailable Watchers 0
4580278900@ext-queues : Custom:QUEUE8027
890 State:Unavailable Watchers 0
45802618900@ext-queues : Custom:QUEUE8026189 State:Unavailable Watchers 0
4580268900@ext-queues : Custom:QUEUE8026
890 State:Unavailable Watchers 0
45802518900@ext-queues : Custom:QUEUE8025189 State:Unavailable Watchers 0
4580258900@ext-queues : Custom:QUEUE8025
890 State:Unavailable Watchers 0
45802418900@ext-queues : Custom:QUEUE8024189 State:Unavailable Watchers 0
4580248900@ext-queues : Custom:QUEUE8024
890 State:Unavailable Watchers 0
45802218900@ext-queues : Custom:QUEUE8022189 State:Unavailable Watchers 0
4580228900@ext-queues : Custom:QUEUE8022
890 State:Unavailable Watchers 0
4580218900@ext-queues : Custom:QUEUE8021890 State:Unavailable Watchers 0
4580208900@ext-queues : Custom:QUEUE8020
890 State:Unavailable Watchers 0
45801828900@ext-queues : Custom:QUEUE8018289 State:Unavailable Watchers 0
45801818900@ext-queues : Custom:QUEUE80181
89 State:Unavailable Watchers 0
4580188900@ext-queues : Custom:QUEUE8018890 State:Unavailable Watchers 0
45801718900@ext-queues : Custom:QUEUE80171
89 State:Unavailable Watchers 0
4580178900@ext-queues : Custom:QUEUE8017890 State:Unavailable Watchers 0
4580168900@ext-queues : Custom:QUEUE8016
890 State:Unavailable Watchers 0
45801518900@ext-queues : Custom:QUEUE8015189 State:Unavailable Watchers 0
4580158900@ext-queues : Custom:QUEUE8015
890 State:Unavailable Watchers 0
45801418900@ext-queues : Custom:QUEUE8014189 State:Unavailable Watchers 0
4580148900@ext-queues : Custom:QUEUE8014
890 State:Unavailable Watchers 0
4580128900@ext-queues : Custom:QUEUE8012890 State:Unavailable Watchers 0
45801018900@ext-queues : Custom:QUEUE80101
89 State:Unavailable Watchers 0
4580108900@ext-queues : Custom:QUEUE8010890 State:Unavailable Watchers 0
4580098900@ext-queues : Custom:QUEUE8009
890 State:Unavailable Watchers 0
4580088900@ext-queues : Custom:QUEUE8008890 State:Unavailable Watchers 1
45800718900@ext-queues : Custom:QUEUE80071
89 State:Unavailable Watchers 0
4580078900@ext-queues : Custom:QUEUE8007890 State:Unavailable Watchers 0
45800218900@ext-queues : Custom:QUEUE80021
89 State:Unavailable Watchers 0
4580028900@ext-queues : Custom:QUEUE8002*890 State:Unavailable

[root@pbx ~]# asterisk -rx 'sip show subscriptions’
Peer User Call ID Extension Last state Type Mailbox
192.168.16.121 8099 3c29223aa82 4580998900@fr Idle dialog-info+xml

it would appear something is wrong with your DEVSTATE function.

for starter, check if the function is there:

core show function DEVSTATE

(assuming Asterisk 1.4).

As far as not seeing anything with the “database show” it would substantiate DEVSTATE not being there. DEVSTATE uses an entry in CustomDevstate to keep track of its information. So:

database show CustomDevstate

should show something. Assuming you have your various amportal.conf variable set such as:

USEDEVSTATE=yes
USEQUEUESTATE=yes

you should get a bunch of stuff in those variables if using various server side functions such as DND, FollowMe, DAYNIGHT, etc.

Hi,

It appears this is a bug in the detection of the device state function in freepbx with patched 1.4 installations.

in user_login_out.agi:
$DEVSTATE = version_compare($ast_version, “1.6”, “ge”) ? “DEVICE_STATE” : “DEVSTATE”;

This line sets which function to use depending on asterisk version. Since I’m using 1.4 it assumes the function will be called DEVSTATE. The current devstate patch for 1.4 uses the same function name as 1.6, DEVICE_STATE. I edited the patch to rename the function to DEVSTATE and now everything works correctly.

It appears detection should just check for the availability of the function since it could be called DEVSTATE or DEVICE_STATE on 1.4 depending on which version of the patch is in use.

the same thing is used throughout many other parts of the FreePBX code.

the original patch that was written for 1.4 used DEVSTATE() and then they went and changed it to DEVICE_STATE() after the fact.

Sounds like there are a couple of versions floating around out there. Given that the history of DEVSTATE() in the 1.4 patch and the fact that various places point to obtaining the match from:

http://mirror.freepbx.org/func_devstate.c

we’ll probably leave it this way. Otherwise it means digging through the code of multiple other modules and doing calls into the manager to detect which if any of the versions of this function exist in deciding what to use. Once on 1.6, it always does it proper and that is where the function is officially supported.