确定呼叫何时是语音/视频并找出谁发起了呼叫 [英] Determine when a call is voice/video and find out who initiated the call
问题描述
您好
我是使用Lync 2010 SDK进行客户端开发的新手。
I am new to client development using the Lync 2010 SDK.
我的要求是1) 检测当通过Lync进行语音或视频呼叫时,2)确定谁发出/发起呼叫(本地用户或另一方),以及3)获取另一方的电话号码。
My requirement is to 1) detect when a voice or video call is made over Lync, 2) determine who placed/initiated the call (the local user or the other party), and 3) obtain the telephone number of the other party.
我正在使用LyncClient.ConversationManager.ConversationAdded事件的事件处理程序。到目前为止,我在3)成功只是因为我基本上遍历了呼叫的参与者,如果参与者对象不是本地参与者,
我查找参与者的URI,其中包含电话号码。但是,我上面的1和2并没有太多运气,我将非常感谢你的帮助。
I am using an event handler of the LyncClient.ConversationManager.ConversationAdded event. So far, I have been successful at 3) only because I basically loop through the participants of the call and if the Participant object is not the local Participant, I lookup that Participant's URI which contains the phone number. However, I have not had much luck with 1 and 2 above and I would appreciate your assistance please.
谢谢你
Terence
推荐答案
1。您应该使用VideoChannel和AudioChannel对象并将它们附加到AVModality对象以接收对它们的传入呼叫,并为两者实现事件处理程序以确定调用的类型。
1. you should VideoChannel and AudioChannel Objects and attach them to AVModality object to receive the incoming calls on them and implement the events handlers for both to kbow what is the type of the call.
_audioChannel = _audioVideoModality.AudioChannel;
_audioChannel.StateChanged += new EventHandler<ChannelStateChangedEventArgs>(_audioVideoModality_AudioChannelStateChanged);
_videoChannel = _audioVideoModality.VideoChannel;
_videoChannel.StateChanged += new EventHandler<ChannelStateChangedEventArgs>(_audioVideoModality_VideoChannelStateChanged);
private void _audioVideoModality_AudioChannelStateChanged(object sender, ChannelStateChangedEventArgs e)
{
// your implementation for Audio Calls
}
private void _audioVideoModality_VideoChannelStateChanged(object sender, ChannelStateChangedEventArgs e)
{
// your implementation for vidio Calls
}
2。 ConversationManager负责这一点
2. The ConversationManager is responsible for this point
你应该自己创建它
创建一个bool变量_isIncomingCall来了解如何启动你自己联系的对话或另一方
create a bool variable _isIncomingCall to know how is initiate the conversation your self contact or the other party
这篇关于确定呼叫何时是语音/视频并找出谁发起了呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!