From d3b91140985da64d3550bec13989e611cd7e9a46 Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Fri, 20 Sep 2024 10:31:33 +0200 Subject: [PATCH] Better management of call cleanup in SIP plugin (fixes #3430) --- plugins/janus_sip.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/janus_sip.c b/plugins/janus_sip.c index 0966a73049..0d1447a082 100644 --- a/plugins/janus_sip.c +++ b/plugins/janus_sip.c @@ -5223,13 +5223,10 @@ void janus_sip_sofia_callback(nua_event_t event, int status, char const *phrase, session->hangup_reason_header_protocol = NULL; session->hangup_reason_header_cause = NULL; if(g_atomic_int_get(&session->establishing) || g_atomic_int_get(&session->established)) { - if(session->media.has_audio || session->media.has_video) { - /* Get rid of the PeerConnection in the core */ - gateway->close_pc(session->handle); - } else { - /* No SDP was exchanged, just clean up locally */ - janus_sip_hangup_media_internal(session->handle); - } + /* Get rid of the PeerConnection in the core */ + gateway->close_pc(session->handle); + /* Also clean up locally, in case there was no PC */ + janus_sip_hangup_media_internal(session->handle); } } else if(session->stack->s_nh_i == nh && callstate == nua_callstate_calling && session->status == janus_sip_call_status_incall) { /* Have just sent re-INVITE */