远程用户关闭Lync聊天窗口后,会话状态为Terminated。我怎样才能重建它们呢?
我做错了什么?(它抛出"当前对象状态下的操作无效(终止)")
void conversation_StateChanged(object sender, StateChangedEventArgs<ConversationState> e)
{
if (e.State == ConversationState.Terminated)
{
_terminated = true;
}
if (e.State == ConversationState.Established)
{
_terminated = false;
}
}
if (_terminated)
{
imCall.BeginEstablish(null, null, (ar) =>
{
flow = imCall.Flow;
_callEstablishComplete.Set();
}, null);
_callEstablishComplete.WaitOne();
}
答案 0 :(得分:0)
conversation = new Conversation(endPoint, settings);
imCall = new InstantMessagingCall(conversation);
imCall.BeginEstablish("sip:xxx@abc.com", null, (ar) =>
{
imCall.EndEstablish(ar);
flow = imCall.Flow;
_callEstablishComplete.Set();
}, null);
就够了!