Kurento / bugtracker

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento
46 stars 10 forks source link

IceGatheringDoneEvent gets triggered before ICE candidate gathering is finished #443

Open jbabob opened 4 years ago

jbabob commented 4 years ago

Prerequisites

Issue description

I created a WebRtcEndpoint with even listeners for IceCandidateFoundEvent and IceGatheringDoneEvent. IceCandidateFoundEvent was triggered multiple times after IceGatheringDoneEvent was triggered.

Context

I'd like to start a video streaming without the use of Trickle ICE. My program waits for IceGatheringDoneEvent to be triggered before responding with the SDP answer. IceGatheringDoneEvent is the first event to be triggered, and then IceCandidateFoundEvent gets triggered multiple times. NewCandidatePairSelectedEvent never gets triggered and video stream does not start.

How to reproduce?

Expected & current behavior

All ICE candidates should be found before IceGatheringDoneEvent is triggered.

(Optional) Possible solution

Environment info

INFO: Kurento Media Server

INFO: Application Server

INFO: End-user clients

Version details

kurento-media-server -v

lsb_release -a

dpkg -l | grep -Pi 'kurento|kms-|gst.*1.5|nice'
j1elo commented 4 years ago

IceGatheringDoneEvent is just a forwarded emission of libnice's candidate-gathering-done signal.

Video and audio tracks are their own independent components, so make sure you are not seeing e.g. IceGatheringDoneEvent from the video component, and then some IceCandidateFoundEvent from the audio component.

NewCandidatePairSelectedEvent never gets triggered

This, however, is a more serious problem, as it indicates that ICE wasn't able to find a connectivity path between Kurento and the remote peer. Review all ICE candidates found and see if any of them is able to reach a common network that connects Kurento with the other side. You should probably configure STUN and/or TURN servers in both Kurento and the other peer.