Open
Description
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
}