Skip to content

Commit c802217

Browse files
Skip some checks when BUNDLE group value is found
Resolves #2621
1 parent 2519df3 commit c802217

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

peerconnection_go_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,7 @@ func TestTransceiverCreatedByRemoteSdpHasSameCodecOrderAsRemote(t *testing.T) {
13991399
o=- 4596489990601351948 2 IN IP4 127.0.0.1
14001400
s=-
14011401
t=0 0
1402+
a=group:BUNDLE video-1 video-2
14021403
m=video 60323 UDP/TLS/RTP/SAVPF 98 94 106
14031404
a=ice-ufrag:1/MvHwjAyVf27aLu
14041405
a=ice-pwd:3dBU7cFOBl120v33cynDvN1E
@@ -1459,6 +1460,7 @@ a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01
14591460
o=- 4596489990601351948 2 IN IP4 127.0.0.1
14601461
s=-
14611462
t=0 0
1463+
a=group:BUNDLE video-1 video-2
14621464
m=video 60323 UDP/TLS/RTP/SAVPF 98 106
14631465
a=ice-ufrag:1/MvHwjAyVf27aLu
14641466
a=ice-pwd:3dBU7cFOBl120v33cynDvN1E

sdp.go

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,13 @@ func extractFingerprint(desc *sdp.SessionDescription) (string, string, error) {
709709
return "", "", ErrSessionDescriptionNoFingerprint
710710
}
711711

712-
for _, m := range fingerprints {
713-
if m != fingerprints[0] {
712+
// https://github.com/pion/webrtc/issues/2621
713+
groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup)
714+
715+
isBundled := strings.Contains(groupAttribue, "BUNDLE")
716+
717+
if !isBundled {
718+
if len(fingerprints) != 1 {
714719
return "", "", ErrSessionDescriptionConflictingFingerprints
715720
}
716721
}
@@ -769,14 +774,15 @@ func extractICEDetails(desc *sdp.SessionDescription, log logging.LeveledLogger)
769774
return "", "", nil, ErrSessionDescriptionMissingIcePwd
770775
}
771776

772-
for _, m := range remoteUfrags {
773-
if m != remoteUfrags[0] {
774-
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
775-
}
776-
}
777+
// https://github.com/pion/webrtc/issues/2621
778+
groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup)
779+
780+
isBundled := strings.Contains(groupAttribue, "BUNDLE")
777781

778-
for _, m := range remotePwds {
779-
if m != remotePwds[0] {
782+
if !isBundled {
783+
if len(remoteUfrags) != 1 {
784+
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
785+
} else if len(remotePwds) != 1 {
780786
return "", "", nil, ErrSessionDescriptionConflictingIcePwd
781787
}
782788
}

0 commit comments

Comments
 (0)