Inside UCWA

The Unified Communications Web API (UCWA) is a REST-like API to enable real-time communications over the web on Server-Side based works for Microsoft Lync on-primes. See the UCWA previous post

Technology Boundaries

  • Only users homed on a Lync Server 2013 pool can take advantage of UCWA capabilities.
  • Supported only for The On Prime Lync Server.
  • Server-to-server authentication between an on-premises server and an Office 365 component is not supported.
  • HD Photos, Voicemail and meetings are dependent on the version of Exchange Server 2013.
  • Supported only for The On Prime Exchange Server.
  • Exchange 2010 On prime and Online are not supported.
  • Compatible with Internet Explorer versions 9 and 10 are both supported, as are the latest versions of Chrome, Safari, and Firefox.
  • The developers needs to know HTTP: POST and GET and PUT and DELETE and HTTP headers, REST SERVICE and indeed JavaScript and JQuery.

What We Can Do With The Technology

  1. Contacts and Groups
    • Access, search, federated organizations, monitor on contact list, subscribing to the presence, Presence, Location, and Note can publish and view her presence and note, View own photos or the photos of their contacts.
  2. Two-party and Multi-party IM
    • Supports instant messaging between two parties in a peer-to-peer fashion as well as multi-party IM sessions that are hosted by the server.
    • Add Participant for a Multi-Party IM.
    • Escalate the conversation to conference.
  3. Working with Online Meetings
    • Schedule an online meeting that can be joined by via this API or there Lync services.
    • Joining of online meetings with messaging and phone audio modalities (for future use).
    • A roster of meeting attendees is provided; this information includes participant name, contact information, and modalities. And can update Meeting.
    • Exchange APIs can be used to place meeting information on the user’s calendar you will only see meetings created by UCWA.

Technology Barriers (What we can’t do)

  • No Audio, Video or other Real Time Media (at this time). According to the Channel 9 video, UCWA is on the Roadmap to get voice/video/screen sharing capability over IP after Lync 2013 goes RTM.
  • Only allow you connect at a user level i.e. can’t do action on behalf of others.
  • No Office 365 support.
  • No User Impersonation.
  • No custom presence Support.
  • Can’t start group IM conversations.

Development Ability

  1. People
    • Search.
    • Presence Subscription and Presence Subscription Membership.
    • Get contact and contact information i.e. Location, Note, Photo, Presence, Privacy Relationship and Supported Modalities.
    • Get group, Group Contacts, Default Group, Distribution Group, Expand Distribution Group.
    • Start/Refresh/Stop Subscription to Contacts and Groups.
    • Subscribed Contacts.
    • Subscribe To Group Presence.
    • Get contacts forward call information i.e. Immediate Forward Settings, Immediate Forward to Contact, Immediate Forward to Delegates and Immediate Forward to Voicemail.
  2. Me
    • Call Forwarding Settings.
    • Change Phone Number.
    • Change Visibility: Changes the visibility of a phone number to other contacts.
    • Change location.
    • Presence: get a representation of the user’s availability and activity.
    • Note, Photo and Report My Activity: Indicates that the user is actively using this application.
    • Call settings i.e. Reset Unanswered Call Settings, Simultaneous Ring Settings, Simultaneous Ring to Contact, Simultaneous Ring to Delegates, Simultaneous Ring to Team, Unanswered Call Settings, Unanswered Call to Contact and Unanswered Call to Voicemail.
  3. Online Meetings
    • Dial in Region: get a representation of the access information for phone users who wish to join an online Meeting.
    • Group.
    • My Assigned Online Meetings.
    • My Online Meetings.
    • Online Meeting Default Values: get a representation of the values of my Online Meeting properties if not specified at scheduling time.
    • Online Meeting Eligible Values: get a representation of the eligible values that the application can choose from when scheduling an Online Meeting.
    • Online Meeting Extensions: get a representation of the data that is needed by a custom meeting extension, stored as a collection of key-value pair properties.
    • Online Meeting Invitation.
    • Online Meeting Invitation Customization.
    • Online Meeting Policies.
    • Meeting Organizer.
    • Phone Dial in Information.
  4. Communications and Modalities
    • Accept/decline incoming conversation.
    • Send invitation to contact/Participant and knows the Acceptance state.
    • Add Messaging.
    • Add Participant.
    • Attendees.
    • Cancel/Reject.
    • Conversations: get a representation of the user’s ongoing conversations.
    • Data Collaboration to return the current modality.
    • Demote: user can demote the participant from leader to attendee in the online Meeting.
    • Derived Conversation.
    • Derived Messaging.
    • Disable/Disable Audience Messaging and Disable/Disable Audience Mute Lock.
    • Failed Delivery Participant.
    • Forwarded By.
    • From: get a representation of the participant that sent an invitation.
    • Hold Phone Audio.
    • Join Online Meeting.
    • Leaders.
    • Lobby.
    • Local Participant.
    • Messaging and Messaging Invitation.
    • Mute Audio/Video.
    • Participant.
    • Participant Application Sharing : track when a participant joins or leaves this modality.
    • Participant Audio : track when a participant joins or leaves this modality.
    • Participant Data Collaboration: track when a participant joins or leaves this modality.
    • Participant Invitation.
    • Participant Messaging.
    • Participant Panoramic Video.
    • Participant Video.
    • Phone Audio Invitation.
    • Promote.
    • Reject.
    • Resume Phone Audio.
    • Send Message.
    • Set Is Typing.
    • Start Messaging.
    • Start Online Meeting.
    • Start Phone Audio.
    • Stop Messaging.
    • Transferred By.
    • Typing Participants.
    • Video Locked On Participant.

Endpoints of UCMA Applications

Network Endpoints

The Network endpoints are the agents that Microsoft Lync uses internally in the UCMA applications to represent the users’ agents in code by creating instances or objects of the UserEndpoint class or the ApplicationEndpoint class and can handle all operations that concern a single user agent with the assistant of other related classes.

UCMA application can run without any endpoints, but it would not be able to do any useful services or tasks because the application would have no SIP user agents to send or receive messages. Therefore, any useful UCMA application must when starting up initialize and establish at least one user endpoint or application endpoint.


The UserEndpoint class allows an application to perform communication operations on behalf of a single Lync Server user. When established, the user endpoint always registers with Lync Server and retrieves presence and contact information for specific user. Through the UserEndpoint class, you can perform contact and contact group operations as well as publish a presence, but because the user endpoint represents a single user, an application cannot use it to perform trusted operations such as impersonating another Lync Server user.

The UserEndpoint class is best suited for an application that acts on behalf of a number of different existing users simultaneously such as Web – based client applications (like Communicator Web Access)

We can use it also in Contact and Group Operations to perform contact list operations and Publishing presence information for a user which automatically assigns access control information and instance IDs to presence elements.

The user endpoint is not as robust in recovering from connection failures as the application endpoint, so it is less appropriate for server applications that must be highly available. When a user endpoint loses connectivity with Lync Server, it attempts to re-register with Lync Server once, but if this attempt fails it gives up and makes no further attempts to recover the connection.


The ApplicationEndpoint class is acts for highly available server applications that provide a service to many different users simultaneously. It does not represent an individual user, it has a separate identity defined by a Contact object in Active Directory such as Automatic call distributors and Message broadcasting

Because an application endpoint is automatically trusted by Lync Server, it is able to “impersonate” any individual user in order to perform communications operations on behalf of that user.

The ApplicationEndpoint class is able to load – balance connections across several frontend servers. In addition, it is more persistent than the UserEndpoint class in recovering connectivity with Lync Server. When an application endpoint loses its connection to Lync Server, it goes into the Reestablishing state and tries to regain its connection with the server until it succeeds, regardless of how long it remains without a connection.

The application endpoint ’ s trusted status with Lync server allows it to perform conference operations that would otherwise be restricted to conference leaders, as well as some special operations that cannot be performed at all through the Lync client. It can also join conferences as a trusted participant; in this state, it is not shown in the conference roster and has the same rights as a conference leader.

Application endpoints are not able to perform any contact operations, nor can they publish presence.

PTZ Camera

What is the PTZ Camera?

PTZ is an abbreviation for pantilt, and zoom which reflects the movement options of the camera. A pan–tilt–zoom camera (PTZ camera) is a camera that is capable of remote directional and zoom control.

You can physically control the camera horizontally or vertically using electrical motors. The zoom is controlled by mechanically moving two lenses closer together or further apart dependent on whether you are zooming in or out with the effect that objects in view appear larger or smaller.

With these cameras you can now capture footage from 360° around the camera and digitally zoom in on certain areas. Because you are recording the entire field of view it doesn’t matter if you are zoomed in on the entry gates or not, all angles are recorded.

Pan and Tilt Control

On a conventional PTZ camera, when you pan and tilt you physically rotate the camera using electrical motors i.e. pan (horizontally) or tilt (vertically).

The movement of the motor could be controlled relatively or absolutely and this is depending on how much you want the camera to move steps or degrees. In addition to controlling the speed of the move.

The Pan and tilt motors also could have the signal to move without stop horizontally or vertically.

Zooming Control

In the Mechanical PTZ Cameras, zoom is controlled by mechanically moving two lenses closer together or further apart dependent on whether you are zooming in or out with the effect that objects in view appear larger or smaller.

Digital PTZ cameras don’t work in this manner. The camera will first capture a full image, usually in megapixel resolution. When a user decides to zoom in they are provided with a section of the overall picture. The pixels in this are then enlarged so that the cropped image is the same size as the original. This gives the appearance that you have zoomed in as objects are now larger.

Controlling the PTZ Camera

PTZ cameras could be controlled by any of the following ways

  • Control the PTZ camera by its remote control, not all vendors support remote controls and not all cameras support remote controls.
  • Controlling the PTZ camera by COM ports and it work with one of the following protocols PelcoP, PelcoD and VISCA
  • Controlling the PTZ camera by USB and it work with UVC and this can use some components like DirectShow.NET

We can implement the software component to control the camera using C++ and C#

Other Cameras’ Types

As stated earlier, conventional PTZ cameras use motors to move the camera around. There are multiple different ways of using these to pan the camera such as bands, cogs or direct drive. There are even some which use electromagnetism to accurately aim the camera in some higher end cameras.

Digital PTZ systems perform their functionality in software. As a result there are no moving parts and nothing to break, freeze or move. So long as the camera is functioning, the digital PTZ system will work. So from a reliability point of view, digital PTZ cameras win hands down.

(Source: Network Webcams)

Introducing the Unified Communications Web API (UCWA)

The Unified Communications Web API (UCWA) is a new REST-like API to enable real-time communications over the web on Server-Side based works for Microsoft Lync on-primes and it is not supported for Office 365 till now.

The new UC Web API, or UCWA, in Microsoft Lync Server 2013 opens a new way of integration with many other client platforms. Lync Server 2013 UCWA brings Lync functionality to desktop applications, web applications and embedded devices with no need for Microsoft Lync client being installed and without Server side component either.

As you could remember with Lync 2010 if you want to create a client application for desktop or PCs you should use the Lync 2010 SDK and host it in any type of user interface like WPF or Silverlight also if you want to create and Add-Ons for the Microsoft Lync Server you need to use the UCMA but now UCWA makes customizations possible on any platform, device or application that can talk http and no browser plugin or ActiveX or Lync client is required with UCWA.

Features of the Unified Communications Web API (UCWA)

  • UCWA removes programming language dependencies.
  • No browser plugin required and No ActiveX dependency.
  • Lync client does not need to be running.
  • Built on top of UCMA.
  • REST-like API to create and work.
  • Simple data structures.
  • Embrace HTTP as an application layer.
  • Resource-oriented programming model.

What Developers Could Do and Access Using UCWA

  • Presence
  • Group Memberships
  • Contacts
  • Privacy Relationships
  • Scheduled Conferences
  • Search
  • Instant Messaging

What Developers Could Do and Access Using UCWA

  • No Audio, Video and any other media
  • No Conferencing only User level interaction
  • No Application Sharing

OAuth Token

The cool thing with the UCWA it Attempt to locate Autodiscover service and the Requested is redirected to OAuth endpoint to get a token and we have the features of the OAuth i.e. provide user credentials, Token is attached to every request header and Token establishes the user’s identity.

The (Representational State Transfer) REST has an Architectural pattern that sees the internet as a collection of resources available at unique locations (URLs\HREFs) so this approach is very great to enable us to create different types and models of applications for different platforms i.e. Linux Lync Client, Web Chat Lync client and Add Instant Message or Presence capabilities to any embedded device that can do HTTP.

Join Lync Conference Using Lync 2013 SDK

This article explains how to prepare for and join online meetings using Microsoft Lync 2013 SDK, you can join a scheduled online meeting with colleagues and clients from down the hall or across the world without leaving your desk.

For online meetings with audio or video calls You can access your scheduled conference invite using Microsoft Lync 2013 SDK.

When a user schedules an Online meeting in Outlook 2007/2010 the meeting and Lync information associated with that meeting are stored in a number of MAPI properties on the Appointment Item.

You can use these information further to do many tasks i.e. to join a conference meeting, also you could use these information to put it in a calendar.

The following demonstrations run on different computers. These computers is used to start a conference by using Microsoft Lync 2013 SDK UI Automation mode or Microsoft Lync 2013 SDK UI Suppression mode.

Getting the Online Meeting URL

You could get the online meeting URLs by the Managed EWS API, Microsoft encourage Microsoft .NET Framework developers to use the EWS Managed API instead of auto-generated proxies to develop against Exchange Web Services. The EWS Managed API object model is significantly easier to use than auto-generated proxy object models.

You get more information how to use EWS in the previous post Get Lync Online Meetings’ Information using the EWS Managed API

Getting the Conference URI

The conversation properties that you use to form a complete conference URI are null at the time that the conversation is created.

To get the conference URI properties, you register for the Conversation.PropertyChanged event on the conversation to get the URI value

The following are examples of how to build a conference join URL using properties of the conversation.

UI Automation Mode

private void Conversation_PropertyChanged
    (object sender, ConversationPropertyChangedEventArgs e)
    //Getting meeting url
    if (e.Property == ConversationProperty.ConferencingUri)
        string ConferenceUri = "conf:" 
           + ((Conversation)sender).Properties[ConversationProperty.ConferencingUri]
           + "?" + ((Conversation)sender).Properties[ConversationProperty.Id];

UI Suppression Mode

void ConversationManager_ConversationAdded
    (object sender, ConversationManagerEventArgs e)
    //Getting meeting url
    string url = string.Empty;
    string domain = string.Empty;
    string name = string.Empty;
    string id = string.Empty;

    url = ConferenceUrl.Replace("https://meet.","");
    url = url.Substring(0, url.Length);
    domain = url.Substring(0, url.IndexOf("/"));
    url = url.Replace(domain + "/", "");
    name = url.Substring(0, url.IndexOf("/"));
    id = url.Replace(name + "/", "");
    url = "conf:sip:" + name + "@" + domain + 
          ";gruu;opaque=app:conf:focus:id:" + id + "?" +

Joining the Conference

Once the conference URI is obtained by another user, use the BeginStartConversation method to join a conference in a Microsoft Lync 2010 SDK application. The string argument of the call is the conference URI.

UI Automation Mode

IAsyncResult ar = LyncClient.GetAutomation().BeginStartConversation(

UI Suppression Mode

void ConversationManager_ConversationAdded
    (object sender, ConversationManagerEventArgs e)
    //Join the conference

Get Lync Online Meetings’ Information using the EWS Managed API

In this article we will learn how to be able to use Exchange Web Services (EWS) via the EWS Managed API to access an Exchange Mailbox calendar and view all information for the Online Lync meetings.

The examples are written to work with the Exchange Online and Lync Online from the Office365 suite and within a private cloud or on-premise deployment of Lync 2010 and Exchange 2007 or Exchange 2010.

When a user schedules an Online meeting in Outlook 2007/2010 the meeting and Lync information associated with that meeting are stored in a number of MAPI properties on the Appointment Item.

You can use these information further to do many tasks i.e. to join a conference meeting using the browser or in any other way like the Lync SDK, also you could use these information to put it in a calendar.

EWS Managed API

The Microsoft Exchange Web Services (EWS) Managed API provides an intuitive interface for developing client applications that use Exchange Web Services. The EWS Managed API provides unified access to Microsoft Exchange Server resources, while using Microsoft Outlook–compatible business logic. The EWS Managed API uses EWS SOAP messages to communicate with the Exchange Client Access server.

Microsoft encourage Microsoft .NET Framework developers to use the EWS Managed API instead of auto generated proxies to develop against Exchange Web Services. The EWS Managed API object model is significantly easier to use than autogenerated proxy object models.


  • Microsoft Visual Studio
  • C# Language
  • EWS Managed API
  • Exchange Server with known credential

Sample Code

Add reference to the Microsoft.Exchange.WebServices

using Microsoft.Exchange.WebServices.Data;

Connect to Exchange Web Services as user1 at and select the version of the exchange you are using

var service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.UseDefaultCredentials = true;

Select the folder that you want to get its items. In this case should select the calendar to get the online meetings

var calendarFolder = new FolderId(WellKnownFolderName.Calendar);

Choose the appropriate period to get its meetings and the number of items you want to get

var calendarView = new CalendarView(DateTime.Now, DateTime.Now.AddMonths(1), 1000);
var UCOpenedConferenceID = 
    new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings,
var OnlineMeetingExternalLink =
    new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings,

Start getting the items of the folder

PropertySet iDPropertySet =
    new PropertySet(BasePropertySet.IdOnly) {UCOpenedConferenceID};
calendarView.PropertySet = iDPropertySet;
var lyncMeetings = new List();
var appoResult = service.FindAppointments(calendarFolder, calendarView);
foreach (var appointment in appoResult)
    object UCconfId = null;
    if(appointment.TryGetProperty(UCOpenedConferenceID, out UCconfId))

Start getting the details of each item

var detailPropertySet =
new PropertySet(BasePropertySet.FirstClassProperties) { OnlineMeetingExternalLink };
service.LoadPropertiesForItems(lyncMeetings, detailPropertySet);
foreach (Appointment appointment in lyncMeetings)
    object lyncMeetingUrl = null;
    appointment.TryGetProperty(OnlineMeetingExternalLink, out lyncMeetingUrl);

Download EWS API

Microsoft Lync Server

Microsoft Lync Server (previously Microsoft Office Communications Server OCS and Microsoft Live Communication Server LCS) is an enterprise real-time communications server, providing the infrastructure for enterprise instant messaging, presence, file transfer, peer-to-peer and multiparty voice and video calling , ad-hoc and structured conferences (audio, video and web) and, through a 3rd party gateway or SIP trunk, PSTN connectivity. These features are available within an organization, between organizations, and with external users on the public internet or standard phones, on the PSTN as well as SIP trunking.

Versions History

  • 2013 – Microsoft Lync Server 2013
  • 2010 – Microsoft Lync Server 2010
  • 2009 – Office Communications Server 2007 R2
  • 2007 – Office Communications Server 2007
  • 2006 – Live Communications Server 2005 with SP1
  • 2005 – Live Communications Server 2005, codenamed Vienna
  • 2003 – Live Communications Server 2003

Client software and devices

Microsoft Lync is the primary client application released with Lync Server. This client is used for IM, presence, voice and video calls, desktop sharing, file transfer and ad hoc conferences. Microsoft also ships the Microsoft Attendant Console. This is a version of the Lync more oriented towards receptionists or delegates / secretaries or others who get a large volume of inbound calls.

Other client software and devices include:

  • Lync Communicator Mobile is a Mobile edition of the Lync Server 2010 client and designed to offer similar functionality including voice calls, instant messaging, presence and single number reachability. Clients for all major platforms including the IPhone are being developed
  • Lync Communicator Web Access is a web instant messaging and presence client. This version works as well on IE, Firefox and Opera browsers.
  • Microsoft RoundTable is an audio and video conferencing device that provides a 360-degree view of the conference room and tracks the various speakers. This device is now produced and sold via Polycom under the product name CX5000.
  • LG-Nortel and Polycom also make IP phones in a traditional phone form factor that operate an embedded edition of Office Communicator 2007. The physical plastic phones as referred by Microsoft are also named Tanjay Phones.


One basic use of Lync Server is instant messaging and presence within a single organization. This includes support for rich presence information, file transfer, instant messaging as well as voice and video communication. (These latter features are often not possible even within a single organization using public IM clients, due to the effects of negotiating the corporate firewall and network address translation). Lync uses Interactive Connectivity Establishment for NAT traversal and TLS encryption to enable secure voice and video both inside and outside the corporate network.

Lync Server also supports remote users, both corporate users on the internet (e.g. mobile or home workers) as well as users in partner companies. Lync supports “federation” – enabling interoperability with other corporate IM networks. Federation can be configured either manually (where each partner manually configures the relevant edge servers in the other organization) or automatically (using the appropriate SRV records in the DNS).

Microsoft Lync Server uses Session Initiation Protocol (SIP) for signaling along with the SIMPLE extensions to SIP for IM and presence. Media is transferred using RTP/SRTP. The Live Meeting client uses PSOM to download meeting content. The Communicator client also uses HTTPS to connect with the web components server to download address books, expand distribution lists, etc. By default, Office Communications Server encrypts all signaling and media traffic using SIP over TLSand SRTP. There is one exception to this – traffic between the Mediation Server and a basic media gateway is carried as SIP over TCP and RTP. However, if a hybrid gateway is leveraged, such as one from Microsoft’s Open Interoperability Site, then in fact everything is encrypted from all points if (SSL certificates are configured on the gateway and TLS elected as the transmission type).

IM is only one portion of the Lync suite. The other major components are VOIP telephony and video conferencing through the desktop communicator client. Remote access is possible using mobile and web clients.

Several third parties have incorporated Lync functionality on existing platforms. HP has implemented OCS on their Halo video conferencing platform.

Microsoft released Microsoft Office Communications Server 2007 R2 in February 2009. The R2 release added the following features

  • Dial-in audio conferencing
  • Desktop sharing
  • Persistent Group Chat
  • Attendant console and delegation
  • Session Initiation Protocol trunking
  • Mobility and single-number reach