Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. Getting DND (presence) status via php

Getting DND (presence) status via php

Scheduled Pinned Locked Moved Support
10 Posts 2 Posters 172 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    tbolick
    wrote on last edited by
    #1

    I'm trying to make a simple webpage to show a single extension's status. I'm going to use this as their phone idle screen. How do I retrieve the status for a single extension via a standalone php page?

    Thanks.

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • T
        T
        tbolick
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • N
          N
          nicolas
          wrote on last edited by
          #4

          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,

          1 Reply Last reply
          0
          • T
            T
            tbolick
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • N
              N
              nicolas
              wrote on last edited by
              #6

              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"

              1 Reply Last reply
              0
              • T
                T
                tbolick
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • N
                  N
                  nicolas
                  wrote on last edited by
                  #8

                  If you mouse over the icon, it will display the full presence text.

                  Best regards,

                  1 Reply Last reply
                  0
                  • T
                    T
                    tbolick
                    wrote on last edited by
                    #9

                    just wondering if it could be displayed all the time without having to use the mouseover.

                    1 Reply Last reply
                    0
                    • N
                      N
                      nicolas
                      wrote on last edited by
                      #10

                      just wondering if it could be displayed all the time without having to use the mouseover.

                      Not without coding. It might be possible to use jcallbakc.js hacks to do something about it, but I am not totally sure.

                      1 Reply Last reply
                      0

                      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
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups