微软实时通信API多客户端通信实战(2)[图](4)
在 RTC 服务器中注册后,应用程序接收 RTCE_REGISTRATION_STATE_CHANGE &&事件,指示注册是完成还是失败。
出席信息服务可以在服务器注册您的配置文件之前启用。下图显示了注册前启用出席信息服务的方法。
这可以使用户在注册到服务器之前设置他们的状态。现在,用户可以注册到 SIP 服务器,而对观察程序可以显示为“离线”,并查看联系人状态。当用户要在不受干扰的情况下监视组的出席状态时,此功能非常有用。
图 3:注册前启用出席信息的步骤。
请注意,可以在设置出席状态后调用 CreateProfile() 方法。
下面是 XML 架构。
<?xml version="1.0" ?>
<Schema name="ProvisioningSchema.xml"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<comments>Schema Version MajorRevisionNumber = 1
MinorRevisionNumber = 0
</comments>
<ElementType name="provision" model="closed">
<AttributeType name="key" required="yes" />
<attribute type="key" />
<AttributeType name="name" required="yes" />
<attribute type="name" />
<AttributeType name="expires" dt:type="dateTime.tz" />
<attribute type="expires" />
<element type="user" minOccurs="1" maxOccurs="1" />
<element type="sipsrv" minOccurs="1" maxOccurs="*" />
<element type="client" minOccurs="0" maxOccurs="1" />
<element type="provider" minOccurs="0" maxOccurs="1" />
</ElementType>
<ElementType name="user" model="closed">
<AttributeType name="uri" required="yes" />
<attribute type="uri" />
<AttributeType name="account" required="no" />
<attribute type="account" />
<AttributeType name="name" required="no" />
<attribute type="name" />
<AttributeType name="password" required="no" />
<attribute type="password" />
<AttributeType name="realm" required="no" />
<attribute type="realm" />
</ElementType>