|
@@ -24,6 +24,7 @@ using Tr.Sdk;
|
|
using Tr.Sdk.Blacklist;
|
|
using Tr.Sdk.Blacklist;
|
|
using Tr.Sdk.Tels;
|
|
using Tr.Sdk.Tels;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Authentications;
|
|
|
|
+using XF.Domain.Constants;
|
|
using XF.Domain.Exceptions;
|
|
using XF.Domain.Exceptions;
|
|
using XF.Domain.Filters;
|
|
using XF.Domain.Filters;
|
|
using XF.Domain.Repository;
|
|
using XF.Domain.Repository;
|
|
@@ -52,6 +53,7 @@ namespace Hotline.Api.Controllers
|
|
private readonly IRepository<Quality.Quality> _qualiteyRepository;
|
|
private readonly IRepository<Quality.Quality> _qualiteyRepository;
|
|
private readonly IAiQualityService _aiQualityService;
|
|
private readonly IAiQualityService _aiQualityService;
|
|
private readonly IRepository<QualityTemplate> _qualityTemplate;
|
|
private readonly IRepository<QualityTemplate> _qualityTemplate;
|
|
|
|
+ private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
|
|
|
|
|
|
|
public IPPbxController(ITrClient trClient, IMapper mapper, IUserDomainService userDomainService,
|
|
public IPPbxController(ITrClient trClient, IMapper mapper, IUserDomainService userDomainService,
|
|
@@ -62,7 +64,7 @@ namespace Hotline.Api.Controllers
|
|
IUserCacheManager userCacheManager, ICapPublisher capPublisher,
|
|
IUserCacheManager userCacheManager, ICapPublisher capPublisher,
|
|
ITelRestRepository telRestRepository, IRepository<User> userRepository,
|
|
ITelRestRepository telRestRepository, IRepository<User> userRepository,
|
|
ITelApplication telApplication, IRepository<Quality.Quality> qualiteyRepository,
|
|
ITelApplication telApplication, IRepository<Quality.Quality> qualiteyRepository,
|
|
- IAiQualityService aiQualityService, IRepository<QualityTemplate> qualityTemplate)
|
|
|
|
|
|
+ IAiQualityService aiQualityService, IRepository<QualityTemplate> qualityTemplate, ISystemSettingCacheManager systemSettingCacheManager)
|
|
{
|
|
{
|
|
_trClient = trClient;
|
|
_trClient = trClient;
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
@@ -83,6 +85,7 @@ namespace Hotline.Api.Controllers
|
|
_qualiteyRepository = qualiteyRepository;
|
|
_qualiteyRepository = qualiteyRepository;
|
|
_aiQualityService = aiQualityService;
|
|
_aiQualityService = aiQualityService;
|
|
_qualityTemplate = qualityTemplate;
|
|
_qualityTemplate = qualityTemplate;
|
|
|
|
+ _systemSettingCacheManager = systemSettingCacheManager;
|
|
}
|
|
}
|
|
|
|
|
|
#region 添添呼
|
|
#region 添添呼
|
|
@@ -258,11 +261,23 @@ namespace Hotline.Api.Controllers
|
|
public async Task<OpenResponse> ReceiveCallRecord([FromBody] ReceiveCallRecordDto dto)
|
|
public async Task<OpenResponse> ReceiveCallRecord([FromBody] ReceiveCallRecordDto dto)
|
|
{
|
|
{
|
|
_logger.LogInformation($"收到通话记录结果回传:{JsonConvert.SerializeObject(dto)}");
|
|
_logger.LogInformation($"收到通话记录结果回传:{JsonConvert.SerializeObject(dto)}");
|
|
|
|
+
|
|
|
|
+ var settings = _systemSettingCacheManager.GetSetting(SettingConstants.TapeAddress);
|
|
|
|
+
|
|
|
|
+
|
|
var model = _mapper.Map<TrCallRecord>(dto);
|
|
var model = _mapper.Map<TrCallRecord>(dto);
|
|
model.Duration = 0;
|
|
model.Duration = 0;
|
|
model.RingTimes = 0;
|
|
model.RingTimes = 0;
|
|
model.QueueTims = 0;
|
|
model.QueueTims = 0;
|
|
model.OnState = Share.Enums.CallCenter.EOnState.NoOn;
|
|
model.OnState = Share.Enums.CallCenter.EOnState.NoOn;
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(settings?.SettingValue[0]) && !string.IsNullOrEmpty(settings?.SettingValue[1]) && !string.IsNullOrEmpty(model.RecordingFileUrl))
|
|
|
|
+ {
|
|
|
|
+ model.RecordingFileUrl = model.RecordingFileUrl.Replace(settings?.SettingValue[0], settings?.SettingValue[1]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch{}
|
|
//计算通话时长
|
|
//计算通话时长
|
|
if (model.AnsweredTime != null)
|
|
if (model.AnsweredTime != null)
|
|
{
|
|
{
|