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*[email protected]|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

[[email protected] ~]# asterisk -rx ‘show hints’ | grep QUEUE
458999[email protected] : Custom:QUEUE8999890 State:Unavailable Watchers 0
458099[email protected] : Custom:QUEUE8099
890 State:Unavailable Watchers 1
458095[email protected] : Custom:QUEUE8095890 State:Unavailable Watchers 0
458094[email protected] : Custom:QUEUE8094
890 State:Unavailable Watchers 0
458093[email protected] : Custom:QUEUE8093890 State:Unavailable Watchers 0
458092[email protected] : Custom:QUEUE8092
890 State:Unavailable Watchers 0
458091[email protected] : Custom:QUEUE8091890 State:Unavailable Watchers 0
458077[email protected] : Custom:QUEUE8077
890 State:Unavailable Watchers 0
458031[email protected] : Custom:QUEUE8031890 State:Unavailable Watchers 0
4580301[email protected] : Custom:QUEUE80301
89 State:Unavailable Watchers 0
458030[email protected] : Custom:QUEUE8030890 State:Unavailable Watchers 0
4580291[email protected] : Custom:QUEUE80291
89 State:Unavailable Watchers 0
458029[email protected] : Custom:QUEUE8029890 State:Unavailable Watchers 0
458028[email protected] : Custom:QUEUE8028
890 State:Unavailable Watchers 0
4580271[email protected] : Custom:QUEUE8027189 State:Unavailable Watchers 0
458027[email protected] : Custom:QUEUE8027
890 State:Unavailable Watchers 0
4580261[email protected] : Custom:QUEUE8026189 State:Unavailable Watchers 0
458026[email protected] : Custom:QUEUE8026
890 State:Unavailable Watchers 0
4580251[email protected] : Custom:QUEUE8025189 State:Unavailable Watchers 0
458025[email protected] : Custom:QUEUE8025
890 State:Unavailable Watchers 0
4580241[email protected] : Custom:QUEUE8024189 State:Unavailable Watchers 0
458024[email protected] : Custom:QUEUE8024
890 State:Unavailable Watchers 0
4580221[email protected] : Custom:QUEUE8022189 State:Unavailable Watchers 0
458022[email protected] : Custom:QUEUE8022
890 State:Unavailable Watchers 0
458021[email protected] : Custom:QUEUE8021890 State:Unavailable Watchers 0
458020[email protected] : Custom:QUEUE8020
890 State:Unavailable Watchers 0
4580182[email protected] : Custom:QUEUE8018289 State:Unavailable Watchers 0
4580181[email protected] : Custom:QUEUE80181
89 State:Unavailable Watchers 0
458018[email protected] : Custom:QUEUE8018890 State:Unavailable Watchers 0
4580171[email protected] : Custom:QUEUE80171
89 State:Unavailable Watchers 0
458017[email protected] : Custom:QUEUE8017890 State:Unavailable Watchers 0
458016[email protected] : Custom:QUEUE8016
890 State:Unavailable Watchers 0
4580151[email protected] : Custom:QUEUE8015189 State:Unavailable Watchers 0
458015[email protected] : Custom:QUEUE8015
890 State:Unavailable Watchers 0
4580141[email protected] : Custom:QUEUE8014189 State:Unavailable Watchers 0
458014[email protected] : Custom:QUEUE8014
890 State:Unavailable Watchers 0
458012[email protected] : Custom:QUEUE8012890 State:Unavailable Watchers 0
4580101[email protected] : Custom:QUEUE80101
89 State:Unavailable Watchers 0
458010[email protected] : Custom:QUEUE8010890 State:Unavailable Watchers 0
458009[email protected] : Custom:QUEUE8009
890 State:Unavailable Watchers 0
458008[email protected] : Custom:QUEUE8008890 State:Unavailable Watchers 1
4580071[email protected] : Custom:QUEUE80071
89 State:Unavailable Watchers 0
458007[email protected] : Custom:QUEUE8007890 State:Unavailable Watchers 0
4580021[email protected] : Custom:QUEUE80021
89 State:Unavailable Watchers 0
458002[email protected] : Custom:QUEUE8002*890 State:Unavailable

[[email protected] ~]# asterisk -rx 'sip show subscriptions’
Peer User Call ID Extension Last state Type Mailbox
192.168.16.121 8099 3c29223aa82 458099[email protected] 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.