You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
processOffer() returns an SDP answer without any candidates
Are there any other steps, for example, does it not work properly if the event listeners are not configured? If there are any mandatory steps, can you please add that to the documentation?
create pipeline
create endpoint
add listeners (IceCandidateFound, IceGatheringDone)
generateCandidates()
processOffer
look at the SDP answer, does it only contain 0.0.0.0 or does it contain real candidates?
Expected & current behavior
If I call generateCandidates first then I would expect to see some candidates in the SDP answer
(Optional) Possible solution
Info about your environment
Development environment, adapting another free software product, the reSIProcate C++ SIP stack, to support Kurento
About Kurento Media Server
Kurento version: 6.16.0
Server OS: tried both Ubuntu bionic and the Docker image
Hello @dpocock! 👋 we're sorry you found a bug... so first of all, thank you very much for reporting it.
To know about progress, check in Triage. All issues are considered Backlog Candidates until work priorities align and the issue is selected for development. It will then become part of our official Backlog.
Check if it works if you call processOffer()after receiving the IceGatheringDone event. This event is what tells you that all ICE candidates have been gathered. Otherwise, you might be calling processOffer() when not even a single candidate has been found...
think of it this way: if candidate gathering took 20 seconds... is your code really waiting all those 20 seconds before calling processOffer()?
reading the API docs, I had the impression that gatherCandidates() would return synchronously, after IceGatheringDone
If that is not the case then I'll modify the code to wait for the event and it would be useful to emphasize this in the docs.
Looking at the Kurento logs I notice that it says the candidates are added but it doesn't show IceGatheringDone in the log.
When I run the hello-world Java demo then I do see the IceGatheringDone message in the server log. It looks like there is some subtle difference in how the demo sets up the pipeline.
@j1elo thanks, the documentation is helpful but the issue still appears to be a bug or maybe a regression.
Can you please reopen the issue until we get to the bottom of this?
Do you have any unit test that validates this behavior? If not, do you remember the last time it was tested?
Here is what I observe, I have GST_DEBUG="7" for full logging.
a) using kurento-tutorial-java/kurento-hello-world: I capture the Kurento logs and everything looks good in there. The tutorial uses trickle ICE, in particular:
processOffer(sdp)
gatherCandidates()
Running the tutorial, when I look at the Kurento log, I can see that it finds the local candidates and sends IceGatheringDone in less than 1 second.
b) then I run my own code. Instead of using the events, I just created a 10 second sleep to test everything and I watch the log.
With this solution, I see the IceGatheringDone event in the Kurento log and the sdpAnswer2 includes all the local candidates. I send the sdpAnswer2 to the caller and the session is established.
Can you please reopen the issue until we get to the bottom of this?
You're right, I got confused because of the old comment in the documentation. Turns out that comment is wrong: it's not possible to call gatherCandidates before having processed an initial SDP. This is because all the internal structures, to handle connections and sessions, are created upon the first appearance of an SDP in the Endpoints.
Web browsers have decoupled the act of setting an SDP Offer from the phase of explicitly setting a local or remote description. In Kurento, these two are merged into a single operation, which serves better the needs for 99% cases, but makes it more weird for the 1%.
I believe the correct way to do it would be as you propose, with a slight change. Here's a more complete pseudocode, being more explicit about the signaling component, so it is clearer when each part would run:
Activity
github-actions commentedon Jun 13, 2021
Hello @dpocock! 👋 we're sorry you found a bug... so first of all, thank you very much for reporting it.
To know about progress, check in Triage. All issues are considered Backlog Candidates until work priorities align and the issue is selected for development. It will then become part of our official Backlog.
j1elo commentedon Jun 14, 2021
Check if it works if you call
processOffer()after receiving theIceGatheringDoneevent. This event is what tells you that all ICE candidates have been gathered. Otherwise, you might be callingprocessOffer()when not even a single candidate has been found...think of it this way: if candidate gathering took 20 seconds... is your code really waiting all those 20 seconds before calling
processOffer()?dpocock commentedon Jun 14, 2021
reading the API docs, I had the impression that gatherCandidates() would return synchronously, after IceGatheringDone
If that is not the case then I'll modify the code to wait for the event and it would be useful to emphasize this in the docs.
Looking at the Kurento logs I notice that it says the candidates are added but it doesn't show IceGatheringDone in the log.
When I run the hello-world Java demo then I do see the IceGatheringDone message in the server log. It looks like there is some subtle difference in how the demo sets up the pipeline.
j1elo commentedon Jun 14, 2021
thanks for the suggestions; I've mostly rewritten the docs of the gatherCandidates method, to make it clearer and more useful for users
dpocock commentedon Jun 15, 2021
@j1elo thanks, the documentation is helpful but the issue still appears to be a bug or maybe a regression.
Can you please reopen the issue until we get to the bottom of this?
Do you have any unit test that validates this behavior? If not, do you remember the last time it was tested?
Here is what I observe, I have GST_DEBUG="7" for full logging.
a) using
kurento-tutorial-java/kurento-hello-world: I capture the Kurento logs and everything looks good in there. The tutorial uses trickle ICE, in particular:Running the tutorial, when I look at the Kurento log, I can see that it finds the local candidates and sends
IceGatheringDonein less than 1 second.b) then I run my own code. Instead of using the events, I just created a 10 second sleep to test everything and I watch the log.
I grep the log and I can not find any events
AddIceCandidateorIceGatheringDoneNotice that I see lots of lines for
[AddIceCandidate] remote. I don't see the local candidates in that log.When I did the test with hello-world, the
[AddIceCandidate] localentries appear in the log file.c) I came up with a workaround, I do the following:
With this solution, I see the
IceGatheringDoneevent in the Kurento log and thesdpAnswer2includes all the local candidates. I send thesdpAnswer2to the caller and the session is established.Can you please reopen the issue until we get to the bottom of this?
j1elo commentedon Jun 15, 2021
You're right, I got confused because of the old comment in the documentation. Turns out that comment is wrong: it's not possible to call gatherCandidates before having processed an initial SDP. This is because all the internal structures, to handle connections and sessions, are created upon the first appearance of an SDP in the Endpoints.
Web browsers have decoupled the act of setting an SDP Offer from the phase of explicitly setting a local or remote description. In Kurento, these two are merged into a single operation, which serves better the needs for 99% cases, but makes it more weird for the 1%.
I believe the correct way to do it would be as you propose, with a slight change. Here's a more complete pseudocode, being more explicit about the signaling component, so it is clearer when each part would run: