예제 #1
0
파일: CdeApi.cs 프로젝트: vivaladan/KOps
        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;
        }
예제 #2
0
파일: CdeGroups.cs 프로젝트: vivaladan/KOps
        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;
        }
예제 #3
0
파일: CdeAudio.cs 프로젝트: vivaladan/KOps
        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;
        }
예제 #4
0
파일: CdeCalls.cs 프로젝트: vivaladan/KOps
        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;
        }
예제 #5
0
        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);
        }