Beispiel #1
0
LinphoneCoreManager* linphone_core_manager_new2(const char* rc_file, int check_for_proxies) {
	LinphoneCoreManager* mgr= ms_new0(LinphoneCoreManager,1);
	LinphoneProxyConfig* proxy;
	char *rc_path = NULL;
	int proxy_count;

	mgr->v_table.registration_state_changed=registration_state_changed;
	mgr->v_table.auth_info_requested=auth_info_requested;
	mgr->v_table.call_state_changed=call_state_changed;
	mgr->v_table.text_received=text_message_received;
	mgr->v_table.message_received=message_received;
	mgr->v_table.file_transfer_recv=file_transfer_received;
	mgr->v_table.file_transfer_send=file_transfer_send;
	mgr->v_table.file_transfer_progress_indication=file_transfer_progress_indication;
	mgr->v_table.is_composing_received=is_composing_received;
	mgr->v_table.new_subscription_requested=new_subscription_requested;
	mgr->v_table.notify_presence_received=notify_presence_received;
	mgr->v_table.transfer_state_changed=linphone_transfer_state_changed;
	mgr->v_table.info_received=info_message_received;
	mgr->v_table.subscription_state_changed=linphone_subscription_state_change;
	mgr->v_table.notify_received=linphone_notify_received;
	mgr->v_table.publish_state_changed=linphone_publish_state_changed;
	mgr->v_table.configuring_status=linphone_configuration_status;
	mgr->v_table.call_encryption_changed=linphone_call_encryption_changed;
	mgr->v_table.network_reachable=network_reachable;

	reset_counters(&mgr->stat);
	if (rc_file) rc_path = ms_strdup_printf("rcfiles/%s", rc_file);
	mgr->lc=configure_lc_from(&mgr->v_table, liblinphone_tester_file_prefix, rc_path, mgr);
	/*CU_ASSERT_EQUAL(ms_list_size(linphone_core_get_proxy_config_list(lc)),proxy_count);*/
	if (check_for_proxies && rc_file) /**/
		proxy_count=ms_list_size(linphone_core_get_proxy_config_list(mgr->lc));
	else
		proxy_count=0;

#if TARGET_OS_IPHONE
	linphone_core_set_playback_device( mgr->lc, "AU: Audio Unit Tester");
	linphone_core_set_capture_device( mgr->lc, "AU: Audio Unit Tester");
	linphone_core_set_ringer_device( mgr->lc, "AQ: Audio Queue Device");
	linphone_core_set_ringback(mgr->lc, NULL);
#endif

	if (proxy_count)
		wait_for_until(mgr->lc,NULL,&mgr->stat.number_of_LinphoneRegistrationOk,proxy_count,5000*proxy_count);
	CU_ASSERT_EQUAL(mgr->stat.number_of_LinphoneRegistrationOk,proxy_count);
	enable_codec(mgr->lc,"PCMU",8000);

	linphone_core_get_default_proxy(mgr->lc,&proxy);
	if (proxy) {
		mgr->identity = linphone_address_new(linphone_proxy_config_get_identity(proxy));
		linphone_address_clean(mgr->identity);
	}
	if (rc_path) ms_free(rc_path);
	return mgr;
}
static void capture_device_changed(GtkWidget *capture_device){
	gchar *sel;
	GtkWidget *mic_audiolevel;
	GtkWidget *label_audiolevel;
	GtkWidget *assistant=gtk_widget_get_toplevel(capture_device);
	AudioStream *audio_stream;

	mic_audiolevel = get_widget_from_assistant("mic_audiolevel");
	label_audiolevel = get_widget_from_assistant("label_audiolevel");
	audio_stream = (AudioStream *) g_object_get_data(G_OBJECT(assistant),"stream");
	sel = gtk_combo_box_get_active_text(GTK_COMBO_BOX(capture_device));
	linphone_core_set_capture_device(linphone_gtk_get_core(),sel);
	linphone_gtk_uninit_audio_meter(mic_audiolevel);
	linphone_gtk_uninit_audio_label(label_audiolevel);
	audio_stream_stop(audio_stream);
	g_free(sel);
	/*now restart the audio stream*/
	prepare(GTK_ASSISTANT(assistant));
}