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.

4

1 に答える 1

21

Lync SDKから始める必要があります。アプリを Winforms または WPF アプリとしてビルドできます。

サインイン

Lync の実行中のインスタンスに接続してサインインするには、SDK からこのページを確認してください。LyncClientLync を表すオブジェクトへの参照を保持していることを確認してください。これは、静的メソッドを呼び出すことで取得できますLyncClient.GetClient()

着信を検出する

着信を検出するために、ConversationManager.ConversationAddedイベントをリッスンできます。インスタンスConversationManagerのプロパティです。LyncClient

通話が a) 音声通話であるか、b) 着信 (ユーザーによる発信通話ではなく) であるかを判断するには、次の方法を使用できます。

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;
}

イベントでは、ConversationAddedイベントにサインアップしてConversation.ParticipantAdded、発信者が誰であるかを確認できるようにする必要があります。EventArgs オブジェクトにはParticipantプロパティがあり、このプロパティにもContactプロパティがあります。このContactプロパティには、電話番号を提供する を含む多数のプロパティがありUriます (それが必要な場合)。

その後、DB 呼び出しを行い、情報をポップできます。

編集:スクリーン ポップに関するブログ記事を書きました。詳細については、こちらを参照してください。

電話をかける

アプリが WPF の場合、呼び出しを許可する最も簡単な方法は、StartAudioCallButtonコントロールを使用することです。それ以外の場合は、ここの手順が役立ちます。

于 2011-08-22T09:58:24.030 に答える