Revision 793d18b1 plugins/janus_sip.c

View differences:

plugins/janus_sip.c
654 654
		*error = -2;
655 655
		return;
656 656
	}
657
	if(session->destroyed) {
658
		JANUS_LOG(LOG_VERB, "SIP session already destroyed...\n");
659
		return;
660
	}
661 657
	janus_mutex_lock(&sessions_mutex);
662
	g_hash_table_remove(sessions, handle);
663
	janus_mutex_unlock(&sessions_mutex);
664
	janus_sip_hangup_media(handle);
665
	JANUS_LOG(LOG_VERB, "Destroying SIP session (%s)...\n", session->account.username ? session->account.username : "unregistered user");
666
	/* Shutdown the NUA */
667
	nua_shutdown(session->stack->s_nua);
668
	/* Cleaning up and removing the session is done in a lazy way */
669
	session->destroyed = janus_get_monotonic_time();
670
	janus_mutex_lock(&sessions_mutex);
671
	old_sessions = g_list_append(old_sessions, session);
658
	if(!session->destroyed) {
659
		session->destroyed = janus_get_monotonic_time();
660
		g_hash_table_remove(sessions, handle);
661
		janus_sip_hangup_media(handle);
662
		JANUS_LOG(LOG_VERB, "Destroying SIP session (%s)...\n", session->account.username ? session->account.username : "unregistered user");
663
		/* Shutdown the NUA */
664
		nua_shutdown(session->stack->s_nua);
665
		/* Cleaning up and removing the session is done in a lazy way */
666
		old_sessions = g_list_append(old_sessions, session);
667
	}
672 668
	janus_mutex_unlock(&sessions_mutex);
673 669
	return;
674 670
}

Also available in: Unified diff