Index: linphone/coreapi/linphonecore.c
===================================================================
--- linphone/coreapi/linphonecore.c	(revision 364)
+++ linphone/coreapi/linphonecore.c	(revision 371)
@@ -1028,4 +1028,7 @@
 		}
 	}
+
+	ms_list_for_each(lc->sip_conf.proxies,(void (*)(void*))&linphone_proxy_config_update);
+
 	if (lc->call!=NULL){
 		LinphoneCall *call=lc->call;
@@ -2299,4 +2302,29 @@
 }
 
+void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose){
+	if (lc->vtable.waiting){
+		lc->wait_ctx=lc->vtable.waiting(lc,NULL,LinphoneWaitingStart,purpose,0);
+	}
+}
+
+void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progress){
+	if (lc->vtable.waiting){
+		lc->wait_ctx=lc->vtable.waiting(lc,lc->wait_ctx,LinphoneWaitingProgress,purpose,progress);
+	}else{
+#ifdef WIN32
+		Sleep(50000);
+#else
+		usleep(50000);
+#endif
+	}
+}
+
+void linphone_core_stop_waiting(LinphoneCore *lc){
+	if (lc->vtable.waiting){
+		lc->wait_ctx=lc->vtable.waiting(lc,lc->wait_ctx,LinphoneWaitingFinished,NULL,0);
+	}
+}
+
+
 void net_config_uninit(LinphoneCore *lc)
 {
Index: linphone/coreapi/linphonecore.h
===================================================================
--- linphone/coreapi/linphonecore.h	(revision 354)
+++ linphone/coreapi/linphonecore.h	(revision 371)
@@ -296,5 +296,5 @@
 	struct _SipSetupContext *ssctx;
 	int auth_failures;
-	bool_t frozen;
+	bool_t commit;
 	bool_t reg_sendregister;
 	bool_t registered;
@@ -419,4 +419,10 @@
 typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate);
 typedef void (*DtmfReceived)(struct _LinphoneCore* lc, int dtmf);
+typedef enum _LinphoneWaitingState{
+	LinphoneWaitingStart,
+	LinphoneWaitingProgress,
+	LinphoneWaitingFinished
+} LinphoneWaitingState;
+typedef void * (*Waiting)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress);
 
 typedef struct _LinphoneVTable
@@ -441,4 +447,5 @@
 	GeneralStateChange general_state;
 	DtmfReceived dtmf_received;
+	Waiting waiting;
 } LinphoneCoreVTable;
 
@@ -505,4 +512,5 @@
 	gstate_t gstate_reg;
 	gstate_t gstate_call;
+	void *wait_ctx;
 	bool_t use_files;
 	bool_t apply_nat_settings;
@@ -768,4 +776,8 @@
 const char * linphone_core_get_route(LinphoneCore *lc);
 bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **real_url, osip_to_t **real_parsed_url, char **route);
+void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose);
+void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progresses);
+void linphone_core_stop_waiting(LinphoneCore *lc);
+
 
 #ifdef __cplusplus
Index: linphone/coreapi/private.h
===================================================================
--- linphone/coreapi/private.h	(revision 346)
+++ linphone/coreapi/private.h	(revision 371)
@@ -128,4 +128,5 @@
 
 void linphone_core_write_friends_config(LinphoneCore* lc);
+void linphone_proxy_config_update(LinphoneProxyConfig *cfg);
 
 #endif /* _PRIVATE_H */
Index: linphone/coreapi/proxy.c
===================================================================
--- linphone/coreapi/proxy.c	(revision 355)
+++ linphone/coreapi/proxy.c	(revision 371)
@@ -219,5 +219,4 @@
 
 void linphone_proxy_config_edit(LinphoneProxyConfig *obj){
-	obj->frozen=TRUE;
 	obj->auth_failures=0;
 	if (obj->reg_sendregister){
@@ -256,5 +255,5 @@
 {
 	if (!linphone_proxy_config_check(obj->lc,obj)) return -1;
-	obj->frozen=FALSE;
+	obj->commit=TRUE;
 	linphone_proxy_config_register(obj);
 	linphone_proxy_config_write_all_to_config_file(obj->lc);
@@ -589,13 +588,14 @@
 }
 
-
-void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type){
-	SipSetup *ss=sip_setup_lookup(type);
+static void linphone_proxy_config_activate_sip_setup(LinphoneProxyConfig *cfg){
 	SipSetupContext *ssc;
-	if (cfg->type)
-		ms_free(cfg->type);
-	cfg->type=ms_strdup(type);
+	SipSetup *ss=sip_setup_lookup(cfg->type);
 	if (!ss) return ;
 	ssc=sip_setup_context_new(ss,cfg);
+
+	if (cfg->reg_identity==NULL){
+		ms_error("Invalid identity for this proxy configuration.");
+		return;
+	}
 	if (sip_setup_context_login_account(ssc,cfg->reg_identity,NULL)==0){
 		if (sip_setup_context_get_capabilities(ssc) & SIP_SETUP_CAP_PROXY_PROVIDER){
@@ -609,4 +609,23 @@
 }
 
+void linphone_proxy_config_update(LinphoneProxyConfig *cfg){
+	if (cfg->commit){
+		if (cfg->type && cfg->ssctx==NULL){
+			linphone_proxy_config_activate_sip_setup(cfg);
+		}
+		cfg->commit=FALSE;
+	}
+}
+
+void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type){
+	if (cfg->type)
+		ms_free(cfg->type);
+	cfg->type=ms_strdup(type);
+	if (linphone_proxy_config_get_addr(cfg)==NULL){
+		/*put a placeholder so that the sip setup gets saved into the config */
+		linphone_proxy_config_set_server_addr(cfg,"sip:undefined");
+	}
+}
+
 SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg){
 	return cfg->ssctx;
Index: linphone/coreapi/sipsetup.c
===================================================================
--- linphone/coreapi/sipsetup.c	(revision 344)
+++ linphone/coreapi/sipsetup.c	(revision 371)
@@ -99,7 +99,7 @@
 }
 
-int sip_setup_new_account(SipSetup *funcs, const char *uri, const char *passwd){
-	if (funcs->create_account)
-		return funcs->create_account(uri, passwd);
+int sip_setup_context_create_account(SipSetupContext * ctx, const char *uri, const char *passwd){
+	if (ctx->funcs->create_account)
+		return ctx->funcs->create_account(ctx,uri, passwd);
 	else return -1;
 }
Index: linphone/coreapi/sipsetup.h
===================================================================
--- linphone/coreapi/sipsetup.h	(revision 318)
+++ linphone/coreapi/sipsetup.h	(revision 371)
@@ -76,5 +76,5 @@
 	bool_t (*init)(void);
 	void (*init_instance)(SipSetupContext *ctx);
-	int (*create_account)( const char *uri, const char *passwd);
+	int (*create_account)(SipSetupContext *ctx, const char *uri, const char *passwd);
 	int (*login_account)(SipSetupContext *ctx, const char *uri, const char *passwd);
 	int (*get_proxy)(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz);
@@ -101,6 +101,6 @@
 void sip_setup_unregister_all(void);
 
-int sip_setup_new_account(SipSetup *s, const char *uri, const char *passwd);
 SipSetupContext * sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig *cfg);
+int sip_setup_context_create_account(SipSetupContext *ctx, const char *uri, const char *passwd);
 int sip_setup_context_get_capabilities(SipSetupContext *ctx);
 int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd);
Index: linphone/gtk-glade/Makefile.am
===================================================================
--- linphone/gtk-glade/Makefile.am	(revision 293)
+++ linphone/gtk-glade/Makefile.am	(revision 371)
@@ -9,5 +9,6 @@
 		call_logs.glade \
 		log.glade \
-		buddylookup.glade
+		buddylookup.glade \
+		waiting.glade
 
 PIXMAPS=	linphone2.png \
@@ -33,4 +34,5 @@
 			update.c \
 			buddylookup.c \
+			utils.c \
 			linphone.h
 
Index: linphone/gtk-glade/linphone.h
===================================================================
--- linphone/gtk-glade/linphone.h	(revision 340)
+++ linphone/gtk-glade/linphone.h	(revision 371)
@@ -69,2 +69,3 @@
 SipSetupContext* linphone_gtk_get_default_sip_setup_context(void);
 void linphone_gtk_show_buddy_lookup_window(SipSetupContext *ctx);
+void * linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress);
Index: linphone/gtk-glade/main.c
===================================================================
--- linphone/gtk-glade/main.c	(revision 341)
+++ linphone/gtk-glade/main.c	(revision 371)
@@ -75,5 +75,6 @@
 	.call_log_updated=linphone_gtk_call_log_updated,
 	.text_received=linphone_gtk_text_received,
-	.general_state=linphone_gtk_general_state
+	.general_state=linphone_gtk_general_state,
+	.waiting=linphone_gtk_wait
 };
 
Index: linphone/gtk-glade/utils.c
===================================================================
--- linphone/gtk-glade/utils.c	(revision 371)
+++ linphone/gtk-glade/utils.c	(revision 371)
@@ -0,0 +1,70 @@
+/*
+linphone, gtk-glade interface.
+Copyright (C) 2008  Simon MORLAT (simon.morlat@linphone.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#include "linphone.h"
+
+static void run_gtk(){
+	while (gtk_events_pending ())
+		gtk_main_iteration ();
+
+}
+
+void *linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress){
+	GtkWidget *w;
+	switch(ws){
+		case LinphoneWaitingStart:
+			w=linphone_gtk_create_window("waiting");
+			gtk_window_set_transient_for(GTK_WINDOW(w),GTK_WINDOW(linphone_gtk_get_main_window()));
+			gtk_window_set_position(GTK_WINDOW(w),GTK_WIN_POS_CENTER_ON_PARENT);
+			if (purpose) {
+				gtk_progress_bar_set_text(
+					GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
+					purpose);
+			}
+			gtk_widget_show(w);
+			/*g_message("Creating waiting window");*/
+			run_gtk();
+			return w;
+		break;
+		case LinphoneWaitingProgress:
+			w=(GtkWidget*)ctx;
+			if (progress>=0){
+				gtk_progress_bar_set_fraction(
+					GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
+					progress);
+				
+				
+			}else {
+				gtk_progress_bar_pulse(
+					GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"))
+				);
+			}
+			/*g_message("Updating progress");*/
+			run_gtk();
+			g_usleep(50000);
+			return w;
+		break;
+		case LinphoneWaitingFinished:
+			w=(GtkWidget*)ctx;
+			gtk_widget_destroy(w);
+			return NULL;
+		break;
+	}
+	return NULL;
+}
Index: linphone/gtk-glade/waiting.glade
===================================================================
--- linphone/gtk-glade/waiting.glade	(revision 371)
+++ linphone/gtk-glade/waiting.glade	(revision 371)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.5 on Fri Mar 27 23:13:04 2009 -->
+<glade-interface>
+  <widget class="GtkWindow" id="waiting">
+    <property name="type">GTK_WINDOW_POPUP</property>
+    <property name="title" translatable="yes">Linphone</property>
+    <property name="resizable">False</property>
+    <property name="icon">linphone2.png</property>
+    <child>
+      <widget class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="label_xalign">0</property>
+        <child>
+          <widget class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="left_padding">12</property>
+            <child>
+              <widget class="GtkProgressBar" id="progressbar">
+                <property name="visible">True</property>
+              </widget>
+            </child>
+          </widget>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Please wait</property>
+            <property name="use_markup">True</property>
+            <property name="justify">GTK_JUSTIFY_CENTER</property>
+          </widget>
+          <packing>
+            <property name="type">label_item</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>
Index: linphone/mediastreamer2/configure.ac
===================================================================
--- linphone/mediastreamer2/configure.ac	(revision 353)
+++ linphone/mediastreamer2/configure.ac	(revision 371)
@@ -45,5 +45,11 @@
 [  --enable-strict       Enable error on compilation warning [default=no]],
 [wall_werror=$enableval],
-[wall_werror=yes]
+[
+	if test "$USER" = "smorlat" ; then
+		wall_werror=yes
+	else
+		wall_werror=no
+	fi
+]
 )
 
Index: linphone/mediastreamer2/tests/Makefile.am
===================================================================
--- linphone/mediastreamer2/tests/Makefile.am	(revision 348)
+++ linphone/mediastreamer2/tests/Makefile.am	(revision 371)
@@ -9,5 +9,5 @@
 videodisplay_SOURCES=videodisplay.c
 mtudiscover_SOURCES=mtudiscover.c
-becnh_SOURCES=bench.c
+bench_SOURCES=bench.c
 
 libexec_PROGRAMS=mediastream
