Пример #1
0
        public bool IsCodecOnline(string sipAddress)
        {
            // Returnerar true om kodaren är registrerad och nåbar via sitt API, annars false

            if (string.IsNullOrEmpty(sipAddress))
            {
                return(false);
            }

            var allRegisteredSips = _registeredSipRepository.GetCachedRegisteredSips();
            var regSip            = allRegisteredSips.FirstOrDefault(s => s.Sip == sipAddress);

            if (regSip == null)
            {
                return(false);
            }

            CodecInformation codecInfo = _codecInformationRepository.GetCodecInformationBySipAddress(sipAddress);

            // Ping codec
            var available = _codecManager.CheckIfAvailable(codecInfo);

            return(available);
        }
Пример #2
0
        private CodecInformation GetCodecInformationBySipAddress(string sipAddress)
        {
            var codecInfo = _codecInformationRepository.GetCodecInformationBySipAddress(sipAddress);

            return(codecInfo == null || string.IsNullOrEmpty(codecInfo.Api) ? null : codecInfo);
        }