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.
1 に答える
Lync SDKから始める必要があります。アプリを Winforms または WPF アプリとしてビルドできます。
サインイン
Lync の実行中のインスタンスに接続してサインインするには、SDK からこのページを確認してください。LyncClient
Lync を表すオブジェクトへの参照を保持していることを確認してください。これは、静的メソッドを呼び出すことで取得できます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コントロールを使用することです。それ以外の場合は、ここの手順が役立ちます。