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. DND status update

DND status update

Scheduled Pinned Locked Moved Support
8 Posts 3 Posters 274 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.
  • R
    R
    ruslan
    wrote on last edited by
    #1

    Hi,
    If I change the status of a FOP2 on the "Do not Disturb",

    CLI> database show
    /fop2state/SIP/10194                              : Do not Disturb
    

    If I change the status from asterisk

    exten => 777,1,Answer()
    exten => 777,n,Wait(1)
    exten => 777,n,Set(CHAN=${CUT(CHANNEL,-,1)})
    exten => 777,n,Set(DB(fop2state/${CHAN})=Break)
    
    CLI> database show
    /fop2state/SIP/10194                              : Break
    

    but the button in the FOP2 status remains "Do not Disturb", until I restart fop2 service.
    How do I update a user's status?

    asterisk 1.8
    centos 6.2
    fop2 2.26

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

      You must fire a user event for real time notifications. Astdb entries are for persistent storage of that state, but those changes are not notified/broadcasted via ami. Try something like this:

      
      exten => 777,1,Answer()
      exten => 777,n,Wait(1)
      exten => 777,n,Set(CHAN=${CUT(CHANNEL,-,1)})
      exten => 777,n,Set(DB(fop2state/${CHAN})=Break)
      exten => 777,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: Break )
      
      1 Reply Last reply
      0
      • R
        R
        ruslan
        wrote on last edited by
        #3

        Thanks, its work 😄

        1 Reply Last reply
        0
        • R
          R
          ruslan
          wrote on last edited by
          #4

          Hello,
          Another problem, I need to change in stutus through AMI.

          asterisk -rx "database put fop2state SIP/00049 Break"
          
          CLI> database show
          /fop2state/SIP/00049                              : Break 
          

          When running UserEvent over AMI

          Action: UserEvent
          UserEvent: FOP2ASTDB
          Family: fop2state
          Channel: SIP/0049
          Value: Break
          
          [root@aster ~]# ./ami 
          spawn telnet 127.0.0.1 5038
          Trying 127.0.0.1...
          Action: Login
          Username: admin
          Secret: amp111
          Events: off
          
          Action: UserEvent
          UserEvent: FOP2ASTDB
          Family: fop2state
          Channel: 00049
          Value: Break
          
          Connected to 127.0.0.1.
          Escape character is '^]'.
          Asterisk Call Manager/1.1
          Response: Success
          Message: Authentication accepted
          
          Response: Success
          Message: Event Sent
          

          But in the FOP2 user status does not change

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

            The Channel is wrong on one of your pasted events, it does not include SIP/

            1 Reply Last reply
            0
            • R
              R
              ruslan
              wrote on last edited by
              #6

              :oops:
              thanks

              1 Reply Last reply
              0
              • D
                D
                dstamour
                wrote on last edited by
                #7

                I know this tread has been inactive for a while but I'am working on a similar project. What value to "UserEvent" should I use when the user becomes "Available"? I delete the database entry but I wonder what to do so the FOP2 status doesn't display anything.

                An empty Value?

                Action: UserEvent
                UserEvent: FOP2ASTDB
                Family: fop2state
                Channel: SIP/{EXT}
                Value: 
                

                Thanks
                Daniel

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

                  As you guessed, you must pass an empty value to clear the presence state.

                  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