My application connects using the Asterisk Management Interface (AMI) but at startup I don't want to be flooded by all events generated by Asterisk. I want to be able to select which events should be transmitted.
Using the Events command I can decide which events should be transmitted. Unfortunately from the moment I login until the moment I submit this command my application is flooded by events.
A non-documented feature of the login action allows us to set the event mask that we are interested in at Login.
This pull request allows you to pass an array of events:
var namiConfig = {
host: process.argv[2],
port: process.argv[3],
username: process.argv[4],
secret: process.argv[5],
events: ['system', 'call']
};
var nami = new namiLib.Nami(namiConfig);
When the events option is omitted Nami does not set the event mask on the login action.
I have an Asterisk instance that generates a great amount of events. The manager is configured to authorize all events:
My application connects using the Asterisk Management Interface (AMI) but at startup I don't want to be flooded by all events generated by Asterisk. I want to be able to select which events should be transmitted.
Using the Events command I can decide which events should be transmitted. Unfortunately from the moment I login until the moment I submit this command my application is flooded by events.
A non-documented feature of the login action allows us to set the event mask that we are interested in at Login.
This pull request allows you to pass an array of events:
When the events option is omitted Nami does not set the event mask on the login action.
Similar to #13 but less intrusive.