问题
I am working on a solution that uses UCMA 5.0. I'd like to be able to test my solution locally, however when I look at the documentation, it seems I need to deploy my solution to so called "trusted server". I'd like to test everything locally, and avoid copying the files to a remote server (and test it there). Any hints how to do it ?
回答1:
There are two main types of UCMA applications:
- Client Application
- Server Application
A client application can only create UserEndpoint and it has to supply all the authentication information (i.e. the user password). If that is all you require then you can run this anywhere without any setup.
A server application is more involved as the application and the machine it's running on is "trusted" by Lync. You can use ApplicationEndpoint's or UserEndpoint's and they have more somewhat power than normal endpoints (no passwords required and more abilities). If this is what you need then you need to setup your machine to be able to run a server UCMA application.
Server applications come in two main types:
- Manual provisioning
- Auto provisioning
Manual provisioning requires a bit more coding as you need to know up front everything created in Lync yourself.
Auto provisioning requires less coding but the machine setup is a lot.
I recommend always going with the Manual provisioning as the machine setup for auto provisioning is what I consider insane...
So for running on your own machine, you need to:
- Setup machine to run UCMA server application. I would recommend a single instance pool.
- Create a certificate for your computer (normally webserver will do). Read above link, the certificate setup has been the number one problem area for customers to get correct so read the above link very carefully.
- If your insane, set your machine up as a store replication point for auto provisioning.
Once your machine is setup as a application pool, you can then create the trusted applications and trusted application endpoints as needed using New-CsTrustedApplication and New-CsTrustedApplicationEndpoint.
I would get very used to using the lync powershell commands as it can be very useful.
As a aside, I would also recommend UCMA v4.0 over v5.0. v4 applications run fine on Skype for Business and also on Lync 2013. Also, if you use UCMA 4.0 you can install the Lync 2013 ocscore.msi (comes with UCMA 4.0 runtime) and that allows you to run the Lync powershell commands on your own machine (against S4B and Lync 2013). I have yet to figure out how to do that on UCMA 5.0 without breaking something...
There are no API differences between 4.0 and 5.0 so the switch between them is pretty simple.
回答2:
The UserEndpoint approach is simple and easy one.
I am pasting here some piece of code for reference. With this you can start with initializing UserEndpoint.
using Microsoft.Rtc.Collaboration;
using Microsoft.Rtc.Signaling;
private static string fqdn = ConfigurationManager.AppSettings["ServerFQDN"];
private static string sipaddress = ConfigurationManager.AppSettings["UserURI"];
private static string username = ConfigurationManager.AppSettings["UserName"];
private static string password = ConfigurationManager.AppSettings["UserPwd"];
private static string domain = ConfigurationManager.AppSettings["UserDomain"];
CollaborationPlatform _platform;
UserEndpoint _endpoint;
var platformSettings = new ClientPlatformSettings(userAgent, SipTransportType.Tls);
_platform = new CollaborationPlatform(platformSettings);
UserEndpointSettings settings = new UserEndpointSettings(sipaddress,fqdn);
settings.Credential = new System.Net.NetworkCredential(username, password, domain);
settings.AutomaticPresencePublicationEnabled = true;
_endpoint = new UserEndpoint(_platform, settings);
try
{
await _platform.BeginStartup();
await _endpoint.BeginEstablish();
_endpoint.RegisterForIncomingCall<InstantMessagingCall>(
OnIncomingInstantMessagingCallReceived);
}
来源:https://stackoverflow.com/questions/39080361/testing-ucma-application-on-a-local-machine