Get all events from Asterisk 12

Jul 21, 2014 at 1:11 PM
Edited Jul 21, 2014 at 1:12 PM
In my application I want to show a real time overview of all active calls on a asterisk server.

That's why I want to get all events (channel created/destroyed etc.) from Asterisk 12 server using the Asterisk 12 REST API (ARI).

I am using the following code:
// Create a message client to receive events on
Client = new ARIClient(
    new StasisEndpoint(Host, Port, Username, Password),
Client.OnChannelStateChangeEvent += Client_OnChannelStateChangeEvent;
The method Client_OnChannelStateChangeEvent is only called for calls that I have originated by my application using Client.Channels.Originate(...). But I want it to be called also for other calls (e.g. incoming calls).

How can I achieve that?

Jul 21, 2014 at 2:47 PM
Hi dennis,

I'm not 100% sure if ARI is currently the right way to proceed. You have to subscribe to channel events, there for you have to know about a channel before you can subscribe to it's events. For example, if I create a bridge using an ARI Application, then I automatically get subscribed to it's events, but if I don't then I have to request that subscription.

Maybe you should consider using AMI to look for events?

Is there a specific reason why you're wanting to use ARI?
Marked as answer by skrusty on 10/5/2014 at 12:14 PM