瀏覽代碼

callcache

dss 2 年之前
父節點
當前提交
f209aefa01

+ 3 - 3
src/CallCenter.Application/Handlers/BaseHandler.cs

@@ -80,9 +80,6 @@ namespace CallCenter.Application.Handlers
                                     Visitor = new VisitorToExtQueueVisitor() { Id = model.ConversationId }
                                 }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
 
-                                //处理队列记录
-                                _callCacheManager.AddCallCache(model);
-
                                 break;
                             case ECallType.ExtToOuter:
                                 await _newRockClient.OuterToExt(new OuterToExtRequest()
@@ -110,6 +107,9 @@ namespace CallCenter.Application.Handlers
                             Group = new VisitorToGroupQueueGroup() { Id = groupId },
                             Visitor = new VisitorToGroupQueueVisitor() { Id = model.ConversationId }
                         }, _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
+
+                        //处理队列记录
+                        _callCacheManager.AddCallCache(model);
                         break;
                     case EIvrAnswerType.Out:
                         var phoneNo = ivrAnswer.Content;

+ 1 - 1
src/CallCenter/Caches/CallCacheManager.cs

@@ -39,7 +39,7 @@ namespace CallCenter.Caches
             var list = _cacheCall.Get(CallKey)?.ToList();
             if (list != null)
             {
-                var model = list.First(x => x.Id == id);
+                var model = list.FirstOrDefault(x => x.Id == id);
                 if (model != null)
                 {
                     list.Remove(model);

+ 1 - 1
src/CallCenter/Caches/UserCacheManager.cs

@@ -102,7 +102,7 @@ public class UserCacheManager : IUserCacheManager, IScopeDependency
         var list = _cacheWorks.Get(WorkKey)?.ToList();
         if (list!=null)
         {
-            var model = list.First(x => x.Id == id);
+            var model = list.FirstOrDefault(x => x.Id == id);
             if (model!=null)
             {
                 list.Remove(model);