gpt4 book ai didi

c# - UCMA 应用程序中的 ApplicationEndPoint

转载 作者:太空宇宙 更新时间:2023-11-03 13:02:38 27 4
gpt4 key购买 nike

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

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

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

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

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

我只需要登录用户的状态即可。

最佳答案

检查一下...

// 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;
}

关于c# - UCMA 应用程序中的 ApplicationEndPoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31919399/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com