Exemple #1
0
        public IHttpActionResult GetRegisteredSipInfo(Guid id)
        {
            // Called when the user clicked on a codec in the GUI to show
            // detailed information, including codec control GUI, for the codec.

            RegisteredSipDetails regSipDetails = _registeredSipDetailsRepository.GetRegisteredSipById(id);

            if (regSipDetails == null)
            {
                return(NotFound());
            }

            var call = _callRepository.GetCallBySipAddress(regSipDetails.Sip);

            var model = new RegisteredSipInfoViewModel
            {
                IsAuthenticated = User.Identity.IsAuthenticated,

                Id              = regSipDetails.Id,
                Sip             = regSipDetails.Sip,
                CodecControl    = ShouldShowCodecControlView(regSipDetails),
                Comment         = regSipDetails.Comment,
                DisplayName     = GetDisplayName(regSipDetails),
                Ip              = regSipDetails.Ip,
                UserAgentHeader = regSipDetails.UserAgentHeader,
                Registrar       = regSipDetails.Registrar,

                Image               = regSipDetails.Image,
                ActiveX             = regSipDetails.ActiveX,
                Width               = regSipDetails.Width,
                Height              = regSipDetails.Height,
                UserInterfaceLink   = regSipDetails.UserInterfaceLink,
                UserInterfaceIsOpen = regSipDetails.UserInterfaceIsOpen,
                UseScrollbars       = regSipDetails.UseScrollbars,
                Inputs              = regSipDetails.Inputs,
                InputMaxDb          = regSipDetails.InputMaxDb,
                InputMinDb          = regSipDetails.InputMinDb,
                InputGainStep       = regSipDetails.InputGainStep,
                Lines               = regSipDetails.Lines,
                CodecPresets        = regSipDetails.CodecPresets,

                LocationName    = regSipDetails.LocationName,
                LocationComment = regSipDetails.LocationComment,
                CityName        = regSipDetails.CityName,
                RegionName      = regSipDetails.RegionName,
                InCall          = call != null,
                InCallWithName  = call != null?GetInCallWith(regSipDetails, call) : string.Empty
            };

            return(Ok(model));
        }
Exemple #2
0
        private SipEventHandlerResult UnregisterCodec(SipRegistrationExpireMessage expireMessage, string regType = null)
        {
            var sipAddress = expireMessage.SipAddress.UserAtHost;

            if (regType == "delete")
            {
                log.Info($"Unregister Codec {sipAddress}, {regType}");
                Call codecCall = _callRepository.GetCallBySipAddress(sipAddress);
                if (codecCall != null)
                {
                    log.Info($"Unregistrating codec but it's in a call {sipAddress}");
                }
            }
            return(_sipRepository.DeleteRegisteredSip(sipAddress));
        }
Exemple #3
0
 public Call GetCallBySipAddress(string sipAddress)
 {
     return(_internalRepository.GetCallBySipAddress(sipAddress));
 }