将Lync 2010与外部程序集成 [英] Integrating Lync 2010 with an external program

查看:68
本文介绍了将Lync 2010与外部程序集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将Lync 2010与一个程序进行集成,该程序可以执行DB查找,并显示一个小的弹出窗口,所找到的信息以及一些带有某些选项的按钮.
该程序已经在其他类型的电话系统上运行,我有点需要Lync的连接器.
我不想在Lync内放置选项卡或其他UI.

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.

推荐答案

您需要从

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

登录

要连接并登录到正在运行的Lync实例,请检出

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()

检测来电

要检测来电,您可以侦听 ConversationManager.ConversationAdded 事件. ConversationManager 是您的 LyncClient 实例上的一个属性.

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

要确定该呼叫是否为a)音频呼叫和b)来电(与用户拨打的电话相对),可以使用以下方法:

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

ConversationAdded 事件中,您应该注册 Conversation.ParticipantAdded 事件,以便检查呼叫者是谁.EventArgs对象具有参与者属性,而该属性又具有 Contact 属性. Contact 属性具有许多属性,包括 Uri ,该属性应为您提供电话号码(如果您需要的话).

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.

编辑:我写了一篇有关屏幕弹出的博客文章,其中有更多详细信息-

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

发起呼叫

如果您的应用程序是WPF,则允许拨打电话的最简单方法是使用 StartAudioCallButton 控件.否则,此处的说明应该会有所帮助.

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.

这篇关于将Lync 2010与外部程序集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆