public AriClient( IActionConsumer actionConsumer, IEventProducer eventProducer, string application, bool subscribeAllEvents = false, bool ssl = false) { _actionConsumer = actionConsumer; _eventProducer = eventProducer; EventDispatchingStrategy = DefaultEventDispatchingStrategy; // Setup Action Properties Asterisk = new AsteriskActions(_actionConsumer); Applications = new ApplicationsActions(_actionConsumer); Bridges = new BridgesActions(_actionConsumer); Channels = new ChannelsActions(_actionConsumer); DeviceStates = new DeviceStatesActions(_actionConsumer); Endpoints = new EndpointsActions(_actionConsumer); Events = new EventsActions(_actionConsumer); Mailboxes = new MailboxesActions(_actionConsumer); Playbacks = new PlaybacksActions(_actionConsumer); Recordings = new RecordingsActions(_actionConsumer); Sounds = new SoundsActions(_actionConsumer); // Setup Event Handlers _eventProducer.OnMessageReceived += _eventProducer_OnMessageReceived; _eventProducer.OnConnectionStateChanged += _eventProducer_OnConnectionStateChanged; _subscribeAllEvents = subscribeAllEvents; _ssl = ssl; }
public AriClient(IActionConsumer actionConsumer, IEventProducer eventProducer, string application) { _actionConsumer = actionConsumer; _eventProducer = eventProducer; EventDispatchingStrategy = DefaultEventDispatchingStrategy; // Setup Action Properties Asterisk = new AsteriskActions(_actionConsumer); Applications = new ApplicationsActions(_actionConsumer); Bridges = new BridgesActions(_actionConsumer); Channels = new ChannelsActions(_actionConsumer); DeviceStates = new DeviceStatesActions(_actionConsumer); Endpoints = new EndpointsActions(_actionConsumer); Events = new EventsActions(_actionConsumer); Mailboxes = new MailboxesActions(_actionConsumer); Playbacks = new PlaybacksActions(_actionConsumer); Recordings = new RecordingsActions(_actionConsumer); Sounds = new SoundsActions(_actionConsumer); // Setup Event Handlers _eventProducer.OnMessageReceived += _eventProducer_OnMessageReceived; _eventProducer.OnConnectionStateChanged += _eventProducer_OnConnectionStateChanged; }