versatica / JsSIP

JsSIP, the JavaScript SIP library
https://jssip.net
Other
2.41k stars 741 forks source link

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

Closed nethertek closed 9 years ago

nethertek commented 9 years ago

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

ibc commented 9 years ago

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

nethertek commented 9 years ago

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 commented 9 years ago

Were you able to reproduce the problem?

ibc commented 9 years ago

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 commented 9 years ago

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:

nethertek commented 9 years ago

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.

ibc commented 9 years ago

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.

nethertek commented 9 years ago

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.

ibc commented 9 years ago

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 commented 8 years ago

More info about this issue in the Temasys plugin:

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