Can ARI notify that an endpoint has its state changed?

Hello,

Is it possible for a web application communicating with Asterisk through Asterisk REST Interface to receive an event or a notification anytime an endpoint has its state changing from online to offline, for instance ?
If positive, how can it be done ?

Best regards

You can subscribe to receive events for an endpoint[1] which will then raise an EndpointStateChange[2] containing an Endpoint with state[3].

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

I’m sorry but after reading [1], I can’t find the {applicationName} I should use to receive EndpointStateChanges (as in POST /applications/{applicationName}/subscription).

It’s the name of your ARI application that you have connected to Asterisk on Websocket.

For a start, I would like to set a Web Dashboard application that would passively monitor Voicemail activity or PJSIP endpoints connectivity and presents this data to users.

I tried this:
wscat -c “ws://localhost:8088/ari/events?ari_key=asterisk:asterisk&app=hello”

This seems to only display whatever is sent to “hello” app through a “Stasis(hello)” statement in dialplan.

Can this dashboard be done using ARI ?

ARI is not a full suite of events - for example there are none for voicemail. If you want to get events for more, then AMI is the API to use.