Getting DND (presence) status via php
-
-
Hi,
FOP2 is not a php application. If you want to retrieve asterisk status from a php application the easier and best option is to enable AJAM in asterisk and use that.
https://wiki.asterisk.org/wiki/display/ ... s+via+HTTP
FOP2 uses a socket connection and custom protocol that is much much harder to work on, and it does not have a way to "query" for individual status.
-
I was hoping that the status info was somehow available in a file or other database that could be accessed directly. I want to allow people to use the user panel to set their status and then query that status as well. I wonder if a callback to store that status elsewhere would work.
-
Fop2 has its own daemon that has its own state machine. It does not store data in any database or anything like it. If you want to see how fop2 talks to its clients, you can run it with debug level 12 and capture output. However, as I said before, it is not the right tool for the job in your case. You should be using ajam.
Best regards,
-
If you say so. I just thought there was somewhere that stored I'd set my status in FOP2 to be "out to lunch". since I can restart the service and retain that info (can't I?) I am not looking for off hook or in call, just the DND status.
I really think a little API option to set and query statuses would be useful, but maybe that's another product.
Tom...
-
I am sorry, I read your message (body) and did not pay much attention to the subject. I was talking about status (busy,fre,ringing) but you were talking about presence. In that case you can query the asterisk database (astdb) where that value is stored (family fop2state). And you can use Ajam to retrieve that value or asterisk itself:
asterisk -rx "database show fop2state"
-
This was exactly what I needed, and I learned some extra stuff as well. I now have the idlehome screen of my phone showing my DND presence.
Them only other thing I'd like to see is have the panel show the presence as text in addition to the color/hint on the FOP2 panel.
Thanks
-
-
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login