1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

SquashSRS4: Fix DTLS config bug, dup Alert bug. 4.0.83

This commit is contained in:
winlin 2021-03-08 12:39:25 +08:00
parent fe1b427462
commit de65a331f1
9 changed files with 43 additions and 15 deletions

View file

@ -590,18 +590,23 @@ srs_error_t SrsRtcServer::do_create_session(
srs_trace("RTC: Use candidates %s", srs_join_vector_string(candidate_ips, ", ").c_str());
}
// Setup the negotiate DTLS by config.
local_sdp.session_negotiate_ = local_sdp.session_config_;
// Setup the negotiate DTLS role.
if (remote_sdp.get_dtls_role() == "active") {
local_sdp.set_dtls_role("passive");
local_sdp.session_negotiate_.dtls_role = "passive";
} else if (remote_sdp.get_dtls_role() == "passive") {
local_sdp.set_dtls_role("active");
local_sdp.session_negotiate_.dtls_role = "active";
} else if (remote_sdp.get_dtls_role() == "actpass") {
local_sdp.set_dtls_role(local_sdp.session_config_.dtls_role);
local_sdp.session_negotiate_.dtls_role = local_sdp.session_config_.dtls_role;
} else {
// @see: https://tools.ietf.org/html/rfc4145#section-4.1
// The default value of the setup attribute in an offer/answer exchange
// is 'active' in the offer and 'passive' in the answer.
local_sdp.set_dtls_role("passive");
local_sdp.session_negotiate_.dtls_role = "passive";
}
local_sdp.set_dtls_role(local_sdp.session_negotiate_.dtls_role);
session->set_remote_sdp(remote_sdp);
// We must setup the local SDP, then initialize the session object.