From df9b5a5185c91e8da3ca5a108ddb7a217005f9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Fri, 16 Feb 2024 12:51:58 +0100 Subject: [PATCH] Revert changes since ICE fields cannot be in DtlsParameters (obviously) --- src/Transport.ts | 8 -------- src/handlers/sdp/commonUtils.ts | 23 ++++++++--------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/Transport.ts b/src/Transport.ts index ad974d08..3f0fe9f2 100644 --- a/src/Transport.ts +++ b/src/Transport.ts @@ -100,14 +100,6 @@ export type DtlsParameters = { * Server DTLS fingerprints. */ fingerprints: DtlsFingerprint[]; - /** - * ICE ufrag. - */ - iceUfrag?: string; - /** - * ICE password. - */ - icePwd?: string; }; /** diff --git a/src/handlers/sdp/commonUtils.ts b/src/handlers/sdp/commonUtils.ts index 8084e924..4528c559 100644 --- a/src/handlers/sdp/commonUtils.ts +++ b/src/handlers/sdp/commonUtils.ts @@ -151,16 +151,16 @@ export function extractDtlsParameters({ }): DtlsParameters { let setup = sdpObject.setup; let fingerprint = sdpObject.fingerprint; - let iceUfrag = sdpObject.iceUfrag; - let icePwd = sdpObject.icePwd; - const mediaObject = (sdpObject.media || []).find( - (m: { port: number }) => m.port !== 0 - ); + if (!setup || !fingerprint) { + const mediaObject = (sdpObject.media || []).find( + (m: { port: number }) => m.port !== 0 + ); - if ((!setup || !fingerprint) && mediaObject) { - setup ??= mediaObject.setup; - fingerprint ??= mediaObject.fingerprint; + if (mediaObject) { + setup ??= mediaObject.setup; + fingerprint ??= mediaObject.fingerprint; + } } if (!setup) { @@ -169,11 +169,6 @@ export function extractDtlsParameters({ throw new Error('no a=fingerprint found at SDP session or media level'); } - if ((!iceUfrag || !icePwd) && mediaObject) { - iceUfrag ??= mediaObject.iceUfrag; - icePwd ??= mediaObject.icePwd; - } - let role: DtlsRole | undefined; switch (setup) { @@ -204,8 +199,6 @@ export function extractDtlsParameters({ value: fingerprint.hash, }, ], - iceUfrag, - icePwd, }; return dtlsParameters;