Read an Excerpt
Professional Unified Communications Development with Microsoft Lync Server 2010
By George Durzi Michael Greenlee
John Wiley & SonsCopyright © 2011 John Wiley & Sons, Ltd
All right reserved.
Chapter OneBuilding Communications Solutions with Microsoft Lync Server 2010
WHAT'S IN THIS CHAPTER?
* What Is Lync? * Using the Lync Controls to Integrate Lync Functionality into Your Applications * Building Custom Communications Clients with the Lync API * Building Server-Side Communications Solutions with the Unified Communications Managed API * Building Communications Workflows with the Unified Communications Managed API Workflow SDK
Information workers rely heavily on two inherently inefficient technologies — email and the telephone — to perform their day-to-day job duties. If you've ever been buried in email and can only dream of achieving "inbox zero," you recognize the limitations of email as a productivity tool. When you email someone, he is probably not sitting at his desk anxiously awaiting your email and chomping at the bit to helpfully respond. Occasionally, you might receive someone's out of office notification in response to your email and realize that you probably won't get a real response for a few days. The same goes for the traditional phone: you don't know whether or not the person you are trying to reach is available to pick up your call; you end up playing voicemail tag until you finally get in touch with him or her.
Even entertaining the possibility that email and the phone are going anywhere would be naive; however, both could use a complementary technology to increase their usefulness and streamline the process of communicating and collaborating with others. Instead of calling people without knowing whether they are available, how about knowing their availability and the best way to contact them before placing the call? Instead of emailing a document back and forth with changes, how about starting an application sharing session and collaborating on the document in real time? Wouldn't it be great if you knew what an incoming call was about before you even picked it up? Or if you could pick up that call anywhere, not just at your desk?
Microsoft Lync Server 2010 — the successor to Office Communications Server — provides instant messaging, voice and video calling, online meeting, and application sharing capabilities that integrate with the tools that information workers use every day: Microsoft Office and SharePoint. When working with a Word document in SharePoint, you can see the edits that someone else who is editing the document at the same time has made and use Microsoft Lync to start an audio or instant message conversation with him to discuss the edits. Because you can see peoples' presence in various Office applications, SharePoint, and your custom-developed applications, you know whether they are actually available before contacting them.
As a Private Branch Exchange (PBX) replacement, Microsoft Lync Server 2010 can double as your phone system, enabling you to make phone calls directly from the Microsoft Lync client running on your desktop or laptop. You are no longer tethered to that hunk of plastic sitting at your desk; you can receive a call on whatever device you happen to be connected from, wherever you are. Your ability to receive calls at a certain number no longer depends on your proximity to the physical phone attached to that number.
If you have an Internet connection and a headset, that's all you need! This is what happens when telephony moves from being a hardware solution to a software one.
Have you begun thinking of the types of communications features that you can build into your applications? After a brief introduction of the functionality available in the Microsoft Lync Server 2010 product, this chapter gives you a developer-centric overview of the types of communications solutions that you can build on top of it.
You'll learn about the Lync software development kit (SDK), which includes the Lync controls that you can use to integrate Lync functionality such as presence and click-to-call into your applications. The Lync SDK also includes the Lync API; a brand-new, managed API for building communications-enabled applications. Finally, the chapter shows you how the Unified Communications Managed API 3.0 (UCMA 3.0) and the Unified Communications Managed API 3.0 Workflow SDK (UCMA 3.0 Workflow SDK) are used to build server-side communications solutions such as automatic call distributors, conferencing solutions, Interactive Voice Response (IVR) systems, and virtual personal assistants.
LYNC PRODUCT OVERVIEW
So, what is Lync? Microsoft Lync Server 2010 is the successor to Office Communicators Server, and Live Communications Server before that. Although most people might be familiar with Lync as an enterprise instant messaging solution, it's a lot more than that when you take advantage of all the features it has to offer.
Lync adds value to the Microsoft applications that you use every day: Office and SharePoint. It provides a unified communication and collaboration experience across Office and SharePoint, providing the same way to start an instant message, audio call, or desktop sharing session with a contact regardless of the application you are working in. The new Lync client (the replacement for Microsoft Communicator) enables you to connect with people within your organization by allowing you to perform a skills search to find coworkers with a particular skill. The Lync skills search queries users' My Sites for skills that they have indicated expertise in.
Lync provides a built-in conferencing solution that you can use to schedule and host online meetings with contacts both inside and outside your organization. Online meetings are easy to create by scheduling them in Outlook, or by selecting a list of contacts in Lync and starting an ad-hoc meeting. For users outside your organization who don't have the Lync client installed, the Lync Web App — the successor to LiveMeeting — enables them to join your online meeting and participate in your application sharing session. Attendees can dial in to a conference call, or have the Lync Web App call them back on a number they provide. A new conference lobby experience allows presenters and the meeting organizers to exercise more control over the online meeting by notifying them when people outside the organization join the meeting and providing them with the option to admit these visitors (or not) into the meeting.
This book is not geared to people responsible for architecting, deploying, and administering Microsoft Lync Server 2010 in an enterprise environment; however, the following is a brief overview of the new features available to administrators.
The Microsoft Lync Server 2010 Control Panel is a new Silverlight-based tool for administering a Lync deployment; it includes functionality to:
* Manage users
* Manage the various servers in the Lync topology
* Configure instant messaging and presence
* Create and maintain voice dialing plans
* Configure conferencing
* Monitor the quality of service in the deployment
* Adjust bandwidth utilization
Administrators can alternatively use PowerShell to execute management scripts in the topology. The Lync Server Management Shell provides an experience that Exchange and SharePoint administrators are already familiar with from managing their environments using PowerShell.
Now that you know a little bit about the functionality offered by Microsoft Lync Server 2010, it's time to learn about the development tools that you use to build communications functionality into your applications.
BUILDING COMMUNICATIONS APPLICATIONS WITH THE LYNC SDK
The Lync 2010 SDK includes the Lync controls, a set of Silverlight and Windows Presentation Foundation (WPF) controls that you can use to integrate functionality found in the Lync client directly into your applications.
The SDK also includes the Lync application programming interface (API), a brand-new, managed API for building custom communications solutions. The Lync API is intended to replace the IMessenger and UCC APIs available with Office Communications Server 2007 R2. The IMessenger API was easy to get started with, but was fairly limited in functionality; it was also a little cumbersome to troubleshoot because it used COM interoperability to interact with the running instance of Communicator on the user's machine.
The UCC API was very difficult to get started with in comparison, but it provided the most power and functionality if you wanted to build a Communicator replacement. Unlike the UCC API, the Lync API requires the Lync client to be running — it reuses the connection that the client has established with the Lync infrastructure. You can configure the Lync client to run in UI Suppression mode -where its user interface is invisible to the user — enabling you to build custom communications clients previously only possible when using the UCC API.
Integrating Lync Functionality into Your Applications Using the Lync Controls
Think of the Lync client as being built out of LEGO blocks, each providing a specific piece of functionality such as showing the presence of contacts, organizing contacts into groups, and interacting with contacts by starting instant message or phone conversations. The Lync controls separate the functionality in Lync clients into individual controls that developers can drag and drop into their Windows Presentation Foundation (WPF) or Silverlight applications.
The Lync controls include a control to show the presence of a contact; for example, the presence of an account manager in a CRM system. Controls are also available to easily start an instant message or audio conversation with that contact at the click of a button with no additional code required.
A set of other controls provides functionality for managing contact lists; for example, to integrate the user's Lync contact list into an application. You can also use custom contact lists to create and display an ad-hoc list of contacts, such as the account team for a client in a CRM application. Additional controls are available to search for contacts and display the results. Controls are also available to set the current user's presence, personal note, and location.
Due to their obvious dependence on user interface elements of the Lync client, the Lync controls are not available in UI Suppression mode.
Integrating Lync functionality into applications using the Lync controls allows users to launch communications directly from the application that they are working in without needing to switch to the Lync client. The Lync controls are available in WPF and Silverlight and are extremely easy to use; you only need to drag and drop the appropriate controls into the application, and they work without the need for any additional code.
Integrating Communications into Your Applications Using the Lync API
The Lync API object model exposes extensibility points that allow developers to build applications that interact with the running instance of the Lync client. You can use the Lync API to programmatically sign a user into the Lync client and handle events for changes in its state. You can also start a conversation, add participants, handle conversation and participant events, and add contextual data to the conversation.
You can use the Lync API to create subscriptions on attributes of contacts in your contact list; for example, to track when the availability of a particular contact changes. The Lync API also provides functionality to modify attributes of users signed in to Lync, such as changing their presence or publishing a personal note or location.
Like the IMessenger API, the Lync API includes automation: the ability to start conversations in different modalities (such as instant message or audio/video) with a very small amount of code. The functionality in automation simply invokes the necessary Lync user interface elements, such as a Lync conversation that includes the Application Sharing modality so that a user can share her desktop with another user. Because it is dependent on Lync user interface elements, the functionality in automation is not available when the Lync client is running in UI Suppression mode.
In conjunction with the Lync controls, you can use the Lync API to easily add communications functionality into Silverlight, WPF, and Windows Forms applications. For example, you can spruce up a customer relationship management (CRM) application by integrating presence and click-to-call functionality, allowing users to accomplish their work without needing to switch back and forth between the application and the Lync client.
Working with Lync UI Suppression
When the Lync client is configured to run in UI Suppression mode, its interface is completely hidden from the user. Applications that use Lync UI Suppression are responsible for recreating those user interface elements from scratch. The Lync API with Lync running in UI Suppression mode is the recommended development pattern for applications you would have previously built with the UCC API.
Lync UI Suppression requires that the Lync client is installed on the user's machine; this eliminates the complexity of managing the connectivity of the application back to the Lync server infrastructure. In UI Suppression, you use the Lync API to replicate some of the functionality available in the Lync client, such as signing users into Lync, retrieving their contact list, and starting and responding to conversations in different modalities.
When working with UI Suppression, you interact with conversations at the modality level — activating individual modalities manually, creating conversations, adding participants, and disconnecting the modalities when the conversation is completed. For example, you can build a Silverlight instant messaging client that provides a completely customized user interface for instant message conversations. In this case, you would be responsible for recreating application functionality and user interface elements such as a contact list and conversation window. You would work directly with the instant message modality, creating a conversation, connecting the modality, sending instant message text to participants, notifying participants when someone is typing, and delivering the instant message text to the participants in the conversation.
Using the Lync API with Lync running in UI Suppression mode, you can build compelling Lyncreplacement solutions such as a custom instant messaging client, or a dedicated audio/video conferencing solution.
Adding Context to Conversations
The context of a conversation refers to the subject or topic of the conversation; the Lync API provides some mechanisms for embedding context directly into a conversation, allowing the participants to immediately know what a new conversation is about.
A great example of adding context to a conversation is the "Reply by IM" feature in Microsoft Outlook that allows you to respond to an email message using Lync. The message recipient sees the subject of the original email message in the incoming conversation notification window (also known as the toast) and as the title of the conversation window. When the person receives the instant message, she knows right away what you are contacting her about.
The Lync API introduces the concepts of Launch Link context and Lync Extensibility Window context that you can use to enhance the communications capabilities of your applications by embedding context into the conversations started by the application.
Launch Link context allows conversation recipients to launch applications directly from the Lync conversation window. For example, you select a customer account when working with a CRM application; after selecting the account, you can see the account manager's presence and are able to start an instant message or audio conversation with her directly from the application. The conversation that the account manager receives contains a link that she can use to launch the CRM application directly from the conversation window. The contextual data payload supplied with the conversation also includes information about the particular account that you are contacting her about. The user can launch the CRM application and automatically load the customer account record in question.
Excerpted from Professional Unified Communications Development with Microsoft Lync Server 2010 by George Durzi Michael Greenlee Copyright © 2011 by John Wiley & Sons, Ltd. Excerpted by permission of John Wiley & Sons. All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.