【发布时间】:2016-01-16 16:49:01
【问题描述】:
在测试机上,向 FRONT END 发送请求时,我得到了很好的响应(两秒)。 在生产中,请求需要 30 秒或更长时间,组织有 5000 多个用户。 如果有另一个使用 UCMA 获取 SIP 状态的方法? UCWA 无法使用。 有什么想法吗?
代码:
public Dictionary<string, string> GetAgentsAvailability(List<string> usersUris)
{
lock (lockObj)
{
AgentsAvailability = new Dictionary<string, string>();
try
{
if (usersUris != null && usersUris.Count > 0)
{
IAsyncResult agentAvailabilityCheck = ApplicationEndPoint.PresenceServices.BeginPresenceQuery(usersUris, new string[] { "state" },null, null);
WaitHandle[] w = new WaitHandle[] { agentAvailabilityCheck.AsyncWaitHandle };
WaitHandle.WaitAll(w, 3000);
}
else
{
WriteEntry.ELog("Platform - GetAgentsAvailability - No Agent SIPs to check.", EventLogEntryType.Information);
}
}
catch (Exception ex)
{
WriteEntry.ELog(ex.ToString(), EventLogEntryType.Error);
throw;
}
return AgentsAvailability;
}
}
【问题讨论】: