diff --git a/src/ice_transport.h b/src/ice_transport.h index 4bf7fec134b3bdb57f931c5a8e3871bbb7b2a102..1c3a4dc2b6a1442d4e64a079573c8d45ba2913b0 100644 --- a/src/ice_transport.h +++ b/src/ice_transport.h @@ -71,7 +71,9 @@ struct IceTransportOptions { std::vector<StunServerInfo> stunServers; std::vector<TurnServerInfo> turnServers; bool tcpEnable {false}; // If we want to use TCP - bool aggressive {false}; // If we use the aggressive nomination strategy + // See https://tools.ietf.org/html/rfc5245#section-8.1.1.2 + // Make negotiation aggressive by default to avoid latencies. + bool aggressive {true}; }; struct SDP { diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index a31d83b2a568ee35eae63b57884c69ed4eada4d6..7c798d75d44f57e271418d6794df7709a377a01c 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -482,7 +482,6 @@ JamiAccount::startOutgoingCall(const std::shared_ptr<SIPCall>& call, const std:: auto ice_config = getIceOptions(); ice_config.tcpEnable = true; - ice_config.aggressive = true; // This will directly select the first candidate. auto ice_tcp = createIceTransport(("sip:" + dev_call->getCallId()).c_str(), ICE_COMPONENTS, true, ice_config); if (not ice_tcp) { JAMI_WARN("Can't create ICE over TCP, will only use UDP"); @@ -2543,7 +2542,6 @@ JamiAccount::incomingCall(dht::IceCandidates&& msg, const std::shared_ptr<dht::c auto ice = createIceTransport(("sip:"+call->getCallId()).c_str(), ICE_COMPONENTS, false, getIceOptions()); auto ice_config = getIceOptions(); ice_config.tcpEnable = true; - ice_config.aggressive = true; // This will directly select the first candidate. auto ice_tcp = createIceTransport(("sip:" + call->getCallId()).c_str(), ICE_COMPONENTS, true, ice_config); std::weak_ptr<SIPCall> wcall = call; diff --git a/src/jamidht/p2p.cpp b/src/jamidht/p2p.cpp index 75b5a9471e9a291318fa2fc71568a6ced41f7728..ef90528acc899f8320eeaca1354df3887f82f51d 100644 --- a/src/jamidht/p2p.cpp +++ b/src/jamidht/p2p.cpp @@ -373,7 +373,6 @@ private: auto &iceTransportFactory = Manager::instance().getIceTransportFactory(); auto ice_config = parent_.account.getIceOptions(); ice_config.tcpEnable = true; - ice_config.aggressive = true; // This will directly select the first candidate. auto ice = iceTransportFactory.createTransport(parent_.account.getAccountID().c_str(), 1, false, ice_config); if (ice->waitForInitialization(ICE_INIT_TIMEOUT) <= 0) { @@ -728,7 +727,6 @@ DhtPeerConnector::Impl::answerToRequest(PeerConnectionMsg&& request, auto &iceTransportFactory = Manager::instance().getIceTransportFactory(); auto ice_config = account.getIceOptions(); ice_config.tcpEnable = true; - ice_config.aggressive = true; ice_config.onRecvReady = [iceReady]() { auto& ir = *iceReady; std::lock_guard<std::mutex> lk{ir.mtx};