Lync SDK使用仅发送UI抑制模式启动音频视频呼叫

时间:2014-04-03 07:04:35

标签: c# lync lync-2013 lync-client-sdk

我正在尝试在UI抑制模式下使用Lync SDK构建会议应用程序,该应用程序接近lync中的Meet Now功能,以便一个用户将他的视频/音频发送给对话中的所有其他用户,我的代码是:

// Add conversation using
_LyncClient.ConversationManager.AddConversation();

// When Conversation added add participants
// User 1 will broadcast video/audio
_Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(user1));
// User 2 and User 3 will only recieve audio video
_Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(user2));
_Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(user3));

// Start the audio call from user1 machine
avModality.BeginConnect(AVCallback);

// When recieve the call in user2, user 3 stop mic using mute
 _Conversation.SelfParticipant.BeginSetMute(true, (ar) =>
    {
        _Conversation.SelfParticipant.EndSetMute(ar);
    }, _Conversation.SelfParticipant);

// and same technique for video

虽然有效,但我注意到每次用户进入对话时,通话的性能都会受到影响,并且会话会转到“保持”,然后“返回状态”,直到添加用户为止。

如何以一种方式开始呼叫只发送(不发送recive),我尝试了以下内容:

avModality.BeginConnect(AVCallback, ChannelState.Send);

但它不起作用,我也看了Conversation PropertiesMoadilty Properties 但没有什么看起来有用。

我发现唯一相关的是avModality.AudioChannel.State,但我找不到设置此属性的方法?

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

我设法通过从发送视频的用户开始音频呼叫创建单向视频呼叫,然后在调用连接后调用avModality.VideoChannel.BeginStart的ModalityStateChanged创建。

希望这有帮助。