|
@@ -13,6 +13,7 @@ using XF.Domain.Cache;
|
|
|
using CallCenter.Settings;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using NewRock.Sdk.Transfer.Queue.Request;
|
|
|
+using CallCenter.Realtimes;
|
|
|
|
|
|
namespace CallCenter.Application.Handlers
|
|
|
{
|
|
@@ -28,6 +29,7 @@ namespace CallCenter.Application.Handlers
|
|
|
private readonly ILogger<IncomingNotificationHandler> _logger;
|
|
|
private readonly ICallCacheManager _callCacheManager;
|
|
|
private readonly IIvrDomainService _ivrDomainService;
|
|
|
+ private readonly IRealtimeService _realtimeService;
|
|
|
|
|
|
|
|
|
public IncomingNotificationHandler(
|
|
@@ -35,7 +37,7 @@ namespace CallCenter.Application.Handlers
|
|
|
ISystemSettingCacheManager systemSettingCacheManager, IIvrCacheManager ivrCacheManager,
|
|
|
INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options,
|
|
|
ILogger<IncomingNotificationHandler> logger, ICallCacheManager callCacheManager,
|
|
|
- IIvrDomainService ivrDomainService)
|
|
|
+ IIvrDomainService ivrDomainService,IRealtimeService realtimeService)
|
|
|
{
|
|
|
_callRepository = callRepository;
|
|
|
_callDetailRepository = callDetailRepository;
|
|
@@ -46,6 +48,7 @@ namespace CallCenter.Application.Handlers
|
|
|
_logger = logger;
|
|
|
_callCacheManager = callCacheManager;
|
|
|
_ivrDomainService = ivrDomainService;
|
|
|
+ _realtimeService = realtimeService;
|
|
|
}
|
|
|
|
|
|
public async Task Handle(IncomingNotification notification, CancellationToken cancellationToken)
|
|
@@ -124,6 +127,7 @@ namespace CallCenter.Application.Handlers
|
|
|
await _callRepository.UpdateAsync(model, cancellationToken);
|
|
|
//处理队列记录 TODO
|
|
|
_callCacheManager.AddCallCache(model);
|
|
|
+ await _realtimeService.CallQueueAsync(_callCacheManager.GetCallQueueList(), cancellationToken);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|