|
@@ -28,13 +28,14 @@ namespace CallCenter.Application.Handlers
|
|
|
private readonly ITypedCache<WorkTimeSettings> _worktimeCache;
|
|
|
private readonly IOptionsSnapshot<WorkTimeSettings> _worktimeOptions;
|
|
|
private readonly ILogger<IncomingNotificationHandler> _logger;
|
|
|
+ private readonly ICallCacheManager _callCacheManager;
|
|
|
|
|
|
public IncomingNotificationHandler(
|
|
|
ICallRepository callRepository, ICallDetailRepository callDetailRepository,
|
|
|
ISystemSettingCacheManager systemSettingCacheManager, IIvrCacheManager ivrCacheManager,
|
|
|
INewRockClient newRockClient, IOptionsSnapshot<DeviceConfigs> options,
|
|
|
ITypedCache<WorkTimeSettings> worktimeCache, IOptionsSnapshot<WorkTimeSettings> worktimeOptions,
|
|
|
- ILogger<IncomingNotificationHandler> logger)
|
|
|
+ ILogger<IncomingNotificationHandler> logger, ICallCacheManager callCacheManager)
|
|
|
{
|
|
|
_callRepository = callRepository;
|
|
|
_callDetailRepository = callDetailRepository;
|
|
@@ -45,6 +46,7 @@ namespace CallCenter.Application.Handlers
|
|
|
_worktimeCache = worktimeCache;
|
|
|
_worktimeOptions = worktimeOptions;
|
|
|
_logger = logger;
|
|
|
+ _callCacheManager = callCacheManager;
|
|
|
}
|
|
|
|
|
|
public async Task Handle(IncomingNotification notification, CancellationToken cancellationToken)
|
|
@@ -76,16 +78,16 @@ namespace CallCenter.Application.Handlers
|
|
|
//var ivrList = _ivrCacheManager.GetIvrs();
|
|
|
//var ivr = ivrList.First(x => x.IvrCategoryId == "08da9b9f-a35d-4ade-8ea7-55e8abbcdefd" && x.IsRoot);
|
|
|
|
|
|
- var ivr = GetCorrectIvr();
|
|
|
- _logger.LogInformation("transfer to ivr.no: {ivrNo}", ivr.No);
|
|
|
- await _newRockClient.VisitorToMenu(
|
|
|
- new VisitorToMenuRequest()
|
|
|
- {
|
|
|
- Attribute = "Connect",
|
|
|
- Menu = new VisitorToMenuMenu() { Id = ivr.No },
|
|
|
- Visitor = new VisitorToMenuVisitor() { Id = notification.Visitor.Id }
|
|
|
- },
|
|
|
- _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
|
|
|
+ //var ivr = GetCorrectIvr();
|
|
|
+ //_logger.LogInformation("transfer to ivr.no: {ivrNo}", ivr.No);
|
|
|
+ //await _newRockClient.VisitorToMenu(
|
|
|
+ // new VisitorToMenuRequest()
|
|
|
+ // {
|
|
|
+ // Attribute = "Connect",
|
|
|
+ // Menu = new VisitorToMenuMenu() { Id = ivr.No },
|
|
|
+ // Visitor = new VisitorToMenuVisitor() { Id = notification.Visitor.Id }
|
|
|
+ // },
|
|
|
+ // _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
|
|
|
|
|
|
var correct = GetCorrectIvr(notification.Visitor.To);
|
|
|
switch (correct.eCorrectIvr)
|
|
@@ -111,6 +113,11 @@ namespace CallCenter.Application.Handlers
|
|
|
Group= new VisitorToGroupQueueGroup() { Id = correct.ReturnValue }
|
|
|
},
|
|
|
_options.Value.ReceiveKey,_options.Value.Expired,cancellationToken);
|
|
|
+
|
|
|
+ //处理队列记录
|
|
|
+ var list = _callCacheManager.GetCallQueueList().ToList();
|
|
|
+ list.Add(model);
|
|
|
+ _callCacheManager.AddOrUpdateCallCache(list);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|