AMI Eventmask Question

Home » Asterisk Users » AMI Eventmask Question
Asterisk Users 7 Comments

I’m creating an AMI client and I only want to get newchannel events (as well as responses to any actions I initiate). What would I set the eventmask to to only get the newchannel events?

For anyone else looking…is there a table somewhere online that maps events to their eventmask categories? I checked the asterisk wiki and voip-info but can’t find this…

7 thoughts on - AMI Eventmask Question

  • That’s an interesting link – I didn’t know you could set a per user eventfilter in the conf file

    However, I’m hoping to do this in the AMI connection for more flexibility. Upon login, you can specify the event mask to restrict the type of events sent over the AMI connection. Looking through the Asterisk code I think Newchannel falls under the ‘call’ event flag…but it would be nice to restrict this even further (since lots of events fall under ‘call’).

  • Ah, I remember what you’re talking about now

    https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+ManagerAction_Events

    That’s the link to the Asterisk 12 AMI docs, the specs changed in 12 and some events are different but it’s the best docs available for the AMI in my opinion – the specs didn’t change much at all.

    So in answer to your question, using EventMask, I don’t think this is possible as EventMask only works with those blocks of permissions, like call and security. If you wanted to only get the one event type then you’d need to do that in manager.conf – I may be wrong on that, I haven’t looked at the source code or anything but from what the docs say, and the docs are generated from the source code now, you can only specifiy those larger blocks,

    Hope I’ve helped,

    Dan

  • Thanks – I’ve been through that doc before and couldn’t find the info needed, which is why I went to the source code eventually.

    All events are grouped, and each group is given a name/flag like ‘system’, ‘call’, etc. The docs just don’t say which events are in which group/flag.

    Perhaps something Digium could add at some point 🙂

  • Or someone from the open source community… this is an open source project, after all 🙂

    The managerEventInstance XML elements already have an attribute for the manager class, which is populated:



    Raised when a parked call times out.
    The parking lot extension. The name of the parking lot.

    ParkedCall


    You could actually grep the core-en_US.xml file and get all of the events that match to a particular class authorization.

    It doesn’t show up in the CLI due to the xmldoc API not parsing out that attribute. The same is true for the wiki documentation; that project is up on github [1]. It wouldn’t be a large patch to either to have that attribute displayed.

    Matt

    [1] https://github.com/asterisk/publish-docs

  • Thanks Matt, I was going to ask where the tool was that generated from source, I’ll take a look and see if I can contribute that back,

    Dan