Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollback SDP type not working? #2416

Open
davewasmer opened this issue Feb 11, 2023 · 0 comments
Open

Rollback SDP type not working? #2416

davewasmer opened this issue Feb 11, 2023 · 0 comments

Comments

@davewasmer
Copy link

Your environment.

  • Version: 3.1.17

What did you do?

peerConnection.SetLocalDescription(webrtc.SessionDescription{Type: webrtc.SDPTypeRollback})

What did you expect?

The connection state is rolled back, and the local and remote descriptions are cleared.

What happened?

InvalidModificationError: invalid SDP type supplied to SetLocalDescription(): rollback

Hypothesis

It seems that this section of peerconection.go might be the issue:

if desc.SDP == "" {
	switch desc.Type {
	case SDPTypeAnswer, SDPTypePranswer:
		desc.SDP = pc.lastAnswer
	case SDPTypeOffer:
		desc.SDP = pc.lastOffer
	default:
		return &rtcerr.InvalidModificationError{
			Err: fmt.Errorf("%w: %s", errPeerConnSDPTypeInvalidValueSetLocalDescription, desc.Type),
		}
	}
}

The SDPTypeRollback case isn't handled here, despite being handled in the underlying SetDescription function:

case SDPTypeRollback:
	nextState, err = checkNextSignalingState(cur, SignalingStateStable, setLocal, sd.Type)
	if err == nil {
		pc.pendingLocalDescription = nil
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants