Skip to content

Commit

Permalink
Revert changes since ICE fields cannot be in DtlsParameters (obviously)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Feb 16, 2024
1 parent 022a1b1 commit df9b5a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
8 changes: 0 additions & 8 deletions src/Transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ export type DtlsParameters = {
* Server DTLS fingerprints.
*/
fingerprints: DtlsFingerprint[];
/**
* ICE ufrag.
*/
iceUfrag?: string;
/**
* ICE password.
*/
icePwd?: string;
};

/**
Expand Down
23 changes: 8 additions & 15 deletions src/handlers/sdp/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -204,8 +199,6 @@ export function extractDtlsParameters({
value: fingerprint.hash,
},
],
iceUfrag,
icePwd,
};

return dtlsParameters;
Expand Down

0 comments on commit df9b5a5

Please sign in to comment.