meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.25k stars 2.48k forks source link

Fix stuck sip sessions #3333

Closed Jonbeckas closed 8 months ago

Jonbeckas commented 8 months ago

Structural not compleatly clean, but it should fix issue #3332

januscla commented 8 months ago

Thanks for your contribution, @Jonbeckas! Please make sure you sign our CLA, as it's a required step before we can merge this.

lminiero commented 8 months ago

I haven't investigated the issue yet, but I don't think this is a proper fix. Resetting a PeerConnection state in the Janus core is not simply a matter of clearing a flag: there are steps that must be traversed. If you're not getting the PC closed, then maybe the plugin is not closing the PC, so it's the SIP plugin that should be updated, not the core.

Jonbeckas commented 8 months ago

I don't think it is possible to fix this only in the sip_plugin, because the hangup event is not fired, because the session still has the flag JANUS_ICE_HANDLE_WEBRTC_ALERT when no sdp was send yet. It's possible to fix it just in the sip_plugin if we set session->establishing to 0 on decline, but it would be a duplication with the later called hangup function.