How to Listen for Events ( ari-client or asterisk-ami-client )

Hi,
Is it possible to listen for various events like “Newchannel”, " BridgeCreate" etc through ari-client OR should we use “asterisk-ami-client” ?

What will be the recommended approach…

PLEASE HELP.

AMI gives you more events and is generally for globally monitoring. ARI gives you less events, specifically events that would be needed to implement an ARI telephony application. It depends on what is trying to be achieved.

1 Like

Thanks…
In the case of ARI, should we explicitly enable “events” in ari.conf Or any other configuration files.

No. You subscribe to the producers you want[1] events from with optional filtering[2] over the REST interface. To subscribe to receive all events for channels, for example, you would subscribe to “channel:”. Events are documented as well[3]. As I mentioned, though, AMI has more events for more things.

[1] Applications - Asterisk Documentation
[2] Applications - Asterisk Documentation
[3] Asterisk REST Data Models - Asterisk Documentation

1 Like

I have found that AMI events are sometimes inconsistent. For example, you Originate a call, and expect to see Progress events as it rings, but sometimes these are not sent. Also I would expect to see a Hangup event when a call ends, but sometimes these disappear, too. So I have to look for HangupRequest and SoftHangupRequest as well.

Thanks for the input.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.