static void Main(string[] args) { try { endPoint = new StasisEndpoint("ipaddress", 8088, "username", "password"); // Create a message actionClient to receive events on actionClient = new AriClient(endPoint, "playrec_test"); actionClient.OnStasisStartEvent += c_OnStasisStartEvent; actionClient.OnStasisEndEvent += c_OnStasisEndEvent; actionClient.OnRecordingFinishedEvent += ActionClientOnRecordingFinishedEvent; actionClient.Connect(); bool done = false; while (!done) { var lastKey = Console.ReadKey(); switch (lastKey.KeyChar.ToString()) { case "*": done = true; break; } } actionClient.Disconnect(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); Console.ReadKey(); } }
/// <summary> /// </summary> /// <param name="endPoint"></param> /// <param name="application"></param> /// <param name="subscribeAllEvents">Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions.</param> /// <param name="ssl">Enable SSL/TLS support for ARI connection</param> public AriClient( StasisEndpoint endPoint, string application, bool subscribeAllEvents = false, bool ssl = false) // Use Default Middleware : this(new RestActionConsumer(endPoint), new WebSocketEventProducer(endPoint, application), application, subscribeAllEvents, ssl) { }
/// <summary> /// </summary> /// <param name="endPoint"></param> /// <param name="application"></param> public AriClient(StasisEndpoint endPoint, string application) // Use Default Middleware : this(new RestActionConsumer(endPoint), new WebSocketEventProducer(endPoint, application), application) { }