【发布时间】:2014-10-14 08:29:02
【问题描述】:
如何在没有凭据的情况下建立 UserEndpoint?我在某处读到,如果应用程序/应用程序服务器受到 Lync 服务器的信任,它应该是可能的。情况就是这样,但它似乎不起作用。我总是得到异常
没有为领域找到匹配的凭据。
【问题讨论】:
如何在没有凭据的情况下建立 UserEndpoint?我在某处读到,如果应用程序/应用程序服务器受到 Lync 服务器的信任,它应该是可能的。情况就是这样,但它似乎不起作用。我总是得到异常
没有为领域找到匹配的凭据。
【问题讨论】:
首先使用ProvisionedApplicationPlatformSettings设置CollaborationPlatform:
ProvisionedApplicationPlatformSettings settings = new ProvisionedApplicationPlatformSettings("UCMA 4", _appID);
CollaborationPlatform _collabPlatform = new CollaborationPlatform(settings);
_collabPlatform.RegisterForApplicationEndpointSettings(this.Platform_ApplicationEndpointOwnerDiscovered);
// Initialize and start-up the platform.
_collabPlatform.BeginStartup(EndPlatformStartup, _collabPlatform);
然后在Platform_ApplicationEndpointOwnerDiscovered 回调方法中设置您的应用程序端点。然后一旦完成,您就可以调用此方法并在没有凭据的情况下设置 UserEndpoint:
Use this method to create UserEndpoint
private UserEndpoint CreateUserEndpoint(CollaborationPlatform _collabPlatform, String _SIP)
{
try
{
UserEndpointSettings _settings = new UserEndpointSettings(_SIP, _serverFqdn);
_settings.SupportedMimePartContentTypes = new ContentType[] { new ContentType("text/html"), new ContentType("text/plain") };
_settings.AutomaticPresencePublicationEnabled = true;
UserEndpoint _userEndpoint = new UserEndpoint(_collabPlatform, _settings);
_userEndpoint.EndEstablish(_userEndpoint.BeginEstablish(null, null));
return _userEndpoint;
}
catch (Exception exx)
{
Console.WriteLine("\n" + _SIP + "CreateUserEndpoint : " + exx);
return null;
}
}
【讨论】:
不确定是否要在没有凭据的情况下建立用户端点,但如果有帮助,您绝对可以在已建立的对话中模拟一个用户端点。
只需检查会话类上的 Impersonate 方法即可。
【讨论】:
如果你想模拟你需要一个应用程序端点。
使用应用程序端点创建对话对象并...
Conversation conversation = new Conversation(_appEndpoint);
conversation.Impersonate("sip:something@something.com", "phoneUri, "Display Name");
【讨论】:
UserEndpoint。 ApplicationEndpoint 只接收对其自己的端点 uri 的调用。
userEndpointSettings = new UserEndpointSettings(_userURI, _serverFqdn);
if (!_useSuppliedCredentials)
{
_credential = new System.Net.NetworkCredential(_userName, _userPassword, _userDomain);
userEndpointSettings.Credential = _credential;
}
else
{
userEndpointSettings.Credential = System.Net.CredentialCache.DefaultNetworkCredentials;
}
_userURI 需要匹配当前登录用户 sip:user@blabla.com
【讨论】: