Beispiel #1
0
        public void SaveComment(RegisteredSipComment sipComment)
        {
            _userRepository.UpdateComment(sipComment.RegisteredSipUserName, sipComment.Comment);

            // Invalidate registered sip in cache
            _cache.ClearRegisteredSips();
        }
        public KamailioMessageHandlerResult UpdateRegisteredSip(RegisteredSip registeredSip)
        {
            var result = _internalRepository.UpdateRegisteredSip(registeredSip);

            // When reregistration of codec already in cache, just update timestamp
            if (result.ChangeStatus == KamailioMessageChangeStatus.NothingChanged && result.ChangedObjectId != Guid.Empty)
            {
                var regSip = GetCachedRegisteredSips().FirstOrDefault(rs => rs.Id == result.ChangedObjectId);
                if (regSip != null)
                {
                    regSip.Updated = DateTime.UtcNow;
                    return(result);
                }
            }

            // Otherwise reload cache.
            _lazyCache.ClearRegisteredSips();
            return(result);
        }
Beispiel #3
0
 public void UpdateCall(Call call)
 {
     _internalRepository.UpdateCall(call);
     // Some registered codecs may have changed state. Reload cache.
     _lazyCache.ClearRegisteredSips();
 }
Beispiel #4
0
 public static void FullReload(this IAppCache cache)
 {
     cache.ClearRegisteredSips();
     cache.ResetLocationNetworks();
     cache.ResetSettings();
 }