如何在UCMA中重新建立最终用户之间的连接?

时间:2014-07-02 08:23:29

标签: ucma

远程用户关闭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();
            }

1 个答案:

答案 0 :(得分: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);

就够了!