JsSIP icon indicating copy to clipboard operation
JsSIP copied to clipboard

JsSIP does not appear to call localPeerConnection.close(), causing IE camera to hang.

Open nethertek opened this issue 11 years ago • 10 comments

Please investigate or point in the right direction without prematurely closing this issue.

References:

https://plugin.temasys.com.sg/demo/samples/web/content/peerconnection/munge-sdp/index.html https://groups.google.com/forum/#!topic/temasys-discuss-webrtcplugin/w1kkdJPo3Y0

nethertek avatar Jul 14 '15 08:07 nethertek

JsSIP does close the peerconnection. Sure. I will comment more on two days.

ibc avatar Jul 14 '15 08:07 ibc

Thank you. We initially tried to implement our PoC according to the latest docs and after not being able to resolve this issue, tried to derive from the TryIt demo, but the problem was also present there. We would not have reported the issue otherwise.

nethertek avatar Jul 14 '15 08:07 nethertek

Were you able to reproduce the problem?

nethertek avatar Jul 21 '15 10:07 nethertek

In Tryit, when the session ends JsSIP calls close() on the RTCSession instance, which internally does:

[Log] JsSIP:RTCSession close() +2ms
[Log] rtcninja:RTCPeerConnection close() +2ms
[Log] JsSIP:RTCSession close() | closing local MediaStream +3ms
[Log] rtcninja:Adapter closeMediaStream() | calling stop() on the MediaStream +4ms

So the peerconnection is clearly closed along with the MediaStream.

Said that, in order to the webcam light to turn off the local MediaStream must be closed, which is what JsSIP does.

This must be a bug in the plugin, not in JsSIP, not even in the tryit demo.

ibc avatar Jul 21 '15 11:07 ibc

Indeed the light remains on after the local MediaStream and the PeerConnection is closed in the Tryit demo. I insist: this MUST be a bug in the plugin.

Said that, you may try the following:

  • Instead of letting JsSIP to internally generate its local MediaStream, call yourself to JsSIP.rtcninja.getUserMedia() and pass the retrieved MediaStream to ua.call(target, {mediaStream:HERE}).
  • Then when the call ends JsSIP will NOT close the local MediaStream since it has been externally passed (the app may want to have it open still).
  • Time later, call yourself to stop() on your local MediaStream and let's know what happens.

ibc avatar Jul 21 '15 11:07 ibc

I will try to implement the suggested approach and update this issue accordingly. However, I would like to highlight that running the Munge SDP demo from Temasys that I referenced above, the camera does properly turn off the light and close.

nethertek avatar Jul 21 '15 11:07 nethertek

In my own code using JsSIP and the plugin the issue does not happen. Not sure why (note: I follow the approach suggested in my previous mail).

So I want to be clear: there is nothing to fix in JsSIP regardless the camera is turned off in the Munge SDP demo.

ibc avatar Jul 21 '15 12:07 ibc

We've successfully tested with the method you've described. Perhaps the docs could be updated to reflect this approach?

This issue can be closed, thank you.

nethertek avatar Jul 21 '15 23:07 nethertek

We cannot update the JsSIP doc just because the Temasys plugin has a bug. The usage of JsSIP regarding the media stream is correct.

ibc avatar Sep 05 '15 11:09 ibc

More info about this issue in the Temasys plugin:

https://groups.google.com/d/msg/temasys-discuss-webrtcplugin/w1kkdJPo3Y0/KMOs3khfAAAJ

ibc avatar Feb 11 '16 12:02 ibc