瀏覽代碼

event query orderby

dss 2 年之前
父節點
當前提交
663ddbc918
共有 27 個文件被更改,包括 46 次插入38 次删除
  1. 1 1
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertExtToOuterNotificationHandler.cs
  2. 1 1
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertMenuToOuterNotificationHandler.cs
  3. 1 1
      src/Hotline.Application/Handlers/CallCenter/CallState/AlertVisitorToExtNotificationHandler.cs
  4. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/DtmfNotificationHandler.cs
  5. 1 1
      src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToExtNotificationHandler.cs
  6. 2 2
      src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToOuterNotificationHandler.cs
  7. 1 1
      src/Hotline.Application/Handlers/CallCenter/CallState/RingVisitorToExtNotificationHandler.cs
  8. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToExtNoificationHandler.cs
  9. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToOuterNotificationHandler.cs
  10. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerViisitorToExtNotificationHandler.cs
  11. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToExtNotificationHandler.cs
  12. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterNotificationHandler.cs
  13. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterToExtNotificationHandler.cs
  14. 7 5
      src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredVisitorToExtNotificationHandler.cs
  15. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndExtNotificationHandler.cs
  16. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterOneNotificationHandler.cs
  17. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterTwoNotificationHandler.cs
  18. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeOuterAndOuterNotificationHandler.cs
  19. 11 6
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndExtNotificationHandler.cs
  20. 2 2
      src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorOffNotificationHandler.cs
  21. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/CdrNotificationHandler.cs
  22. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/DivertVisitorToExtNotificationHandler.cs
  23. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnOuterToMenuNotificationHandler.cs
  24. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnVisitorToMenuNotificationHandler.cs
  25. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/IncomingNotificationHandler.cs
  26. 1 1
      src/Hotline.Application/Handlers/CallCenter/FlowControl/QueueVisitorToGroupBusyNotificationHandler.cs
  27. 1 0
      src/Hotline.NewRock/Handlers/DeviceEventHandler.cs

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/CallState/AlertExtToOuterNotificationHandler.cs

@@ -25,7 +25,7 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
             string telNo = notification.Outer.From != "" ? notification.Outer.From : notification.TelNo;
             if (!string.IsNullOrEmpty(telNo))
             {
-                var model =await _callRepository.GetAsync(x => x.ConversationId==notification.Outer.Id && x.ToNo==notification.Outer.To && x.Trunk==notification.Outer.Trunk && x.CreationTime>=DateTime.Now.AddHours(-2), cancellationToken);
+                var model =await _callRepository.GetAsync(x => x.ConversationId==notification.Outer.Id && x.ToNo==notification.Outer.To && x.Trunk==notification.Outer.Trunk && x.CreationTime>=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
                 //如果存在
                 if (model!=null)
                 {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/CallState/AlertMenuToOuterNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Outer.Id && x.ToNo == notification.Outer.To &&
-                     x.Trunk == notification.Outer.Trunk && x.CreationTime >= DateTime.Now.AddHours(-2),
+                     x.Trunk == notification.Outer.Trunk && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime,
                 cancellationToken);
             if (model!=null)
             {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/CallState/AlertVisitorToExtNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id &&
-                     x.FromNo == notification.Visitor.From && x.CreationTime>=DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Visitor.From && x.CreationTime>=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = ECallStatus.Alert;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/DtmfNotificationHandler.cs

@@ -31,12 +31,12 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
             string info = string.Empty;
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id && x.FromNo == notification.Visitor.From &&
-                     x.ToNo == notification.Visitor.To, cancellationToken);
+                     x.ToNo == notification.Visitor.To,true,x=>x.CreationTime, cancellationToken);
             if (model == null)
             {
                 model = await _callRepository.GetAsync(
                     x => x.ConversationId == notification.Outer.Id && x.FromNo == notification.Outer.From &&
-                         x.ToNo == notification.Outer.To, cancellationToken);
+                         x.ToNo == notification.Outer.To,true,x=>x.CreationTime, cancellationToken);
                 isvis = false;
             }
             if (model != null)

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToExtNotificationHandler.cs

@@ -30,7 +30,7 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
 
         public async Task Handle(RingExtToExtNotification notification, CancellationToken cancellationToken)
         {
-            var model = await _callRepository.GetAsync(x=>x.FromNo == notification.FromTelNo && x.ToNo== notification.ToTelNo && x.CallStatus == Share.Enums.CallCenter.ECallStatus.Alert && x.CreationTime >= DateTime.Now.AddHours(-1), cancellationToken);
+            var model = await _callRepository.GetAsync(x=>x.FromNo == notification.FromTelNo && x.ToNo== notification.ToTelNo && x.CallStatus == Share.Enums.CallCenter.ECallStatus.Alert && x.CreationTime >= DateTime.Now.AddHours(-1),true,x=>x.CreationTime, cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = Share.Enums.CallCenter.ECallStatus.Ring;

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/CallState/RingExtToOuterNotificationHandler.cs

@@ -22,12 +22,12 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
         public async Task Handle(RingExtToOuterNotification notification, CancellationToken cancellationToken)
         {
             var model = await _callRepository.GetAsync(x =>
-                x.FromNo == notification.TelNo && x.ToNo == notification.Outer.To && x.CreationTime >=DateTime.Now.AddHours(-2), cancellationToken);
+                x.FromNo == notification.TelNo && x.ToNo == notification.Outer.To && x.CreationTime >=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model==null)
             {
                 model = await _callRepository.GetAsync(
                     x => x.ConversationId == notification.Outer.Id && x.ToNo == notification.Outer.To &&
-                         x.Trunk == notification.Outer.Trunk, cancellationToken);
+                         x.Trunk == notification.Outer.Trunk,true,x=>x.CreationTime, cancellationToken);
             }
                        
             if (model!=null)

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/CallState/RingVisitorToExtNotificationHandler.cs

@@ -29,7 +29,7 @@ namespace Hotline.Application.Handlers.CallCenter.CallState
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id &&
-                     x.FromNo == notification.Visitor.From && x.CreationTime>=DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Visitor.From && x.CreationTime>=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             var workModel = _userCacheManager.GetWorkByTel(notification.TelNo);
             if (model!=null)
             {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToExtNoificationHandler.cs

@@ -22,7 +22,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
 
         public async Task Handle(AnswerExtToExtNotification notification, CancellationToken cancellationToken)
         {
-            var model = await _callRepository.GetAsync(x=>x.FromNo == notification.FromTelNo && x.ToNo == notification.ToTelNo && x.CallStatus == Share.Enums.CallCenter.ECallStatus.Ring && x.CreationTime >= DateTime.Now.AddHours(-1),cancellationToken);
+            var model = await _callRepository.GetAsync(x=>x.FromNo == notification.FromTelNo && x.ToNo == notification.ToTelNo && x.CallStatus == Share.Enums.CallCenter.ECallStatus.Ring && x.CreationTime >= DateTime.Now.AddHours(-1),true,x=>x.CreationTime,cancellationToken);
 
             if (model!= null)
             {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerExtToOuterNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model =await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Outer.Id && x.ToNo == notification.Outer.To &&
-                     x.Trunk == notification.Outer.Trunk && x.CreationTime >= DateTime.Now.AddHours(-2),
+                     x.Trunk == notification.Outer.Trunk && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime,
                 cancellationToken);
             if (model!=null)
             {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnswerViisitorToExtNotificationHandler.cs

@@ -21,7 +21,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id &&
-                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Answer;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToExtNotificationHandler.cs

@@ -25,7 +25,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
 
         public async Task Handle(AnsweredExtToExtNotification notification, CancellationToken cancellationToken)
         {
-            var model = await _callRepository.GetAsync(x => x.FromNo == notification.FromTelNo && x.ToNo == notification.ToTelNo && x.CreationTime >= DateTime.Now.AddHours(-1), cancellationToken);
+            var model = await _callRepository.GetAsync(x => x.FromNo == notification.FromTelNo && x.ToNo == notification.ToTelNo && x.CreationTime >= DateTime.Now.AddHours(-1), true, x => x.CreationTime, cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = Share.Enums.CallCenter.ECallStatus.Answered;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Outer.Id &&
-                     x.FromNo == notification.Outer.From && x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Outer.From && x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Answered;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredExtToOuterToExtNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(x =>
                 x.ConversationId == notification.Outer.Id && x.ToNo == notification.Outer.To &&
-                x.Trunk == notification.Outer.Trunk && x.CreationTime >= DateTime.Now.AddHours(-2),cancellationToken);
+                x.Trunk == notification.Outer.Trunk && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime,cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = ECallStatus.Answered;

+ 7 - 5
src/Hotline.Application/Handlers/CallCenter/FlowControl/AnsweredVisitorToExtNotificationHandler.cs

@@ -26,7 +26,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id &&
-                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             var workModel = _userCacheManager.GetWorkByTel(notification.TelNo);
             if (model != null)
             {
@@ -49,11 +49,13 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
                 };
                 await _callDetailRepository.AddAsync(detail, cancellationToken);
 
-                //调用业务通知 通知前端
-                await _realtimeService.AnsweredAsync(workModel.UserId, new Share.Dtos.Realtime.AnsweredDto() { Id=model.Id,From = notification.Visitor.From,To =  notification.TelNo }, cancellationToken);
+                var callDetail = _callDetailRepository.GetAsync(x => x.CallId == model.Id && x.EventName == "ANSWER");
+                if (callDetail==null)
+                {
+                    //调用业务通知 通知前端
+                    await _realtimeService.AnsweredAsync(workModel.UserId, new Share.Dtos.Realtime.AnsweredDto() { Id = model.Id, From = notification.Visitor.From, To = notification.TelNo }, cancellationToken);
+                }
             }
-
-            
         }
     }
 }

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndExtNotificationHandler.cs

@@ -22,7 +22,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
 
         public async Task Handle(ByeExtAndExtNotification notification, CancellationToken cancellationToken)
         {
-            var model = await _callRepository.GetAsync(x => x.FromNo == notification.FromTelNo && x.ToNo == notification.ToTelNo && x.CallStatus == Share.Enums.CallCenter.ECallStatus.Answered && x.CreationTime >= DateTime.Now.AddHours(-1), cancellationToken);
+            var model = await _callRepository.GetAsync(x => x.FromNo == notification.FromTelNo && x.ToNo == notification.ToTelNo && x.CallStatus == Share.Enums.CallCenter.ECallStatus.Answered && x.CreationTime >= DateTime.Now.AddHours(-1),true,x=>x.CreationTime, cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = Share.Enums.CallCenter.ECallStatus.Bye;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterOneNotificationHandler.cs

@@ -21,7 +21,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Outer.Id && 
-                     x.Trunk==notification.Outer.Trunk && x.ToNo == notification.Outer.To && x.CreationTime>=DateTime.Now.AddHours(-2), cancellationToken);
+                     x.Trunk==notification.Outer.Trunk && x.ToNo == notification.Outer.To && x.CreationTime>=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Bye;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeExtAndOuterTwoNotificationHandler.cs

@@ -19,7 +19,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         public async Task Handle(ByeExtAndOuterTwoNotification notification, CancellationToken cancellationToken)
         {
             var model = await _callRepository.GetAsync(
-                x => x.ConversationId == notification.Outer.Id  && x.ToNo == notification.Outer.To && x.Trunk==notification.Outer.Trunk && x.CreationTime>=DateTime.Now.AddHours(-2), cancellationToken);
+                x => x.ConversationId == notification.Outer.Id  && x.ToNo == notification.Outer.To && x.Trunk==notification.Outer.Trunk && x.CreationTime>=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Bye;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeOuterAndOuterNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(x =>
                 x.ConversationId == notification.Outer.Id && x.FromNo == notification.Outer.From &&
-                x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2));
+                x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime,cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = ECallStatus.Bye;

+ 11 - 6
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorAndExtNotificationHandler.cs

@@ -28,8 +28,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id && 
-                     x.FromNo == notification.Visitor.From && x.CreationTime>=DateTime.Now.AddHours(-2), cancellationToken);
-            var workModel = _userCacheManager.GetWorkByTel(notification.TelNo);
+                     x.FromNo == notification.Visitor.From && x.CreationTime>=DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Bye;
@@ -54,10 +53,16 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
                 _callCacheManager.RemoveCallCache(model.Id);
 
                 //查询应答分机分机号
-                var callDetailAnswer = await _callDetailRepository.GetAsync(x => x.CallId == model.Id && x.EventName == "ANSWER", true, d => d.CreationTime);
-
-                //调用业务通知 通知前端
-                await _realtimeService.ByeAsync(workModel.UserId, new Share.Dtos.Realtime.ByeDto() { Id=model.Id }, cancellationToken);
+                var callDetailAnswer = await _callDetailRepository.GetAsync(x => x.CallId == model.Id && x.EventName == "ANSWER", true, d => d.CreationTime,cancellationToken);
+                if (callDetailAnswer!=null)
+                {
+                    var workModel = _userCacheManager.GetWorkByTel(callDetailAnswer.AnswerNo);
+                    if (workModel!=null)
+                    {
+                        //调用业务通知 通知前端
+                        await _realtimeService.ByeAsync(workModel.UserId, new Share.Dtos.Realtime.ByeDto() { Id = model.Id }, cancellationToken);
+                    }
+                }
             }
         }
     }

+ 2 - 2
src/Hotline.Application/Handlers/CallCenter/FlowControl/ByeVisitorOffNotificationHandler.cs

@@ -29,7 +29,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id &&
-                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Bye;
@@ -54,7 +54,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
                 _callCacheManager.RemoveCallCache(model.Id);
 
                 //查询应答分机号
-                var callDetailAnswer = await _callDetailRepository.GetAsync(x => x.CallId == model.Id && x.EventName == "ANSWER", true, x => x.CreationTime);
+                var callDetailAnswer = await _callDetailRepository.GetAsync(x => x.CallId == model.Id && x.EventName == "ANSWER", true, x => x.CreationTime,cancellationToken);
                 if (callDetailAnswer!=null)
                 {
                     //调用业务通知 通知前端

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/CdrNotificationHandler.cs

@@ -60,7 +60,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
             else
             {
                 var callDetail = await
-                _callDetailRepository.GetAsync(x => x.OMCallId == notification.CallId, cancellationToken);
+                _callDetailRepository.GetAsync(x => x.OMCallId == notification.CallId,true,x=>x.CreationTime, cancellationToken);
 
                 if (callDetail != null)
                 {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/DivertVisitorToExtNotificationHandler.cs

@@ -20,7 +20,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id && x.FromNo == notification.Visitor.From &&
-                     x.ToNo == notification.Visitor.To && x.CreationTime >= DateTime.Now.AddHours(-2),
+                     x.ToNo == notification.Visitor.To && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime,
                 cancellationToken);
             if (model!=null)
             {

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnOuterToMenuNotificationHandler.cs

@@ -26,7 +26,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model =await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Outer.Id && x.FromNo == notification.Outer.From &&
-                     x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                     x.ToNo == notification.Outer.To && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = ECallStatus.EndOfAnn;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/EndOfAnnVisitorToMenuNotificationHandler.cs

@@ -28,7 +28,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id && x.FromNo == notification.Visitor.From &&
-                     x.ToNo == notification.Visitor.To && x.CreationTime >= DateTime.Now.AddHours(-2),
+                     x.ToNo == notification.Visitor.To && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime,
                 cancellationToken);
 
             if (model!=null)

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/IncomingNotificationHandler.cs

@@ -64,7 +64,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                 x => x.ConversationId == notification.Visitor.Id && x.Trunk == notification.TrunkId &&
-                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                     x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Incoming;

+ 1 - 1
src/Hotline.Application/Handlers/CallCenter/FlowControl/QueueVisitorToGroupBusyNotificationHandler.cs

@@ -22,7 +22,7 @@ namespace Hotline.Application.Handlers.CallCenter.FlowControl
         {
             var model = await _callRepository.GetAsync(
                x => x.ConversationId == notification.Visitor.Id &&
-                    x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2), cancellationToken);
+                    x.FromNo == notification.Visitor.From && x.CreationTime >= DateTime.Now.AddHours(-2),true,x=>x.CreationTime, cancellationToken);
             if (model!=null)
             {
                 model.CallStatus = Share.Enums.CallCenter.ECallStatus.InQueue;

+ 1 - 0
src/Hotline.NewRock/Handlers/DeviceEventHandler.cs

@@ -208,6 +208,7 @@ namespace Hotline.NewRock.Handlers
                             await _mediator.Publish(_mapper.Map<ByeVisitorAndOuterNotification>(byeRcv.value!),
                                 cancellationToken);
                         }
+                        //分机和分机结束通话,挂断
                         else if(byeRcv.value?.Ext.Count==2)
                         {
                             await _mediator.Publish(_mapper.Map<ByeExtAndExtNotification>(byeRcv.value!), cancellationToken);