0

远程用户关闭其 Lync 聊天窗口后,对话状态为已终止。我怎样才能重新建立它们?

我的操作有什么问题?(它抛出“操作在当前对象状态下无效(已终止)”)

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();
            }
4

1 回答 1

0

经过几十次试验,我发现它很容易解决。我应该做的是创建一个新的 IM 通话对象:

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

足够了!

于 2014-07-18T07:36:40.837 回答