|
@@ -69,64 +69,71 @@ namespace CallCenter.Application.Handlers
|
|
|
ToNo = notification.Visitor.To,
|
|
|
};
|
|
|
await _callDetailRepository.AddAsync(detail, cancellationToken);
|
|
|
- }
|
|
|
- //TODO IVR处理
|
|
|
- var setting = _systemSettingCacheManager.GetSetting(SettingConstants.IVRConfig);
|
|
|
- if (bool.Parse(setting.SettingValue))
|
|
|
- {
|
|
|
- //TODO 获取工作或休息时间(接听策略)
|
|
|
- //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 correct = GetCorrectIvr(notification.Visitor.To);
|
|
|
- switch (correct.eCorrectIvr)
|
|
|
+
|
|
|
+ //TODO IVR处理
|
|
|
+ var setting = _systemSettingCacheManager.GetSetting(SettingConstants.IVRConfig);
|
|
|
+ if (bool.Parse(setting.SettingValue))
|
|
|
{
|
|
|
- //跳转IVR
|
|
|
- case ECorrectIvr.Ivr:
|
|
|
- _logger.LogInformation("transfer to ivr.no: {ivrNo}", correct.ReturnValue );
|
|
|
- await _newRockClient.VisitorToMenu(new VisitorToMenuRequest()
|
|
|
- {
|
|
|
- Attribute = "Connect",
|
|
|
- Menu = new VisitorToMenuMenu() { Id = correct.ReturnValue },
|
|
|
- Visitor = new VisitorToMenuVisitor() { Id = notification.Visitor.Id}
|
|
|
- },
|
|
|
- _options.Value.ReceiveKey,_options.Value.Expired,cancellationToken);
|
|
|
- break;
|
|
|
- //直接转分机组
|
|
|
- case ECorrectIvr.Group:
|
|
|
- _logger.LogInformation("transfer to group.no:{groupNo}", correct.ReturnValue);
|
|
|
- await _newRockClient.VisitorToGroupQueue(new VisitorToGroupQueueRequest()
|
|
|
- {
|
|
|
- Attribute= "Queue",
|
|
|
- Visitor = new VisitorToGroupQueueVisitor() { Id = notification.Visitor.Id },
|
|
|
- Group= new VisitorToGroupQueueGroup() { Id = correct.ReturnValue }
|
|
|
- },
|
|
|
- _options.Value.ReceiveKey,_options.Value.Expired,cancellationToken);
|
|
|
+ //TODO 获取工作或休息时间(接听策略)
|
|
|
+ //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 list = _callCacheManager.GetCallQueueList().ToList();
|
|
|
- list.Add(model);
|
|
|
- _callCacheManager.AddOrUpdateCallCache(list);
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+
|
|
|
+ switch (correct.eCorrectIvr)
|
|
|
+ {
|
|
|
+ //跳转IVR
|
|
|
+ case ECorrectIvr.Ivr:
|
|
|
+ _logger.LogInformation("transfer to ivr.no: {ivrNo}", correct.ReturnValue);
|
|
|
+ await _newRockClient.VisitorToMenu(new VisitorToMenuRequest()
|
|
|
+ {
|
|
|
+ Attribute = "Connect",
|
|
|
+ Menu = new VisitorToMenuMenu() { Id = correct.ReturnValue },
|
|
|
+ Visitor = new VisitorToMenuVisitor() { Id = notification.Visitor.Id }
|
|
|
+ },
|
|
|
+ _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
|
|
|
+ model.InIvrTime = DateTime.Now;
|
|
|
+ await _callRepository.UpdateAsync(model, cancellationToken);
|
|
|
+ break;
|
|
|
+ //直接转分机组
|
|
|
+ case ECorrectIvr.Group:
|
|
|
+ _logger.LogInformation("transfer to group.no:{groupNo}", correct.ReturnValue);
|
|
|
+ await _newRockClient.VisitorToGroupQueue(new VisitorToGroupQueueRequest()
|
|
|
+ {
|
|
|
+ Attribute = "Queue",
|
|
|
+ Visitor = new VisitorToGroupQueueVisitor() { Id = notification.Visitor.Id },
|
|
|
+ Group = new VisitorToGroupQueueGroup() { Id = correct.ReturnValue }
|
|
|
+ },
|
|
|
+ _options.Value.ReceiveKey, _options.Value.Expired, cancellationToken);
|
|
|
+ model.InGroupTime = DateTime.Now;
|
|
|
+ await _callRepository.UpdateAsync(model, cancellationToken);
|
|
|
+ //处理队列记录
|
|
|
+ var list = _callCacheManager.GetCallQueueList().ToList();
|
|
|
+ list.Add(model);
|
|
|
+ _callCacheManager.AddOrUpdateCallCache(list);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //TODO 跳转默认分机组
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //TODO 跳转默认分机组
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private Ivr GetCorrectIvr()
|