Integrating Lync 2010 with an external program
Asked Answered
A

1

13

How can I integrate Lync 2010, with a program that does a DB look up and shows a small popup, with the information found, and also a few buttons with some options.
The program is already running with some other types of phone systems, I kind of need a connector for Lync.
I don't want to put a tab or other UI inside Lync.

Ajit answered 22/8, 2011 at 7:52 Comment(3)
Presumably this is a Screen-pop type app - i.e. it detects an incoming audio call, then pops up information about the caller?Helfand
Yes, exactly. And it also lets the user call out from a list, which derives from the DB. This call should be send to Lync, which then place the call.Ajit
I just saw that the example in 2010 SDK, AudioVideoConversation, is pretty much doing what I want, I'll investigate it.Ajit
H
21

You'll need to start with the Lync SDK. You can build your app as a Winforms or WPF app.

Signing In

To connect and sign in to the running instance of Lync, check out this page from the SDK. Make sure you keep a reference to the LyncClient object that represents Lync. This can be got by calling the static method LyncClient.GetClient()

Detecting an incoming call

To detect an incoming call, you can listen for the ConversationManager.ConversationAdded event. ConversationManager is a property on your LyncClient instance.

To determine if the call is a) an Audio call, and b) incoming (as opposed to an outgoing call placed by the user) you can use the following method:

bool IsIncomingAVCall(Conversation conversation)
{
    // Test to see if the call contains the AV modality
    bool containsAVModality = conversation.Modalities.ContainsKey(ModalityTypes.AudioVideo);

    if (containsAVModality)
    {
        // Get the state of the AV modality
        var state = conversation.Modalities[ModalityTypes.AudioVideo].State;

        // 'Notified' means the call is incoming
        if (state == ModalityState.Notified) return true;
    }

    return false;
}

In the ConversationAdded event, you should sign up to the Conversation.ParticipantAdded event, so you can check who the caller is. The EventArgs object has a Participant property, which in turn has a Contact property. The Contact property has a number of properties including Uri, which should give you the phone number (if that's what you need).

You can then make your DB call and pop your info.

Edit: I've written a blog post about screen pops which goes into much more detail - here

Placing a call

If your app is WPF, the easiest way to allow a call to be placed is by using the StartAudioCallButton control. Otherwise, the instructions here should help.

Helfand answered 22/8, 2011 at 9:58 Comment(7)
Fantastic! I'll try your suggestions and also take a deeper look at the AudioVideoConversation example.Ajit
Awesome! Don't forget to mark as answer (using the tick) if this solves your problem, to help anyone else browsing this question later - cheersHelfand
It can take a day or three to get there, but I'll remember. Thank you for your time.Ajit
I got it to work, thank for your help Paul, but how do I mark the answer?Ajit
Great, glad you got there! There should be a tick near the up and downvote buttons in the top/left of this answer that let's you accept this as the answerHelfand
Office 365 gives a good startup help for Lync 2010. Se Lab 9.3 and Lab 9.4. microsoft.com/download/en/details.aspx?id=14889Ajit
Brilliant response, some of the links are dead so i've updated themSpook

© 2022 - 2024 — McMap. All rights reserved.