DND status update

  1. 12 years ago

    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

  2. admin

    31 Aug 2012 Administrator

    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 )
  3. Thanks, its work :D

  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

  5. admin

    18 Sep 2012 Administrator

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

  6. :oops:
    thanks

  7. 10 years ago

    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

  8. admin

    3 Feb 2014 Administrator

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

or Sign Up to reply!