Revision 793d18b1 plugins/janus_voicemail.c

View differences:

plugins/janus_voicemail.c
475 475
		*error = -2;
476 476
		return;
477 477
	}
478
	if(session->destroyed) {
479
		JANUS_LOG(LOG_WARN, "VoiceMail session already destroyed...\n");
480
		return;
481
	}
482
	JANUS_LOG(LOG_VERB, "Removing VoiceMail session...\n");
483 478
	janus_mutex_lock(&sessions_mutex);
484
	g_hash_table_remove(sessions, handle);
485
	janus_mutex_unlock(&sessions_mutex);
486
	janus_voicemail_hangup_media(handle);
487
	/* Cleaning up and removing the session is done in a lazy way */
488
	session->destroyed = janus_get_monotonic_time();
489
	janus_mutex_lock(&sessions_mutex);
490
	old_sessions = g_list_append(old_sessions, session);
479
	if(!session->destroyed) {
480
		session->destroyed = janus_get_monotonic_time();
481
		JANUS_LOG(LOG_VERB, "Removing VoiceMail session...\n");
482
		g_hash_table_remove(sessions, handle);
483
		janus_voicemail_hangup_media(handle);
484
		/* Cleaning up and removing the session is done in a lazy way */
485
		old_sessions = g_list_append(old_sessions, session);
486
	}
491 487
	janus_mutex_unlock(&sessions_mutex);
492 488

  
493 489
	return;

Also available in: Unified diff