Manually set extension states

Hello,
I have a custom application where I want certain events to trigger extension states automatically. For example, I'd like to be able to say extension 3200 is busy and get the counter started without actually generating a telephone call. Then I'd like to be able to mark it offline, online, inuse, busy, etc manually either by dbset or some other external script.

In addition, I'd really like to make 4-5 different "states' an extension can be in and have the whole box change color (like busy->idle, but more states).

Is this possible?

Thanks,
Brett

Comments

  • Sorry. I do not think it is possible without rewriting or heavily modifying the whole thing: both client and server. You will have to use AMI Userevents for that, astdb is not enough. But it must be used too to have persistent fake states. The fop2 presence works like that, using astdb to store the presence state. And you can have any number of presence states, but they affect only the presence icon, not the whole button color.
  • Hi guys,

    I am doing a quite similar things on my asterisk and am having some issue with my users states.

    I am using Adhearsion (a fully featured framework using ruby) to logon / logoff my user on a device. But The thing is I have no idea on how to change or set my user's state so that I can see him online or offline on the FOP2 web interface. When I'm using my script, the user is logged on the device but on the interface he still grey (shown as offline).

    Where is this state data stored in the astdb? or how can I do to be able to reflect my user's real state?

    Thanks for your help
  • The gray state in fop2 is the sip registration/qualify status. It is not set in astdb, it is informed by asterisk using manager events. Best regards,
  • ok, how can I catch those events to be able to change my user's state from offline to online for exemple? Because when I'm using my script, the user's state is not changing so i'm missing a bit of code that will allow me to make this change.
  • You cannot change that state, you can change the presence state, or maybe the DND state, but not the registered state (grayed out button).

    Here is the user event needed to change presence state:
    Action: UserEvent
    UserEvent: FOP2ASTDB
    Family: fop2state
    Channel: SIP/606
    Value: Break
    

    At the same time you must set that state in the astdb if you want it to be persistent:
    /fop2state/SIP/606                                : Break 
    

    The best way to play with your custom states is to start fop2_server in debug mode level 15
    /usr/local/fop2/fop2_server -X 15
    

    Best regards,
Sign In or Register to comment.