|
@@ -318,6 +318,13 @@ namespace CallCenter.Api.Controllers
|
|
|
var work = _userCacheManager.GetWorkByUser(_sessionContext.RequiredUserId);
|
|
|
if (work is null)
|
|
|
throw new UserFriendlyException("当前坐席暂未进行工作");
|
|
|
+ //获取对方是否在工作
|
|
|
+ var toWork = _userCacheManager.GetWorkByTel(dto.TelNo);
|
|
|
+ if (toWork is null)
|
|
|
+ throw new UserFriendlyException("转接分机未进行工作");
|
|
|
+ var tel = await _deviceManager.QueryTelAsync(dto.TelNo, HttpContext.RequestAborted);
|
|
|
+ if (tel.TelStatus != Share.Enums.ETelStatus.Ready)
|
|
|
+ throw new UserFriendlyException("被叫分机不在线或正在通话中");
|
|
|
await _deviceManager.ExtToExtAsync(work.TelNo, dto.TelNo, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
@@ -346,6 +353,15 @@ namespace CallCenter.Api.Controllers
|
|
|
var work = _userCacheManager.GetWorkByUser(_sessionContext.RequiredUserId);
|
|
|
if (work is null)
|
|
|
throw new UserFriendlyException("当前坐席暂未进行工作");
|
|
|
+
|
|
|
+ var toWork = _userCacheManager.GetWorkByTel(dto.TelNo);
|
|
|
+ if (toWork is null)
|
|
|
+ throw new UserFriendlyException("转接分机未进行工作");
|
|
|
+
|
|
|
+ var totel = await _deviceManager.QueryTelAsync(dto.TelNo, HttpContext.RequestAborted);
|
|
|
+ if (totel.TelStatus != Share.Enums.ETelStatus.Ready)
|
|
|
+ throw new UserFriendlyException("被叫分机不在线或正在通话中");
|
|
|
+
|
|
|
var tel = await _deviceManager.QueryTelAsync(work.TelNo, HttpContext.RequestAborted);
|
|
|
if (!string.IsNullOrEmpty(tel.ConversationId))
|
|
|
await _deviceManager.VisitorToExtAsync(tel.ConversationId, dto.TelNo, HttpContext.RequestAborted);
|
|
@@ -421,6 +437,15 @@ namespace CallCenter.Api.Controllers
|
|
|
var work = _userCacheManager.GetWorkByUser(_sessionContext.RequiredUserId);
|
|
|
if (work is null)
|
|
|
throw new UserFriendlyException("当前坐席暂未进行工作");
|
|
|
+
|
|
|
+ var toWork = _userCacheManager.GetWorkByTel(dto.TelNo);
|
|
|
+ if (toWork is null)
|
|
|
+ throw new UserFriendlyException("转接分机未进行工作");
|
|
|
+
|
|
|
+ var totel = await _deviceManager.QueryTelAsync(dto.TelNo, HttpContext.RequestAborted);
|
|
|
+ if (totel.TelStatus != Share.Enums.ETelStatus.Ready)
|
|
|
+ throw new UserFriendlyException("被叫分机不在线或正在通话中");
|
|
|
+
|
|
|
var tel = await _deviceManager.QueryTelAsync(work.TelNo, HttpContext.RequestAborted);
|
|
|
if (!string.IsNullOrEmpty(tel.ConversationId))
|
|
|
await _deviceManager.OuterToExtAsync(tel.ConversationId, dto.TelNo, HttpContext.RequestAborted);
|