From b89f308087772eca82c279ff4a28317964673e76 Mon Sep 17 00:00:00 2001 From: jianjunz Date: Mon, 3 Apr 2023 16:04:17 +0800 Subject: [PATCH] Don't close PeerConnection when chat-ua is received. (#700) When local endpoint is a caller, chat-ua is received after the PeerConnection is created. --- talk/owt/sdk/p2p/p2pclient.cc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/talk/owt/sdk/p2p/p2pclient.cc b/talk/owt/sdk/p2p/p2pclient.cc index ec50eb4a4..c20855f26 100644 --- a/talk/owt/sdk/p2p/p2pclient.cc +++ b/talk/owt/sdk/p2p/p2pclient.cc @@ -320,16 +320,6 @@ void P2PClient::OnSignalingMessage(const std::string& message, return; } - } else if (message.find("\"type\":\"chat-ua\"") != std::string::npos) { - // "chat-ua" is the 1st message of a new connection. If there is an old - // PCC exists, close it and create a new one. - auto pcc = that->GetPeerConnectionChannel(remote_id); - // Don't send stop to remote. - pcc->SetAbandoned(); - { - const std::lock_guard lock(that->pc_channels_mutex_); - that->pc_channels_.erase(remote_id); - } } // Secondly dispatch the message to pcc. auto pcc = that->GetPeerConnectionChannel(remote_id);