MachineState/EndpointState 的目的是什么?

What is the purpose of the MachineState/EndpointState?

我目前正在编写一个 Trusted UCMA 5.0 应用程序,它将改变不同用户的状态。

为 UserEndpoint 发布在线状态时,您可以发布多种不同类型的在线状态,例如:
用户状态:可用、忙碌、离线、...
PhoneState:用户当前是否在通话或会议中
还有一些,包括 EndpointState/MachineState.

所以我可以使用以下代码设置用户忙碌:

// ... init collaboration platform (trusted application) and create the UserEndpoint 
var presenceCategs = new PresenceCategory[]
{
    PresenceState.UserBusy,
    new Note("Will be back in 10 minutes"),
    PresenceState.EndpointAway
};

_userEndpoint.LocalOwnerPresence.BeginPublishPresence(presenceCategs, PublishPresenceCompleted, true);

// ...     
private void PublishPresenceCompleted(IAsyncResult ar)
{
    _userEndpoint.LocalOwnerPresence.EndPublishPresence(ar);
    Console.WriteLine("Publish Presence Complete");
}

代码有效,但问题是我不确定when/how是否正确使用 EndpointState。
我找到的关于 EndpointState / MachineState 的唯一文档没有进一步帮助我:

EndpointState

The availability of the endpoint owner from this particular endpoint.

https://msdn.microsoft.com/en-us/library/dn466019(v=office.16).aspx

截至目前,我无法在更改或省略 EndpointState 时观察到任何不同或奇怪的行为(例如 PresenceState.EndpointAway 当 UserOnline 时)

所以我的主要问题是:

我发现存在感是 SfB 中一个非常令人困惑的话题。据我了解,每个 SIP 端点都可以拥有自己的在线状态。

所以存在状态PER有多层"user"。每个已注册的 SIP 端点都有自己的在线状态 "State",用户的联系人卡片有自己的在线状态,每个日历事件都有自己的在线状态。还有 "aggregate" 存在状态,我认为它是所有其他人在任何时候看到的所有存在状态的总和。

鉴于您指向的页面显示:

EndpointState The availability of the endpoint owner from this particular endpoint.

表示您正在将当前 SIP 端点(在您的情况下为 UserEndpoint)的在线状态设置为“仅”忙。因此,只要您的 UserEndpoint 处于活动状态,用户忙碌 "state" 就会持续,并且作为该用户登录的任何其他 SIP 端点也不会更改状态。

UserState The availability preference of the endpoint owner.

因此,如果您设置用户状态,它不仅会为您的 SIP 端点设置状态,还会强制任何其他登录的用户端点也更改为该状态。因此,只要您或用户登录的另一个实例更改了存在状态,它就会持续存在。

你使用哪一个取决于你想做什么。

如果您想设置用户状态而不是让 UserEndpoint 实例死亡,则 UserState 选项很好。所以它只能在设置用户存在的时间长度内存在。

当您将 UserEndpoint 保留一段时间并且您不知道用户的总体状态时,可以使用 EndpointState "Busy" 除非您是唯一一个为用户调用提供服务的状态实例。如此有效,您只是在宣传您的端点 "presence" 而不是整体用户的存在。