【问题标题】:ApplicationEndPoint in UCMA applicationsUCMA 应用程序中的 ApplicationEndPoint
【发布时间】:2015-08-10 12:20:09
【问题描述】:

我有一个使用 UCMA 获取 lync 用户状态的应用程序。

我有一个澄清。我已经下载了继承类的示例应用程序,如下所示:

public class UcPresenceProvider : Microsoft.Rtc.Collaboration.Samples.HTMLPresenceControls.Service.IPresenceProvider
    {

  public UcPresenceProvider(ApplicationEndpoint endpoint)
        {
            m_applicationEndpoint = endpoint;
        }
}

从外行的角度来看,ApplicationEndpoint 端点的值是什么。

我只需要登录用户的状态就可以了。

【问题讨论】:

    标签: c# .net lync ucma ucma2.0


    【解决方案1】:

    看看这个……

    // Gateway participant that impersonates a phone user
    // _gatewayEndpoint = _helper.CreateApplicationEndpoint(
    // "GatewayParticipant" /*endpointFriendlyName*/);
    
    public ApplicationEndpoint CreateApplicationEndpoint(string contactFriendlyName)
        {
            string prompt = string.Empty;
    
            if (string.IsNullOrEmpty(contactFriendlyName))
            {
                contactFriendlyName = "Default Contact";
            }
    
            Console.WriteLine();
            Console.WriteLine("Creating Application Endpoint {0}...", contactFriendlyName);
            Console.WriteLine();
    
            // If application settings are provided via the app.config file, then use them
            // Else prompt user for details
            if (!ReadApplicationContactConfiguration())
            {
                // Prompt user for server FQDN. If server FQDN was entered before, then let the user use the saved value.
                if (string.IsNullOrEmpty(_serverFqdn))
                {
                    prompt = "Please enter the FQDN of the Microsoft Lync Server for this topology => ";
                    _serverFqdn = PromptUser(prompt, null);
                }
    
                if (string.IsNullOrEmpty(_applicationHostFQDN))
                {
                    prompt = "Please enter the FQDN of the Machine that the application service is configured to => ";
                    _applicationHostFQDN = PromptUser(prompt, null);
                }
                if (0 >= _applicationPort)
                {
                    // Prompt user for contact port
                    prompt = "Please enter the port that the application service is configured to => ";
                    _applicationPort = int.Parse(PromptUser(prompt, null), CultureInfo.InvariantCulture);
                }
    
                if (string.IsNullOrEmpty(_applicationGruu))
                {
                    // Prompt user for Contact GRUU
                    prompt = "Please enter the GRUU assigned to the application service => ";
                    _applicationGruu = PromptUser(prompt, null);
                }
    
                if (string.IsNullOrEmpty(_applicationContactURI))
                {
                    // Prompt user for contact URI
                    prompt = "Please enter the Contact URI in the User@Host format => ";
                    _applicationContactURI = PromptUser(prompt, null);
                    if (!_applicationContactURI.Trim().StartsWith(_sipPrefix, StringComparison.OrdinalIgnoreCase))
                    {
                        _applicationContactURI = _sipPrefix + _applicationContactURI.Trim();
                    }
                }
    
                if (string.IsNullOrEmpty(_certificateFriendlyName))
                {
                    // Prompt user for contact URI
                    prompt = "Please enter the friendly name of the certificate to be used => ";
                    _certificateFriendlyName = PromptUser(prompt, null);
                }
            }
    
            // Reuse platform instance so that all endpoints share the same platform.
            if (_serverCollabPlatform == null)
            {
                CreateAndStartServerPlatform();
            }
    
            // Initalize and register the endpoint.
            // NOTE: the _applicationContactURI should always be of the form "sip:user@host"
            ApplicationEndpointSettings appEndpointSettings = new ApplicationEndpointSettings(_applicationContactURI, _serverFqdn, 5061);
            _applicationEndpoint = new ApplicationEndpoint(_serverCollabPlatform, appEndpointSettings);
            _endpointInitCompletedEvent.Reset();
    
            Console.WriteLine("Establishing the endpoint...");
            _applicationEndpoint.BeginEstablish(EndEndpointEstablish, _applicationEndpoint);
    
            // Sync; wait for the registration to complete.
            _endpointInitCompletedEvent.WaitOne();
            Console.WriteLine("Application Endpoint established...");
            return _applicationEndpoint;
        }
    

    【讨论】:

    【解决方案2】:

    当您在 SfB/Lync 上配置此 UCMA 应用程序时,它将是您添加到此 UCMA 应用程序的可信应用程序端点之一。

    如果您只对单个用户的存在感兴趣,那么 UCMA 可能是矫枉过正,您可能需要考虑使用客户端 SDK。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多