您需要将路由信息发布到 Lync 服务器。其中包含您的同时响铃和转发设置等。
如果您可以创建 .Net 解决方案,请尝试以下操作:
当您需要针对 Lync 服务器进行编程并且无法获得任何提升的权限时,请尝试使用 UCMA 并创建一个UserEndpoint
。由于您知道 Lync 服务器地址并拥有登录详细信息,因此您可以创建并验证UserEndpoint
无需其他部门的配合。
示例(不是我的):使用 UserApplication 实例创建 UCMA 应用程序.
设置好端点后,您基本上就可以在家了。通过发布状态的功能,您可以发布路由设置。对于 Lync,“状态”是一个容器,其中包含可用性、路由、联系详细信息、自定义位置等所有内容。
On your UserEndpoint
, 订阅LocalOwnerPresence.PresenceNotificationReceived
MSDN.
使用端点登录后,此事件将触发并为您提供当前设置。在事件参数中LocalPresentityNotificationEventArgs
,抓住AllCategories
集合,并寻找PresenceCategoryWithMetaData
与名字"routing"
。创建一个新实例Routing
包含此数据的容器。
路由容器是类Microsoft.Rtc.Internal.Collaboration.Routing
in Microsoft.Rtc.Collaboration.dll
.
private void OnLocalPresenceNotificationReceived(
object sender,
LocalPresentityNotificationEventArgs e)
{
var container = (from c in e.AllCategories
where string.Equals(c.Name, "routing", StringComparison.OrdinalIgnoreCase)
orderby c.PublishTime descending
select c).FirstOrDefault();
if (container != null)
{
var routing = new Microsoft.Rtc.Internal.Collaboration.Routing(container);
// You can access the routing data here...
}
}
如果您没有收到任何路由容器,您可以创建一个新实例。但请注意,发布新实例将覆盖您当前的所有路由设置,而不是允许您更新当前设置。
In the Routing
类您可以写入以下属性:
routing.CallForwardToTargetsEnabled = true;
routing.CallForwardTo.Clear();
routing.CallForwardTo.Add("sip or tel number");
routing.UserOnlyWaitTime = TimeSpan.FromSeconds(...);
最后,发布新的路由设置:
endpoint.LocalOwnerPresence.PublishPresenceAsync(new PresenceCategory[] {
routing
});
还可以通过使用以下命令获取当前的 Lync 实例来发布状态:GetClient()
Lync SDK 中的方法。但我不确定这是否可以用于发布路由设置。不过,您可以尝试一下,我在使用 Lync 时发现了许多未记录的选项。查看以下两个资源:
How to: Publish enhanced presence information and
Self.BeginPublishContactInformation