Skip to content

Commit

Permalink
Skip some checks when BUNDLE group value is found
Browse files Browse the repository at this point in the history
Resolves #2621
  • Loading branch information
stephanrotolante committed Apr 19, 2024
1 parent 2519df3 commit c802217
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions peerconnection_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,7 @@ func TestTransceiverCreatedByRemoteSdpHasSameCodecOrderAsRemote(t *testing.T) {
o=- 4596489990601351948 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video-1 video-2
m=video 60323 UDP/TLS/RTP/SAVPF 98 94 106
a=ice-ufrag:1/MvHwjAyVf27aLu
a=ice-pwd:3dBU7cFOBl120v33cynDvN1E
Expand Down Expand Up @@ -1459,6 +1460,7 @@ a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01
o=- 4596489990601351948 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video-1 video-2
m=video 60323 UDP/TLS/RTP/SAVPF 98 106
a=ice-ufrag:1/MvHwjAyVf27aLu
a=ice-pwd:3dBU7cFOBl120v33cynDvN1E
Expand Down
24 changes: 15 additions & 9 deletions sdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,13 @@ func extractFingerprint(desc *sdp.SessionDescription) (string, string, error) {
return "", "", ErrSessionDescriptionNoFingerprint
}

for _, m := range fingerprints {
if m != fingerprints[0] {
// https://github.com/pion/webrtc/issues/2621
groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup)

isBundled := strings.Contains(groupAttribue, "BUNDLE")

if !isBundled {
if len(fingerprints) != 1 {
return "", "", ErrSessionDescriptionConflictingFingerprints
}
}
Expand Down Expand Up @@ -769,14 +774,15 @@ func extractICEDetails(desc *sdp.SessionDescription, log logging.LeveledLogger)
return "", "", nil, ErrSessionDescriptionMissingIcePwd
}

for _, m := range remoteUfrags {
if m != remoteUfrags[0] {
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
}
}
// https://github.com/pion/webrtc/issues/2621
groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup)

isBundled := strings.Contains(groupAttribue, "BUNDLE")

for _, m := range remotePwds {
if m != remotePwds[0] {
if !isBundled {
if len(remoteUfrags) != 1 {
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
} else if len(remotePwds) != 1 {
return "", "", nil, ErrSessionDescriptionConflictingIcePwd
}
}
Expand Down

0 comments on commit c802217

Please sign in to comment.