public CdeApi(ILogger <CdeApi> logger, IMediator mediator) { this.logger = logger; localDirectory = Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location); cde = new Cde(localDirectory); calls = new CdeCallsThreadSafe(logger, cde, mediator); audio = new CdeAudio(logger, cde, mediator); groups = new CdeGroups(logger, cde, mediator); cde.Affiliations.AffiliationStateChanged += Affiliations_AffiliationStateChanged; cde.SubscriberConfigurationChanged += Cde_SubscriberConfigurationChanged; cde.LogEnabled = true; cde.LogFilterOptions.FatalErrorEnabled = true; cde.LogFilterOptions.ErrorEnabled = true; cde.LogFilterOptions.WarningEnabled = true; cde.LogFilterOptions.InformationEnabled = true; cde.LogFilterOptions.VerboseEnabled = true; cde.LogFilterOptions.DebugEnabled = true; cde.LogMessageAvailable += Cde_LogMessageAvailable; }
public CdeGroups(ILogger logger, ICde cde, IMediator mediator) { this.logger = logger; this.cde = cde; this.mediator = mediator; groups = new CdeGroupStore(); cde.StateChanged += Cde_StateChanged; cde.GroupManagement.PresenceInfoList += GroupManagement_PresenceInfoList; }
public CdeAudio(ILogger <CdeApi> logger, ICde cde, IMediator mediator) { this.logger = logger; this.cde = cde; this.mediator = mediator; this.audioInput = new AudioInput(); audioInput.DataAvailable += AudioInput_DataAvailable; cde.AudioPlaybackFrameAvailable += Cde_AudioPlaybackFrameAvailable; }
public CdeCalls(ILogger <CdeApi> logger, ICde cde, IMediator mediator) { this.logger = logger; this.cde = cde; this.mediator = mediator; callStore = new CdeCallStore(); cde.Calling.CallStatusChanged += Calling_CallStatusChanged; cde.Calling.IncomingCall += Calling_IncomingCall; cde.Calling.CallInfo += Calling_CallInfo; }
public CdeCallsThreadSafe(ILogger logger, ICde cde, IMediator mediator) { callStore = new CdeCallStore(); cde.Calling.CallStatusChanged += (sender, e) => { logger.LogInformation("[{EventName}] {@EventArgs}", "CallStatusChanged", e); cdeEvents.Add(new CdeCall { CallStatusChanged = e }); }; cde.Calling.IncomingCall += (sender, e) => { logger.LogInformation("[{EventName}] {@EventArgs}", "IncomingCall", e); cdeEvents.Add(new CdeCall { IncomingCall = e }); }; cde.Calling.CallInfo += (sender, e) => { logger.LogInformation("[{EventName}] {@EventArgs}", "CallInfo", e); cdeEvents.Add(new CdeCall { CallInfo = e }); }; this.logger = logger; this.cde = cde; this.mediator = mediator; Task.Run(StartEventProcessing); }