Logging negotiation as we are seeing some errors with filtering candi… (#900)
This commit is contained in:
@@ -554,10 +554,7 @@ func (p *ParticipantImpl) HandleOffer(sdp webrtc.SessionDescription) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
p.params.Logger.Debugw("answering pub offer",
|
p.params.Logger.Infow("received pub offer", "state", p.State().String(), "sdp", sdp.SDP)
|
||||||
"state", p.State().String(),
|
|
||||||
// "sdp", sdp.SDP,
|
|
||||||
)
|
|
||||||
|
|
||||||
if err := p.publisher.SetRemoteDescription(sdp); err != nil {
|
if err := p.publisher.SetRemoteDescription(sdp); err != nil {
|
||||||
prometheus.ServiceOperationCounter.WithLabelValues("answer", "error", "remote_description").Add(1)
|
prometheus.ServiceOperationCounter.WithLabelValues("answer", "error", "remote_description").Add(1)
|
||||||
@@ -579,7 +576,9 @@ func (p *ParticipantImpl) createPublsiherAnswerAndSend() error {
|
|||||||
return errors.Wrap(err, "could not create answer")
|
return errors.Wrap(err, "could not create answer")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.params.Logger.Infow("sending pub answer (unfiltered)", "state", p.State().String(), "sdp", answer.SDP)
|
||||||
answer = p.publisher.FilterCandidates(answer)
|
answer = p.publisher.FilterCandidates(answer)
|
||||||
|
p.params.Logger.Infow("sending pub answer (filtered)", "state", p.State().String(), "sdp", answer.SDP)
|
||||||
|
|
||||||
if err = p.publisher.pc.SetLocalDescription(answer); err != nil {
|
if err = p.publisher.pc.SetLocalDescription(answer); err != nil {
|
||||||
prometheus.ServiceOperationCounter.WithLabelValues("answer", "error", "local_description").Add(1)
|
prometheus.ServiceOperationCounter.WithLabelValues("answer", "error", "local_description").Add(1)
|
||||||
@@ -687,7 +686,7 @@ func (p *ParticipantImpl) HandleAnswer(sdp webrtc.SessionDescription) error {
|
|||||||
if sdp.Type != webrtc.SDPTypeAnswer {
|
if sdp.Type != webrtc.SDPTypeAnswer {
|
||||||
return ErrUnexpectedOffer
|
return ErrUnexpectedOffer
|
||||||
}
|
}
|
||||||
p.params.Logger.Debugw("setting subPC answer", "answer", sdp)
|
p.params.Logger.Infow("setting subPC answer", "answer", sdp)
|
||||||
|
|
||||||
if err := p.subscriber.SetRemoteDescription(sdp); err != nil {
|
if err := p.subscriber.SetRemoteDescription(sdp); err != nil {
|
||||||
return errors.Wrap(err, "could not set remote description")
|
return errors.Wrap(err, "could not set remote description")
|
||||||
@@ -703,10 +702,12 @@ func (p *ParticipantImpl) AddICECandidate(candidate webrtc.ICECandidateInit, tar
|
|||||||
if target == livekit.SignalTarget_SUBSCRIBER {
|
if target == livekit.SignalTarget_SUBSCRIBER {
|
||||||
if p.iceConfig.PreferSubTcp && !strings.Contains(candidate.Candidate, "tcp") {
|
if p.iceConfig.PreferSubTcp && !strings.Contains(candidate.Candidate, "tcp") {
|
||||||
filterOut = true
|
filterOut = true
|
||||||
|
p.subscriber.Logger().Infow("filtering out candidate", "candidate", candidate.Candidate)
|
||||||
}
|
}
|
||||||
} else if target == livekit.SignalTarget_PUBLISHER {
|
} else if target == livekit.SignalTarget_PUBLISHER {
|
||||||
if p.iceConfig.PreferPubTcp && !strings.Contains(candidate.Candidate, "tcp") {
|
if p.iceConfig.PreferPubTcp && !strings.Contains(candidate.Candidate, "tcp") {
|
||||||
filterOut = true
|
filterOut = true
|
||||||
|
p.publisher.Logger().Infow("filtering out candidate", "candidate", candidate.Candidate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.lock.RUnlock()
|
p.lock.RUnlock()
|
||||||
@@ -1224,7 +1225,7 @@ func (p *ParticipantImpl) onOffer(offer webrtc.SessionDescription) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.params.Logger.Debugw("sending server offer to participant", "offer", offer)
|
p.params.Logger.Infow("sending server offer to participant", "offer", offer)
|
||||||
|
|
||||||
err := p.writeMessage(&livekit.SignalResponse{
|
err := p.writeMessage(&livekit.SignalResponse{
|
||||||
Message: &livekit.SignalResponse_Offer{
|
Message: &livekit.SignalResponse_Offer{
|
||||||
|
|||||||
@@ -187,10 +187,12 @@ func (p *ParticipantImpl) sendIceCandidate(c *webrtc.ICECandidate, target liveki
|
|||||||
if target == livekit.SignalTarget_SUBSCRIBER {
|
if target == livekit.SignalTarget_SUBSCRIBER {
|
||||||
if p.iceConfig.PreferSubTcp && c.Protocol != webrtc.ICEProtocolTCP {
|
if p.iceConfig.PreferSubTcp && c.Protocol != webrtc.ICEProtocolTCP {
|
||||||
filterOut = true
|
filterOut = true
|
||||||
|
p.subscriber.Logger().Infow("filtering out candidate", "candidate", c)
|
||||||
}
|
}
|
||||||
} else if target == livekit.SignalTarget_PUBLISHER {
|
} else if target == livekit.SignalTarget_PUBLISHER {
|
||||||
if p.iceConfig.PreferPubTcp && c.Protocol != webrtc.ICEProtocolTCP {
|
if p.iceConfig.PreferPubTcp && c.Protocol != webrtc.ICEProtocolTCP {
|
||||||
filterOut = true
|
filterOut = true
|
||||||
|
p.publisher.Logger().Infow("filtering out candidate", "candidate", c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.lock.RUnlock()
|
p.lock.RUnlock()
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ func (t *PCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
t.params.Logger.Debugw("add candidate ", "candidate", candidate.Candidate)
|
t.params.Logger.Infow("add candidate ", "candidate", candidate.Candidate)
|
||||||
|
|
||||||
return t.pc.AddICECandidate(candidate)
|
return t.pc.AddICECandidate(candidate)
|
||||||
}
|
}
|
||||||
@@ -563,7 +563,9 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.params.Logger.Infow("local offer (unfiltered)", "sdp", offer.SDP)
|
||||||
offer = t.filterCandidates(offer)
|
offer = t.filterCandidates(offer)
|
||||||
|
t.params.Logger.Infow("local offer (filtered)", "sdp", offer.SDP)
|
||||||
|
|
||||||
err = t.pc.SetLocalDescription(offer)
|
err = t.pc.SetLocalDescription(offer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user