Esempio n. 1
0
static void upload_collected_traces()  {
	LinphoneCoreManager* marie = setup(TRUE);
	if (transport_supported(marie->lc, LinphoneTransportTls)) {
		int waiting = 100;
		LinphoneCoreVTable *v_table = linphone_core_v_table_new();
		v_table->log_collection_upload_state_changed = logCollectionUploadStateChangedCb;
		linphone_core_add_listener(marie->lc, v_table);

		linphone_core_set_log_collection_max_file_size(5000);
		linphone_core_set_log_collection_upload_server_url(marie->lc,"https://www.linphone.org:444/lft.php");
		// Generate some logs
		while (--waiting) ms_error("(test error)Waiting %d...", waiting);
		linphone_core_compress_log_collection(marie->lc);
		linphone_core_upload_log_collection(marie->lc);
		BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,1));

		/*try 2 times*/
		waiting=100;
		linphone_core_reset_log_collection(marie->lc);
		while (--waiting) ms_error("(test error)Waiting %d...", waiting);
		linphone_core_compress_log_collection(marie->lc);
		linphone_core_upload_log_collection(marie->lc);
		BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,2));
	}
	collect_cleanup(marie);
}
static void collect_cleanup(LinphoneCoreManager *marie)  {
	linphone_core_manager_destroy(marie);

	linphone_core_enable_log_collection(old_collection_state);
	linphone_core_reset_log_collection();
}
static int collect_cleanup()  {
	linphone_core_enable_log_collection(old_collection_state);
	linphone_core_reset_log_collection();
	return 0;
}