Export (0) Print
Expand All

IUccPlatform.CreateEndpoint Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Creates a principal server-based user Endpoint Object.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

IUccEndpoint CreateEndpoint (
	UCC_ENDPOINT_TYPE eType,
	UccUri pUri,
	string bstrEndpointId,
	UccContext pContext
)
IUccEndpoint CreateEndpoint (
	UCC_ENDPOINT_TYPE eType, 
	UccUri pUri, 
	String bstrEndpointId, 
	UccContext pContext
)
function CreateEndpoint (
	eType : UCC_ENDPOINT_TYPE, 
	pUri : UccUri, 
	bstrEndpointId : String, 
	pContext : UccContext
) : IUccEndpoint

Parameters

eType

A value of the UCC_ENDPOINT_TYPE type. This specifies the type of the endpoint.

pUri

A value of the IUccUri* (UccUri, for a .NET application) type. This specifies the SIP URI (in the form of "sip:john@contoso.com") of the endpoint to be created.

bstrEndpointId

A value of the BSTR (string, for a .NET application) type. This specifies an identifier (in the form of an integer or a GRUU) of the endpoint to be created. The value can be NULL (null). In this case the UCC API will assign an ID to the endpoint.

pContext

A value of the IUccContext* (UccContext, for a .NET application) type. This is reserved for now. An application should set it to NULL (null).

Return Value

A value of the IUccEndpoint** (IUccEndpoint, for a .NET application) type. This points to the IUccEndpoint instance if the operation is successful.

To create a user endpoint, an application passes UCC_ENDPOINT_TYPE.UCCET_PRINCIPAL_SERVER_BASED. in the eType parameter position.

A user endpoint represents a user profile used in real-time communications collaborations. The endpoint provides the context for presence and other communications services. A user can have multiple endpoints present. The call to CreateEndpoint() should not pass the UCC_ENDPOINT_TYPE.UCCET_PROXY_TELEPHONY enumerated value.

Interaction with remote Unified Communications clients can only begin after the endpoint has been created and enabled. Enabling an endpoint is also known as signing in to a Unified Communications server as illustrated in the following Example section.

Win32 COM/C++ Syntax

HRESULT CreateEndpoint
(
   UCC_ENDPOINT_TYPE eType,
   IUccUri* pUri,
   BSTR bstrEndpointId,
   IUccContext* pContext,
   IUccEndpoint** ppEndpoint
);
Cc667952.note(en-us,office.12).gifNote:
In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

The process of signing into a Unified Communications server involves several tasks illustrated in the following example:

  • The endpoint is created by the platform factory object.

  • The client process advises for events to be raised by the created endpoint.

  • The IUccServerSignalingSettings interface is cast from the created endpoint to access user credential and server settings functionality.

  • User credentials are added to the credential cache within the serverSignalingSettings object.

  • The endpoint is enabled to send the sign in information to the specified Unified Communications server.

// Create the sip endpoint and advise for endpoint events
// the passed IUccUri (meUri) is created by calling code using
// an IUccUriManager instance. meUri represents the local user's SIP:address, for example: "SIP:jaya@contoso.com"

IUccEndpoint endpoint = platform.CreateEndpoint(
   UCC_ENDPOINT_TYPE.UCCET_PRINCIPAL_SERVER_BASED,
   meUri,
   null,
   null);
// Advise for endpoint events, specifying the new endpont as the
// event source and this class instance as the event sink.
UCC_Advise<_IUccEndpointEvents>(
   endpoint,
   this);

// QI IUccServerSignalingSettings from the endpoint and configure server settings
IUccServerSignalingSettings serverSignalingSettings = this.endpoint as IUccServerSignalingSettings;
if (serverSignalingSettings != null)
{
   serverSignalingSettings.Server = serverSignalingSettings.CreateSignalingServer(
   server,
   UCC_TRANSPORT_MODE.UCCTM_TLS);
}

UccCredential credential = null;
if (useDefaultCredentials == true)
{
   // Use Windows default credential of the logged in user
   credential = serverSignalingSettings.CredentialCache.DefaultCredential;
}
else
{
   // Create a new credential
   credential = serverSignalingSettings.CredentialCache.CreateCredential(username, passwd, domain);
}

// Specify the credential and authentication types
serverSignalingSettings.CredentialCache.SetCredential("*", credential);
serverSignalingSettings.AllowedAuthenticationModes = (int)UCC_AUTHENTICATION_MODES.UCCAM_KERBEROS | (int)UCC_AUTHENTICATION_MODES.UCCAM_NTLM;

//Enable the endpoint to login
this.endpoint.Enable(null);

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Show:
© 2015 Microsoft