UserEndpoint or ApplicationEndpoint: Which One to Use
The UserEndpoint and ApplicationEndpoint classes derive from LocalEndpoint and have some subtle but important differences. Read on to find out more about these endpoints and how to use them.
Author: Michael Greenlee
Publication date: February 2010
Product version: Microsoft Office Communications Server 2007 R2
A Microsoft Unified Communications Managed API (UCMA) 2.0 Core SDK application has one or more local endpoints at its core. The LocalEndpoint object represents a single SIP endpoint that your UCMA 2.0 Core SDK application uses to sign in to Microsoft Office Communications Server 2007 R2. This object is required to access various capabilities of a SIP endpoint, such as instant messaging, audio calls, presence, and contacts. All endpoints can be either a UserEndpoint or an ApplicationEndpoint class. These two classes derive from LocalEndpoint, and have some subtle but important differences.
How does one decide which type of endpoint to use? This article briefly describes each type of endpoint and then outlines the differences to help you determine the endpoint to use in your application.
UserEndpoint
UserEndpoint is meant for applications that perform communication operations on behalf of a single Active Directory user who uses a unified communications solution. UserEndpoint is associated with a specific user’s SIP URI when it is instantiated. When established, it automatically registers as that user with Office Communications Server.
UCMA 2.0 Core SDK is meant for server-based applications, so developers sometimes wonder why there is a user-centric endpoint type. Generally, UserEndpoint is used by server applications that represent multiple clients simultaneously. Three common scenarios for which UserEndpoint is ideal are Web-based clients (such as Communicator Web Access), automated phone attendants, and load or stress testing applications.
ApplicationEndpoint
ApplicationEndpoint is ideal for highly available applications that need to interact with many users at once. It corresponds to a Contact object in Active Directory directory service, and is trusted by Office Communications Server, which allows it to perform communication operations, such as sending instant messages, on behalf of individual users. It can also join conferences as a trusted application, making it a hidden participant in the conference roster as well as a conference leader. This allows it to provide services such as audio announcements or recording to the conference without appearing as a named participant.
ApplicationEndpoint is ideal for any application that provides a service to many different clients. Some common examples are interactive voice response systems (IVRs), and call routing systems.
Registration and Recovery from Connection Failures
When established, UserEndpoint always registers with Office Communications Server and periodically refreshes its registration to keep it current. If it loses connectivity briefly with Office Communications Server, it attempts to recover by refreshing the registration. If this refresh attempt fails, UserEndpoint does not continue trying to establish a new connection. This makes it a less suitable choice for endpoints that must be highly available and must recover robustly from connection failures.
Unlike UserEndpoint, an ApplicationEndpoint endpoint that loses connectivity with Office Communications Server switches into the Reestablishing state and continues trying to recover connectivity until it succeeds, even if it is unable to connect for a long time period. ApplicationEndpoint is a better choice for applications that must recover gracefully and stay as available as possible in the face of connection failures.
The ApplicationEndpoint endpoint, unlike the UserEndpoint endpoint, can operate without being registered with Office Communications Server. If it does not register with Office Communications Server, ApplicationEndpoint is unable to perform presence operations like publishing or subscribing to presence, and clients cannot route messages to the endpoint through Office Communications Server. In order for it to automatically register with the server, the UseRegistration property on the ApplicationEndpointSettings object used to instantiate the endpoint must be set to true. By default, this property is set to false.
Contacts and Presence
Applications that need to work with a contact list or publish presence on behalf of users should employ the UserEndpoint class. Because UserEndpoint represents a single user, it can manipulate specific user contact and group data through the ContactGroupServices object. ContactGroupServices is not available to the ApplicationEndpoint endpoint, which has no contacts or contact groups of its own.
UserEndpoint can also publish presence using a publication grammar, which means it can publish presence similar to Microsoft Office Communicator, without specifying details such as presence containers, an instance ID, or an expiry policy. ApplicationEndpoint cannot publish presence in this way, and must use the PresenceCategoryWithMetaData class to specify at least an instance ID and presence container ID whenever it publishes presence. For this reason, applications that publish presence on behalf of users should generally employ UserEndpoint.
Trusted Operations
ApplicationEndpoint is trusted by Office Communications Server, giving it the ability to perform two trusted operations unavailable to UserEndpoint: impersonation and trusted conference join.
Ordinarily, the endpoint uses its own SIP URI as the local participant URI in any communication. ApplicationEndpoint can impersonate another SIP URI and use that URI for the local participant rather than its own. This can be helpful if the endpoint is initiating a conversation on behalf of another user. An automated call distributor might do this, for instance, when routing an incoming call to an agent, so that the call appears with the original caller’s identity.
ApplicationEndpoint can also join conferences as a trusted application, which puts it in the leader role automatically and also makes it a hidden participant, so that other conference participants do not see it in the conference roster.
Additional Information
To learn more, see:
UserEndpoint, https://msdn.microsoft.com/en-us/library/dd253626(office.13).aspx
ApplicationEndpoint, https://go.microsoft.com/fwlink/?LinkId=184104.
Presence and the ApplicationEndpoint, https://go.microsoft.com/fwlink/?LinkId=184105
Managing Contacts and Groups, https://go.microsoft.com/fwlink/?LinkId=184106
Programming for Unified Communications, https://go.microsoft.com/fwlink/?LinkId=184108
Communications Server Developer Resources
Portals
Office Communications Developer Center https://msdn.microsoft.com/ocdev
Unified Communications Developer Center https://go.microsoft.com/fwlink/?LinkID=133626
Documentation
Communications Server 2007 R2 Server SDK Documentation https://go.microsoft.com/fwlink/?LinkID=133566
MSDN Documentation portal for Communications Server 2007 R2 https://go.microsoft.com/fwlink/?LinkID=133592
Communicator 2007 and Communicator 2007 R2 documentation https://go.microsoft.com/fwlink/?LinkID=133593
MSDN Office http://twitter.com/MSDN_Office
Office Communications Server 2007 R2 http://twitter.com/DrRez
Developer Sandbox
- GotUC.Net developer resource for Office Communications Server http://gotuc.net
Forums
Office Communications Server https://go.microsoft.com/fwlink/?LinkId=177722
Unified Communications Integration https://go.microsoft.com/fwlink/?LinkId=177723
Office Communicator https://go.microsoft.com/fwlink/?LinkId=177724
Unified Communications Managed API SDK Forum https://go.microsoft.com/fwlink/?LinkId=177725
Articles
Read weekly articles for Communications Server IT professionals on Next Hop at https://go.microsoft.com/fwlink/?LinkId=181907.
Read weekly articles for Communications Server developers on UCode at https://go.microsoft.com/fwlink/?LinkId=177892.
We Want to Hear from You
To give us feedback about this article or to propose an article topic, e-mail us at UCode@microsoft.com.
You can also send us a tweet at http://www.twitter.com/DrRez.