From 404c692992be7d47b38821f55624475e2dcd5327 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 23 Jul 2026 22:32:25 +0200 Subject: [PATCH] MT#59962 AmSdp: print DTLS `fingerprint` & `setup` When parsing SDP and not being in the path of the media stream, `fingerprint` and `setup` aren't considered as generic attributes and are parsed into the dedicated SdpMedia fields. So when preparing SDP to be printed and to be sent out, take them also into account. (Looks like was missed when reworking stuff last time around media processing) Change-Id: I48437d3587321a04395b70823207292590ea6523 --- core/AmSdp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/AmSdp.cpp b/core/AmSdp.cpp index 3db64afd..500095b8 100644 --- a/core/AmSdp.cpp +++ b/core/AmSdp.cpp @@ -656,6 +656,13 @@ void AmSdp::print(string& body) const out_buf += a_it->print(); } + // add DTLS attributes + if (!media_it->dtls_role.empty()) + out_buf += "a=setup:" + media_it->dtls_role + "\r\n"; + if (!media_it->dtls_hash.empty() && !media_it->dtls_fingerprint.empty()) + out_buf += "a=fingerprint:" + media_it->dtls_hash + " " + + media_it->dtls_fingerprint + "\r\n"; + // add ICE credentials if (!media_it->ice_username.empty() && !media_it->ice_password.empty()) { out_buf += "a=ice-ufrag:" + media_it->ice_username + "\r\n"; @@ -2046,4 +2053,3 @@ static bool attr_check(std::string attr) return false; } } -