瀏覽代碼

cdr answered

dss 2 年之前
父節點
當前提交
1dc3db8e33

+ 1 - 1
src/CallCenter.Application/Handlers/FlowControl/AnsweredVisitorToExtNotificationHandler.cs

@@ -30,7 +30,7 @@ namespace CallCenter.Application.Handlers
             if (model != null)
             {
                 model.CallStatus = ECallStatus.Answered;
-                model.ToNo = notification.TelNo;
+                //model.ToNo = notification.TelNo;
                 model.ConnSeaTime = DateTime.Now;
                 await _callRepository.UpdateAsync(model, cancellationToken);
                 var detail = new CallDetail()

+ 7 - 2
src/CallCenter.Application/Handlers/FlowControl/CdrNotificationHandler.cs

@@ -1,8 +1,10 @@
 using CallCenter.Calls;
+using CallCenter.NewRock.Handlers;
 using CallCenter.Notifications;
 using CallCenter.Share.Dtos;
 using CallCenter.Share.Enums;
 using MediatR;
+using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using NewRock.Sdk.Extensions;
 using System.Text;
@@ -18,14 +20,16 @@ namespace CallCenter.Application.Handlers
         private readonly ICallRepository _callRepository;
         private readonly IOptionsSnapshot<SendCallRecord> _sendCallRecordOptions;
         private readonly IHttpClientFactory _httpClientFactory;
+        private readonly ILogger<CdrNotificationHandler> _logger;
 
-        public CdrNotificationHandler(ICallRecordRepository callRecordRepository, ICallDetailRepository callDetailRepository, ICallRepository callRepository, IOptionsSnapshot<SendCallRecord> sendCallRecordOptions, IHttpClientFactory httpClientFactory)
+        public CdrNotificationHandler(ICallRecordRepository callRecordRepository, ICallDetailRepository callDetailRepository, ICallRepository callRepository, IOptionsSnapshot<SendCallRecord> sendCallRecordOptions, IHttpClientFactory httpClientFactory,ILogger<CdrNotificationHandler> logger)
         {
             _callRecordRepository = callRecordRepository;
             _callDetailRepository = callDetailRepository;
             _callRepository = callRepository;
             _sendCallRecordOptions = sendCallRecordOptions;
             _httpClientFactory = httpClientFactory;
+            _logger = logger;
         }
 
 
@@ -106,12 +110,13 @@ namespace CallCenter.Application.Handlers
 
                     var list = new List<OutCallDto>();
                     list.Add(callDto);
+                    
                     try
                     {
                         var client = _httpClientFactory.CreateClient();
                         client.DefaultRequestHeaders.ConnectionClose = true;
                         var requestContent = JsonSerializer.Serialize(list);
-                        
+                        _logger.LogInformation(requestContent);
                         var content = new StringContent(requestContent,Encoding.UTF8, "application/json");
 
                         var responseMessage = await client.PostAsync(_sendCallRecordOptions.Value.FwUrl, content, cancellationToken);