Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ICE ufrag and pwd selection when different media-level attributes are present #983

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/description.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,22 @@ Description::Description(const string &sdp, Type type, Role role)
PLOG_WARNING << "Unknown SDP fingerprint format: " << value;
}
} else if (key == "ice-ufrag") {
mIceUfrag = value;
// RFC 8839: The "ice-pwd" and "ice-ufrag" attributes can appear at either the
// session-level or media-level. When present in both, the value in the media-level
// takes precedence.
if (!mIceUfrag || index == 0) // media-level for first media overrides session-level
mIceUfrag = value;
} else if (key == "ice-pwd") {
mIcePwd = value;
// RFC 8839: The "ice-pwd" and "ice-ufrag" attributes can appear at either the
// session-level or media-level. When present in both, the value in the media-level
// takes precedence.
if (!mIcePwd || index == 0) // media-level for first media overrides session-level
mIcePwd = value;
} else if (key == "ice-options") {
mIceOptions = utils::explode(string(value), ',');
// RFC 8839: The "ice-options" attribute is a session-level and media-level
// attribute.
if (mIceOptions.empty())
mIceOptions = utils::explode(string(value), ',');
} else if (key == "candidate") {
addCandidate(Candidate(attr, bundleMid()));
} else if (key == "end-of-candidates") {
Expand Down
Loading