无法通过Unified Communications API连接到Office Communication Server

时间:2009-12-21 18:29:18

标签: ocs ucma ucma2.0

我正在尝试使用统一通信托管API连接到Office Communication Server。我已经尝试过我的用户和为OCS启用的新用户。两个帐户都可以成功登录Office Communicator客户端,但无法使用API​​。在创建网络凭据时,如果我以domain \ username格式传入用户名,则会收到以下错误:

SupportedAuthenticationProtocols=Ntlm, Kerberos
Realm=SIP Communications Service
FailureReason=InvalidCredentials
ErrorCode=-2146893044
Microsoft.Rtc.Signaling.AuthenticationException: The log on was denied. Check that the proper credentials are being used and the account is active. ---> Microsoft.Rtc.Internal.Sip.AuthException: NegotiateSecurityAssociation failed, error: - 2146893044

如果我在用户名中遗漏了域名,则会出现此错误:

ResponseCode=404 ResponseText=Not Found
DiagnosticInformation=ErrorCode=4005,Source=OCS.mydomain.com,Reason=Destination URI either not enabled for SIP or does not exist

2 个答案:

答案 0 :(得分:2)

原来这是对我的疏忽。我们的AD域和通信域不同,我原以为它们是相同的。

网络凭证是域\用户名,sip地址应该是sip:username@companyname.com,我使用的是sip:username@domain.com。

答案 1 :(得分:0)

有两点需要注意:

  1. 用户名不应包含域名。应该使用您应该使用的NetworkCredential的单独Domain属性。
  2. 您还需要传递用户URI - 例如:
  3. //Initialize and register the endpoint, using the credentials of the user the application will be acting as.
            UserEndpointSettings userEndpointSettings = new UserEndpointSettings(_userURI, _userServer);
            userEndpointSettings.Credential = _credential;
            _userEndpoint = new UserEndpoint(_collabPlatform, userEndpointSettings);
            _userEndpoint.BeginEstablish(EndEndpointEstablish, _userEndpoint);
    

    //Initialize and register the endpoint, using the credentials of the user the application will be acting as. UserEndpointSettings userEndpointSettings = new UserEndpointSettings(_userURI, _userServer); userEndpointSettings.Credential = _credential; _userEndpoint = new UserEndpoint(_collabPlatform, userEndpointSettings); _userEndpoint.BeginEstablish(EndEndpointEstablish, _userEndpoint);