Building Real-Time Communication Apps Using Microsoft UCMA 4.0 SDK
Microsoft’s Unified Communications Managed API (UCMA) 4.0 SDK provides a managed-code platform for building server-side real‑time communications applications that integrate voice, video, instant messaging, presence, and conferencing with Lync/Skype for Business Server. This article walks through core concepts, architecture, typical application scenarios, and a step‑by‑step example to get a simple real‑time communication service up and running.
What UCMA 4.0 provides
- Server-side API: Managed .NET libraries for building trusted applications running on application servers.
- Communication modalities: Instant messaging (IM), presence, audio/video, conferencing, telephony/media control.
- Integration points: SIP-based signaling, Microsoft conferencing, and media platform for call control and media processing.
- Scalability & trust model: Applications can be trusted by the server (trusted application model) for higher privileges and scale.
Typical use cases
- Auto-attendants / call routing and IVR
- Conferencing bots that join and manage meetings
- Contact center back-ends and call recording
- Presence-aware notification and workflow integrations
- Real‑time translation/transcription services
Architecture and core components
- Endpoint types
- ApplicationEndpoint: Represents a user-like endpoint for trusted server apps.
- UserEndpoint: Represents an actual user account.
- Platform class: Central lifecycle manager that connects your app to the server topology and provides access to settings and resources.
- Conversations and modalities: Conversation object models participants and modalities (InstantMessagingFlow, AudioVideoCall, VideoFlow).
- Call and media handling: AudioVideoCall and AudioVideoFlow for establishing and controlling calls, media streaming, DTMF, recording.
- Automatic management features: Reconnection logic, keepalives, failover patterns provided by UCMA runtime.
Prerequisites
- Windows Server (supported versions per UCMA 4.0 documentation)
- Microsoft Lync or Skype for Business Server (matching supported versions)
- Visual Studio with .NET Framework matching UCMA assemblies
- UCMA 4.0 SDK installed on development machine
- Trusted application registration in Topology Builder (or appropriate server configuration)
Development workflow — step-by-step example
Below is a concise walkthrough to build a simple application that accepts an incoming audio call and plays a greeting.
-
Project setup
- Create a new C# Console Application targeting the supported .NET Framework.
- Reference UCMA 4.0 assemblies (Microsoft.Rtc.Collaboration.dll, Microsoft.Rtc.Collaboration.AudioVideo.dll, etc.).
- Ensure the server-side application pool and account are configured and trusted in the Skype for Business/Lync topology.
-
Initialize the CollaborationPlatform
- Instantiate CollaborationPlatform with a LocalEndpointSettings or ApplicationPlatformSettings and start it.
- Register event handlers for platform state changes and shutdown.
-
Create and establish an ApplicationEndpoint
- Create an ApplicationEndpoint using the CollaborationPlatform and an endpoint configuration (SIP URI and deployment settings).
- Call Establish() on the ApplicationEndpoint to register with the server.
-
Listen for incoming calls
- Subscribe to the ApplicationEndpoint’s AudioVideoCallReceived event.
- In the event handler, accept the incoming call by calling audioVideoCall.AcceptAsync().
-
Play greeting and manage the call
- Once the call is established, create an AudioVideoFlow or use the call’s Connect/Start APIs.
- Use the MediaController or ToneController as needed to play a WAV prompt or media file. Example pattern:
- Create a Prompt to play audio from a file stream.
- Use the AudioVideoFlow to send the prompt to the remote party.
- Handle call termination and cleanup on AudioVideoCall.StateChanged or CallEnded events.
-
Clean shutdown
- Properly dispose of endpoints and stop the CollaborationPlatform to release resources and unregister the application.
Example (pseudocode)
”` using Microsoft.Rtc.Collaboration; using Microsoft.Rtc.Collaboration.AudioVideo;
Start platform; Create ApplicationEndpoint; endpoint.Establish();
endpoint.AudioVideoCallReceived += (s
Leave a Reply
You must be logged in to post a comment.