Microsoft Lync and Skype for Business have a rich set of .NET APIs which make it easy to extend the platform and integrate it with other applications. This blog helps explain how to use those APIs.

UCMA 101 – Lync Developer Roundtable

Posted: March 12th, 2012 | Author: | Filed under: Lync Development, UCMA 3.0 | 1 Comment »

For anyone who is just starting out with UCMA development, I’m doing a UCMA 101 session for the Lync Developer Roundtable series. Click on the link for the online meeting details. I’ll be talking about UCMA, what it’s good for, and some of the basics of UCMA development.


Sending a call to a specific endpoint in UCMA

Posted: March 2nd, 2012 | Author: | Filed under: UCMA 3.0 | Tags: | 6 Comments »

One of the cool things about Lync that people often take for granted is that you can sign in from multiple computers (or devices), and any call that is sent to you will ring at all of those various locations. There’s quite a bit of complex routing logic that goes into this, but it mostly takes place under the covers, and even when you’re developing a UCMA application, you generally don’t need to worry about it. If you create a new AudioVideoCall object and call AudioVideoCall.BeginEstablish with a SIP URI, Lync automatically “forks” that call to all of the registered endpoints for that user. Basically when the call hits the Lync Front End Server, the Front End Server sends a branch to each of the endpoints where that user is signed in. The first one to answer gets to take the call.

While it’s very courteous of Lync Server to do all of this stuff on its own without bothering us, the branching behaviour can sometimes get in the way. You might want to send an IM or a call to a user at one specific location. Maybe you want a call to go only to the user’s IP desk phone, but not to the Lync client on the PC. What do you do in a case like this? Continue reading “Sending a call to a specific endpoint in UCMA” »


What are Conversation objects for?

Posted: February 22nd, 2012 | Author: | Filed under: UCMA 2.0, UCMA 3.0 | Tags: | No Comments »

To make it possible for developers to extend the functionality of Lync without having to deal with the nitty-gritty details of Session Initiation Protocol (a.k.a. SIP), UCMA introduces a lot of abstractions. One of the abstractions that pops up most frequently is the Conversation class. Unfortunately, it’s also one of the most confusing to new UCMA developers. This is partly because its purpose isn’t immediately obvious when you start doing things like sending IMs or answering audio calls. Continue reading “What are Conversation objects for?” »


Handling application sharing calls in UCMA

Posted: February 6th, 2012 | Author: | Filed under: UCMA 3.0 | Tags: , | 4 Comments »

UCMA doesn’t include support for application sharing calls out of the box; it can handle only audio/video and instant messaging calls. This is normally not a big deal, since there’s not a whole lot that you could do in UCMA with application sharing. By virtue of not having a screen image to share, a UCMA app would be a pretty meaningless participant in an application sharing call. There’s one case, though, where being able to handle application sharing calls would be convenient: creating back-to-back calls between other Lync users. Continue reading “Handling application sharing calls in UCMA” »


Sending formatted IMs from a UCMA application

Posted: January 29th, 2012 | Author: | Filed under: UCMA 3.0 | Tags: , , , | 2 Comments »

I can’t honestly say that I’ve run into a lot of situations where I’ve said to myself, “If only I could send an HTML formatted instant message right now, my problems would go away.” But adding formatting to IMs can definitely help with some specialized communication applications such as bots where you want to distinguish different types of messages, or emphasize certain parts of a conversation. So, to make those nice visual touches easier, and for anyone out there who is in a tight spot by virtue of not knowing how to send an IM with special formatting, I thought I’d write up a quick post on it. Continue reading “Sending formatted IMs from a UCMA application” »


Call forwarding, UCMA, and “derived conversations”

Posted: January 25th, 2012 | Author: | Filed under: UCMA 3.0 | Tags: , , , , | 2 Comments »

If you have a UCMA application that communicates with users via both IM and audio in the same conversation, you may one day be caught off guard by the following exception:

Microsoft.Rtc.Signaling.OperationFailureException: Application must register 
for ConversationChanged event when a call is moved to a derived conversation.

Specifically, this exception occurs if you try to add audio to a conversation that currently only has instant messaging and/or application sharing, and the remote party redirects the audio call to a PSTN phone; maybe because they don’t have headphones plugged in, or because they are on a wireless network which has been causing poor audio quality, or even because they are logged in on a client that doesn’t support audio. Continue reading “Call forwarding, UCMA, and “derived conversations”” »


Calling an Exchange UM voicemail box directly

Posted: January 22nd, 2012 | Author: | Filed under: Lync Development, UCMA 2.0, UCMA 3.0 | Tags: , | 4 Comments »

A few posts ago I explained how you can determine whether a call placed by your UCMA application has been answered by an Exchange voicemail box. In this post I want to share another quick tip on UCMA and voicemail: how to place a call directly to a voicemail box. Continue reading “Calling an Exchange UM voicemail box directly” »


How to get the “is typing…” messages through UCMA

Posted: January 9th, 2012 | Author: | Filed under: UCMA 3.0 | Tags: , , , | 2 Comments »

If you’re writing a UCMA application that handles instant messaging, you may at some point want to replicate the effect that users of the Lync client get where a message shows up notifying you when the other person is typing. This makes it a bit easier for people to carry on a conversation over instant messaging without constantly interrupting one another. Triggering and receiving this notification is actually quite easy in UCMA, but the way to do it is not immediately obvious. Continue reading “How to get the “is typing…” messages through UCMA” »


Reducing media traffic from UCMA using call hold

Posted: December 27th, 2011 | Author: | Filed under: UCMA 3.0 | Tags: | No Comments »

For complex UCMA applications that handle things like quality monitoring, call recording, or call flow management, the effect of the UCMA application on network traffic can become a concern. For a UCMA application to act as a participant in an audio, video, or application sharing call, there must be a media stream flowing from the application to the remote party on the call, and another media stream flowing from the remote party back to the application, as in the diagram below. Each of these streams will take up bandwidth on whatever network the media must traverse to flow between the endpoints, or on the connection to the public Internet if the remote endpoint is an individual user logged into Lync remotely. Continue reading “Reducing media traffic from UCMA using call hold” »


Conference invitations vs. MCU dial-outs

Posted: December 20th, 2011 | Author: | Filed under: Conferencing, Lync Development, UCMA 3.0 | Tags: , , | 10 Comments »

At times I find it confusing to how an MCU dial-out (as triggered by methods like AudioVideoMcuSession.BeginDialOut in UCMA) differs from a conference invitation (ConferenceInvitation class in UCMA). In my previous post I described what happens behind the scenes when a conference invitation is sent to a Lync user, so I thought I would take this post to explain the very different process that occurs during an MCU dial-out. UCMA does a very good job of putting a layer of abstraction over the extensive SIP signaling that goes on at a lower level during both of these operations, which is a good thing overall, since it frees up developers to focus on solving business problems using the API. However, at times it is useful to know things like the underlying difference between a conference invitation and an MCU dial-out in order to solve complex technical questions. Continue reading “Conference invitations vs. MCU dial-outs” »