-
Notifications
You must be signed in to change notification settings - Fork 756
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
onSuccess never called, JsSIP stalled #257
Conversation
Thanks, let's us know inspect it. |
Hi, Tested in FF nightly (35.0a) it's got the expected behaviour. This is a log of an offer creation: ` setLocalDescription..." jssip-devel.js:142 onSetLocalDescriptionSuccess..." jssip-devel.js:142 ICE candidate received: candidate:0 1 UDP 2130379007 192.168.100.101 54499 typ host" jssip-devel.js:142 onIceCompleted..." jssip-devel.js:142 As seen in the previous log, the ICE gathering is triggered by So, even if the iceGatheringState is said to be I'll have to check the sequence of the events on FF33 though. |
As a side note; the previously commented behaviour (in FF35) corresponds with the latests WebRTC editors draft. |
More notes... Tested in FF33, the flow is the following: `` setLocalDescription..." jssip-devel.js:142 peerConnection.onicecandidate..." jssip-devel.js:142 onSetLocalDescriptionSuccess..." jssip-devel.js:142 The difference between 33 and 35 versions is that in 33 ICE candidates seem to be in memory and thus, the Gathering is instantaneous, making the Chrome does behave the same way FF35 does, with the difference that Chrome sets the |
Hi all, may we clarify the current status of this issue? AFAIU:
Am I right? |
I don't see that calling In the case of FF33, the candidates are already cached, so no gathering is really done. JsSIP expects the |
OK, does the path included in this PR fixes that? I don't like it too much (I do want to rely on the What about firing
|
I find it perfect @ibc |
Will commit right now. |
I already did it. We can close this issue. Thanks a lot! |
Great! |
I have to say that this solution seems a little odd to me. The timeout feels more like a hack than a solution. I suppose you still check if the If you now rely on the timeout fix you should probably remove the if clause since it can and will never happen (correct me if I'm wrong). Relying on |
It is true. I can't remember which was the reason to put the iceConnectionState conditions there but they are not needed anymore. The iceGatheringState suffices to know whether we are ready to send the offer/answer or not |
Also, after trying FF stable again I can see that it sometimes don't fire onicecandidate at all. |
OT, in my opinion the real cause of this problem is the odd decision in the Chrome implementation to use Much better would be to have to use an Unfortunately, it seems the null-candidate approach has found it's way into the upcoming standard. What a shame to drop a good solution. |
JsSIP stopped working in FF33. We are using WebRTC without STUN servers and the problem was caused by the different way ICE candidates are trickling in FF and Chrome.
In Chrome this happens:
In JsSIP you rely on the onIceCompleted method of the RTCMediaHandler to be called after step 4 when the onicecandidate event happens. This works fine in Chrome.
In Firefox this happens:
The problem here is that JsSIP onicecandidate is fired before onIceCompleted has been defined (because the local description has not been set). Also the preventive check if all candidates have already been created and the iceGatheringState is complete fails because iceConnectionState is supposed to be connected.
In the code onSuccess is never called and JsSIP stalls. By removing the requirement that iceConnectionState is connected (not sure why this requirement is there, during this phase you can't expect connection to be ready, no remote SDP has been set, as far as I can see), it worked. At this stage the iceConnectionState is new which seems to be reasonable.
Also this is for the SDP offer process, I would expect similar problems for the SDP answer process (when the iceConnectionState is checking if I don't remember wrong).
Suggested solution in the pull request, solved the issue for us.