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.
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.
[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.
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:
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.