Index: configure
===================================================================
--- configure	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ configure	(.../trunk/linphone/linphone)	(revision 3519)
@@ -1020,7 +1020,7 @@
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
 includedir='${prefix}/include'
-oldincludedir='/usr/include'
+oldincludedir='${prefix}/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
 infodir='${datarootdir}/info'
 htmldir='${docdir}'
@@ -6265,19 +6265,20 @@
 echo "$as_me: error: perl 5.x required for intltool" >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test "x" != "xno-xml"; then
-   { echo "$as_me:$LINENO: checking for XML::Parser" >&5
-echo $ECHO_N "checking for XML::Parser... $ECHO_C" >&6; }
-   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
-       { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-   else
-       { { echo "$as_me:$LINENO: error: XML::Parser perl module is required for intltool" >&5
-echo "$as_me: error: XML::Parser perl module is required for intltool" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
-fi
 
+#if test "x" != "xno-xml"; then
+#   { echo "$as_me:$LINENO: checking for XML::Parser" >&5
+#echo $ECHO_N "checking for XML::Parser... $ECHO_C" >&6; }
+#   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+#       { echo "$as_me:$LINENO: result: ok" >&5
+#echo "${ECHO_T}ok" >&6; }
+#   else
+#       { { echo "$as_me:$LINENO: error: XML::Parser perl module is required for intltool" >&5
+#echo "$as_me: error: XML::Parser perl module is required for intltool" >&2;}
+#   { (exit 1); exit 1; }; }
+#   fi
+#fi
+
 # Substitute ALL_LINGUAS so we can use it in po/Makefile
 
 
@@ -22422,7 +22423,7 @@
   prefix="$acl_save_prefix"
 
       else
-        additional_includedir="$withval/include"
+#        additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
       fi
     fi
@@ -22602,11 +22603,11 @@
             case "$found_dir" in
               */$acl_libdirstem | */$acl_libdirstem/)
                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                additional_includedir="$basedir/include"
+#                additional_includedir="$basedir/include"
                 ;;
             esac
             if test "X$additional_includedir" != "X"; then
-                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+ if test "X$additional_includedir" != "X$oldincludedir"; then
                 haveit=
                 if test "X$additional_includedir" = "X/usr/local/include"; then
                   if test -n "$GCC"; then
@@ -23222,7 +23223,7 @@
   prefix="$acl_save_prefix"
 
       else
-        additional_includedir="$withval/include"
+#        additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
       fi
     fi
@@ -23402,11 +23403,11 @@
             case "$found_dir" in
               */$acl_libdirstem | */$acl_libdirstem/)
                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                additional_includedir="$basedir/include"
+#                additional_includedir="$basedir/include"
                 ;;
             esac
             if test "X$additional_includedir" != "X"; then
-                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+ if test "X$additional_includedir" != "X$oldincludedir"; then
                 haveit=
                 if test "X$additional_includedir" = "X/usr/local/include"; then
                   if test -n "$GCC"; then
@@ -24521,8 +24522,10 @@
 if test $osip_pkgconfig = false; then
 
 	if test -z "$osip_legacy_version"; then
+		"echo hack (legacy) to get to compile in windows!"
 		OSIP_CFLAGS="-I${osip_prefix}/include"
 	else
+		"echo hack to get to compile in windows!"
 		OSIP_CFLAGS="-I${osip_prefix}/include/osip2${osip_legacy_version}"
 	fi
 
@@ -24547,6 +24550,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+#include <winsock.h>
 #include <osip2/osip.h>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -24669,7 +24673,14 @@
 
 	CPPFLAGS=$CPPFLAGS_save
 
+if [ "x$host" == "xi586-pc-mingw32msvc" ]
+then
 	OSIP_LIBS="-L$osip_prefix/lib -losipparser2${osip_legacy_version}"
+
+else
+	OSIP_LIBS="-L$osip_prefix/lib -losipparser2${osip_legacy_version} -lpthread"
+fi
+
 	LDFLAGS_save=$LDFLAGS
 	LDFLAGS=$OSIP_LIBS
 	LIBS_save=$LIBS
@@ -24681,7 +24692,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-losip2${osip_legacy_version} -losipparser2${osip_legacy_version} -lpthread $LIBS"
+LIBS="-losip2${osip_legacy_version} -losipparser2${osip_legacy_version} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24758,7 +24769,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-losipparser2${osip_legacy_version} -lpthread $LIBS"
+LIBS="-losipparser2${osip_legacy_version} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24832,17 +24843,13 @@
 	LIBS=$LIBS_save
 fi
 
-
-
-
-
-
-
-
-
-
 EXOSIP_CFLAGS="$OSIP_CFLAGS -DOSIP_MT "
-EXOSIP_LIBS="$OSIP_LIBS -leXosip2  "
+if [ "x$host" == "xi586-pc-mingw32msvc" ]
+then
+    EXOSIP_LIBS="$OSIP_LIBS -leXosip2 -liphlpapi -lws2_32 "
+else
+    EXOSIP_LIBS="$OSIP_LIBS -leXosip2"
+fi
 
 CPPFLAGS_save=$CPPFLAGS
 CPPFLAGS=$OSIP_CFLAGS
@@ -24997,7 +25004,15 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-leXosip2 -losipparser2 -losip2 -lpthread $LIBS"
+
+
+if [ "x$host" == "xi586-pc-mingw32msvc" ]
+then
+    LIBS="-L/var/tmp/mingw/lib -L/var/tmp/mingw/lib -leXosip2 -losipparser2 -losip2 -liphlpapi -lws2_32 $LIBS "
+else
+    LIBS="-L/var/tmp/build/lib -leXosip2 -losipparser2 -losip2 $LIBS "
+fi
+
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25071,7 +25086,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-leXosip2 -losipparser2 -losip2 -lpthread $LIBS"
+LIBS="-leXosip2 -losipparser2 -losip2 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25461,7 +25476,9 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
+
 LIBS="-lreadline -lncurses $LIBS"
+
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25532,10 +25549,6 @@
 
 READLINE_LIBS="$READLINE_LIBS -lreadline -lncurses"
 
-
-
-
-
 else
 echo "Console interface compilation is disabled."
 fi
@@ -25820,8 +25833,8 @@
 	pkg_failed=untried
 fi
 
+pkg_failed=no
 
-
 if test $pkg_failed = yes; then
 
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
Index: Makefile.in
===================================================================
--- Makefile.in	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ Makefile.in	(.../trunk/linphone/linphone)	(revision 3519)
@@ -89,7 +89,6 @@
 AR = @AR@
 ARMBUILD_FALSE = @ARMBUILD_FALSE@
 ARMBUILD_TRUE = @ARMBUILD_TRUE@
-AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
@@ -317,11 +316,6 @@
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
 
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
 config.h: stamp-h1
 	@if test ! -f $@; then \
 	  rm -f stamp-h1; \
Index: oRTP/src/Makefile.in
===================================================================
--- oRTP/src/Makefile.in	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ oRTP/src/Makefile.in	(.../trunk/linphone/linphone)	(revision 3519)
@@ -61,7 +61,7 @@
 	rtpsession_inet.lo jitterctl.lo rtpsignaltable.lo rtptimer.lo \
 	posixtimer.lo ortp.lo scheduler.lo avprofile.lo sessionset.lo \
 	telephonyevents.lo payloadtype.lo rtcp.lo utils.lo \
-	rtcpparse.lo event.lo stun.lo stun_udp.lo srtp.lo
+	rtcpparse.lo event.lo stun.lo stun_udp.lo 
 libortp_la_OBJECTS = $(am_libortp_la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -245,12 +245,12 @@
 			utils.c utils.h \
 			rtcpparse.c \
 			event.c \
-			stun.c stun_udp.c \
-			srtp.c
+			stun.c stun_udp.c 
+			
 
 libortp_la_LIBADD = $(PTHREAD_LIBS) -lm $(SRTP_LIBS)
 libortp_la_LDFLAGS = -version-info $(LIBORTP_SO_VERSION)
-SUBDIRS = . tests
+SUBDIRS = . 
 all: all-recursive
 
 .SUFFIXES:
@@ -336,7 +336,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtptimer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scheduler.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sessionset.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srtp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_utils.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stun.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stun_udp.Plo@am__quote@
Index: mediastreamer2/configure
===================================================================
--- mediastreamer2/configure	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ mediastreamer2/configure	(.../trunk/linphone/linphone)	(revision 3519)
@@ -20430,10 +20430,10 @@
      macosx_found=yes
      ;;
   *)
-     MSPLUGINS_CFLAGS="-pthread"
-     MSPLUGINS_LIBS="-shared -pthread"
-     CFLAGS="$CFLAGS -pthread -D_REENTRANT"
-     LIBS="$LIBS -pthread -lpthread"
+     MSPLUGINS_CFLAGS=""
+     MSPLUGINS_LIBS="-shared"
+     CFLAGS="$CFLAGS -D_REENTRANT"
+     LIBS="$LIBS"
      ;;
 esac
 
@@ -21757,6 +21757,8 @@
 else
 	pkg_failed=untried
 fi
+
+
 if test -n "$PKG_CONFIG"; then
     if test -n "$SPEEX_LIBS"; then
         pkg_cv_SPEEX_LIBS="$SPEEX_LIBS"
@@ -21853,8 +21855,9 @@
 	pkg_failed=untried
 fi
 
+# Hack to make it compile under windows
+pkg_failed=no
 
-
 if test $pkg_failed = yes; then
 
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
Index: mediastreamer2/Makefile.in
===================================================================
--- mediastreamer2/Makefile.in	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ mediastreamer2/Makefile.in	(.../trunk/linphone/linphone)	(revision 3519)
@@ -260,7 +260,7 @@
 target_os = @target_os@
 target_vendor = @target_vendor@
 EXTRA_DIST = mediastreamer-config.h.in pkg.list autogen.sh mediastreamer.pc.in mediastreamer2.spec.in mediastreamer2.spec Makefile.macosx
-SUBDIRS = src build include tests plugins help
+SUBDIRS = src build include plugins help
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = mediastreamer.pc
 @WITH_EPM_TRUE@PKG_NAME = $(PACKAGE)-$(VERSION)-$(RELEASE)
Index: mediastreamer2/src/mscommon.c
===================================================================
--- mediastreamer2/src/mscommon.c	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ mediastreamer2/src/mscommon.c	(.../trunk/linphone/linphone)	(revision 3519)
@@ -385,7 +385,7 @@
 #endif
 
 #ifdef WIN32
-extern MSSndCardDesc winsnd_card_desc;
+/*#extern MSSndCardDesc winsnd_card_desc; */
 #endif
 
 #ifdef __DIRECTSOUND_ENABLED__
@@ -411,7 +411,7 @@
 	&arts_card_desc,
 #endif
 #ifdef WIN32
-	&winsnd_card_desc,
+/*	&winsnd_card_desc, */
 #endif
 #ifdef __DIRECTSOUND_ENABLED__
 	&winsndds_card_desc,
Index: mediastreamer2/include/mediastreamer2/msfileplayer.h
===================================================================
--- mediastreamer2/include/mediastreamer2/msfileplayer.h	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ mediastreamer2/include/mediastreamer2/msfileplayer.h	(.../trunk/linphone/linphone)	(revision 3519)
@@ -19,6 +19,12 @@
 #ifndef msfileplayer_h
 #define msfileplayer_h
 
+#ifdef WINVER
+#include <io.h>
+#endif
+
+#include <fcntl.h>
+
 #include "msfilter.h"
 
 
Index: coreapi/linphonecore.c
===================================================================
--- coreapi/linphonecore.c	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ coreapi/linphonecore.c	(.../trunk/linphone/linphone)	(revision 3519)
@@ -427,6 +427,9 @@
 	tmp=lp_config_get_int(lc->config,"sip","inc_timeout",15);
 	linphone_core_set_inc_timeout(lc,tmp);
 
+	tmp=lp_config_get_int(lc->config,"sip","rtp_timeout",30);
+	linphone_core_set_rtp_timeout(lc,tmp);
+
 	/* get proxies config */
 	for(i=0;; i++){
 		LinphoneProxyConfig *cfg=linphone_proxy_config_new_from_config_file(lc->config,i);
@@ -943,6 +946,56 @@
 	(vs!=NULL) ? (rtp_session_compute_send_bandwidth(vs)*1e-3) : 0);
 }
 
+int linphone_core_is_timeout (LinphoneCore *lc)
+{
+    /* signal timeout if it's been a while since last time a rtp/rtcp packet 
+     * was received. But only do so if we have already sent some rtp/rtcp 
+     * packets ourselves, i.e. rtp.snd_seq is larger than some arbitrary 
+     * number. */
+
+    time_t curtime=time(NULL);
+    struct timeval last_recv_time;
+    RtpSession *as=NULL,*vs=NULL;
+    int elapsed;
+    int as_timeout=0;
+    int vs_timeout=0;
+
+    if (lc->audiostream!=NULL)
+	    as=lc->audiostream->session;
+
+    if (lc->videostream!=NULL)
+		vs=lc->videostream->session;
+
+    if (as != NULL)
+    { 
+        rtp_session_get_last_recv_time (as, &last_recv_time); 
+        elapsed=curtime-last_recv_time.tv_sec;
+
+        if (as->rtp.snd_seq > 69 && elapsed > lc->sip_conf.rtp_timeout)
+        {
+            ms_message("no audio rtp/rtcp packet received for %i seconds.", 
+                       elapsed); 
+            as_timeout = 1;
+        }
+    }
+
+    if (vs != NULL)
+    { 
+        rtp_session_get_last_recv_time (vs, &last_recv_time); 
+        elapsed=curtime-last_recv_time.tv_sec;
+
+        if (vs->rtp.snd_seq > 69 && elapsed > lc->sip_conf.rtp_timeout)
+        {
+            ms_message("no audio rtp/rtcp packet received for %i seconds.", 
+                       elapsed); 
+
+            vs_timeout = 1;
+        }
+    }
+
+    return as_timeout | vs_timeout;
+}
+
 void linphone_core_iterate(LinphoneCore *lc)
 {
 	eXosip_event_t *ev;
@@ -963,6 +1016,7 @@
 		LinphoneCall *call=lc->call;
 		int elapsed;
 		time_t curtime=time(NULL);
+
 		if (call->dir==LinphoneCallIncoming && call->state==LCStateRinging){
 			elapsed=curtime-call->start_time;
 			ms_message("incoming call ringing for %i seconds",elapsed);
@@ -978,7 +1032,10 @@
 					as=lc->audiostream->session;
 				if (lc->videostream!=NULL)
 					vs=lc->videostream->session;
-				display_bandwidth(as,vs);
+
+		        display_bandwidth(as,vs);
+   
+
 			}
 #ifdef VIDEO_ENABLED
 			if (lc->videostream!=NULL)
@@ -1516,10 +1573,18 @@
 	return 0;
 }
 
+void linphone_core_set_rtp_timeout(LinphoneCore *lc, int seconds){
+    lc->sip_conf.rtp_timeout=seconds;
+}
+
 void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds){
 	lc->sip_conf.inc_timeout=seconds;
 }
 
+int linphone_core_get_rtp_timeout(LinphoneCore *lc){
+	return lc->sip_conf.rtp_timeout;
+}
+
 int linphone_core_get_inc_timeout(LinphoneCore *lc){
 	return lc->sip_conf.inc_timeout;
 }
@@ -1958,6 +2023,7 @@
 	lp_config_set_int(lc->config,"sip","guess_hostname",config->guess_hostname);
 	lp_config_set_string(lc->config,"sip","contact",config->contact);
 	lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout);
+    lp_config_set_int(lc->config,"sip","rtp_timeout",config->rtp_timeout);
 	lp_config_set_int(lc->config,"sip","use_info",config->use_info);
 	lp_config_set_int(lc->config,"sip","use_ipv6",config->ipv6_enabled);
 	for(elem=config->proxies,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
Index: coreapi/linphonecore.h
===================================================================
--- coreapi/linphonecore.h	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ coreapi/linphonecore.h	(.../trunk/linphone/linphone)	(revision 3519)
@@ -51,6 +51,8 @@
 	MSList *proxies;
 	MSList *deleted_proxies;
 	int inc_timeout;	/*timeout after an un-answered incoming call is rejected*/
+    int rtp_timeout;    /*timeout after which if no rtp or rtcp packet is 
+                          received the call is terminated. */
 	bool_t use_info;
 	bool_t guess_hostname;
 	bool_t loopback_only;
@@ -486,6 +488,8 @@
 /* function to be periodically called in a main loop */
 void linphone_core_iterate(LinphoneCore *lc);
 
+int linphone_core_is_timeout (LinphoneCore *lc);
+
 int linphone_core_invite(LinphoneCore *lc, const char *url);
 
 int linphone_core_refer(LinphoneCore *lc, const char *url);
@@ -578,6 +582,10 @@
 
 int linphone_core_get_inc_timeout(LinphoneCore *lc);
 
+void linphone_core_set_rtp_timeout(LinphoneCore *lc, int seconds);
+
+int linphone_core_get_rtp_timeout(LinphoneCore *lc);
+
 void linphone_core_set_stun_server(LinphoneCore *lc, const char *server);
 
 const char * linphone_core_get_stun_server(const LinphoneCore *lc);
Index: console/linphonec.c
===================================================================
--- console/linphonec.c	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ console/linphonec.c	(.../trunk/linphone/linphone)	(revision 3519)
@@ -584,6 +584,7 @@
 	/* printf(".\n"); */
 
 	linphone_core_iterate(opm);
+
 	if (answer_call){
 		fprintf (stdout, "-------auto answering to call-------\n" );
 		linphone_core_accept_call(opm,NULL);
@@ -609,6 +610,13 @@
 		rl_inhibit_completion=0;
 	}
 
+    if (linphone_core_is_timeout (opm))
+    {
+        fprintf (stdout, "\ntimeout\n");
+
+        linphone_core_terminate_call(opm, NULL);
+    }
+
 	return 0;
 }
 
@@ -641,8 +649,9 @@
 	/* Register a completion function */
 	rl_attempted_completion_function = linephonec_readline_completion;
 
+	/* hack to make it compile under windows */
 	/* printf("Readline initialized.\n"); */
-        setlinebuf(stdout); 
+        /* setlinebuf(stdout); */
 	return 0;
 }
 
Index: console/commands.c
===================================================================
--- console/commands.c	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ console/commands.c	(.../trunk/linphone/linphone)	(revision 3519)
@@ -33,6 +33,13 @@
 #include <linphonecore.h>
 #include "linphonec.h"
 
+#ifdef __MINGW32__
+/* hack to make it compile under Windows */
+#define sleep(t) _sleep((t) * 1000)
+void *alloca(size_t);
+#endif
+
+
 /***************************************************************************
  *
  *  Forward declarations 
@@ -43,6 +50,8 @@
 
 /* Command handlers */
 static int lpc_cmd_help(LinphoneCore *, char *);
+static int lpc_cmd_add_auth(LinphoneCore *, char *);
+static int lpc_cmd_contact(LinphoneCore *, char *);
 static int lpc_cmd_proxy(LinphoneCore *, char *);
 static int lpc_cmd_call(LinphoneCore *, char *);
 static int lpc_cmd_answer(LinphoneCore *, char *);
@@ -85,6 +94,10 @@
  */
 LPC_COMMAND commands[] = {
 	{ "help", lpc_cmd_help, "Print commands help", NULL },
+    { "add_auth", lpc_cmd_add_auth, "Add an authentication info entry",
+      "'add_auth <username> <passwd> <realm>'" }, 
+    { "contact", lpc_cmd_contact, "Set primary contact",
+      "'contact <username>'" },
 	{ "call", lpc_cmd_call, "Call a SIP uri",
 		"'call <sip-url>' or 'c <sip-url>' "
 		": initiate a call to the specified destination."
@@ -290,7 +303,68 @@
 
 }
 
+static int 
+lpc_cmd_add_auth(LinphoneCore *lc, char *args)
+{
+    LinphoneAuthInfo *ai;
+    char *username = args;
+    char *passwd;
+    char *realm;
+    char *ptr = args;
+
+    /* extract the three arguments */
+
+    if ( ! username) return 0;
+   
+    while(*ptr && !isspace(*ptr)) ++ptr;
+    
+    if ( *ptr )
+    {
+        *ptr='\0';
+        passwd=ptr+1;
+        while(*passwd && isspace(*passwd)) ++passwd;
+    }
+    else
+    {
+        return 0;
+    }
+        
+
+    ptr=passwd;
+    while(*ptr && !isspace(*ptr)) ++ptr;
+
+    if ( *ptr )
+    {
+        *ptr='\0';
+        realm=ptr+1;
+        while(*realm && isspace(*realm)) ++realm;
+    }
+    else
+    {
+        return 0;
+    }
+
+    ai = linphone_auth_info_new(username, NULL, passwd, NULL, realm);
+
+    if (ai != NULL)
+    {
+        linphone_core_add_auth_info(lc, ai);
+    }
+
+    return 1;
+}
+
 static int
+lpc_cmd_contact(LinphoneCore *lc, char *args)
+{
+    if (args == NULL) return 0;
+
+    linphone_core_set_primary_contact(lc, args);
+
+    return 1;
+}
+
+static int
 lpc_cmd_call(LinphoneCore *lc, char *args)
 {
 	if ( lc->call != NULL )
@@ -445,6 +519,9 @@
 static int
 lpc_friend_name(char **args, char **name)
 {
+  /* We are breaking this function on porpose so it
+     compiles under Windows, we should not be using it so we don't care */
+
 	/* Use space as a terminator unless quoted */
 	if (('"' == **args) || ('\'' == **args)){
 		char *end;
@@ -460,7 +537,7 @@
 		*end = '\0';
 		*args = ++end;
 	} else {
-		*name = strsep(args, " ");
+/*		*name = strsep(args, " "); */
 		
 		if (NULL == *args) { /* Means there was no separator */
 			fprintf(stderr, "Either name or address is missing\n");
@@ -537,7 +614,8 @@
 			strcpy (addr, "sip:");
 			addr_p = addr + strlen("sip:");
 		}
-		addr_orig = strsep(&args, " ");
+		/* Broken again on porpose to compile under Windows!! */
+		/*addr_orig = strsep(&args, " ");*/
 		if (1 >= strlen(addr_orig)) {
 			fprintf(stderr, "A single-digit address is not valid\n");
 			return 0;
Index: console/Makefile.in
===================================================================
--- console/Makefile.in	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ console/Makefile.in	(.../trunk/linphone/linphone)	(revision 3519)
@@ -82,7 +82,7 @@
 	$(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@ -llinphone -lmediastreamer -lortp -lreadline -lncurses -losip2 -losipparser2 -lportaudio -lspeex -lspeexdsp $(LINPHONEC_LDFLAGS)
 SOURCES = $(linphonec_SOURCES) $(sipomatic_SOURCES)
 DIST_SOURCES = $(am__linphonec_SOURCES_DIST) \
 	$(am__sipomatic_SOURCES_DIST)
Index: config.h
===================================================================
--- config.h	(.../vendor/linphone/linphone-2.1.1)	(revision 3519)
+++ config.h	(.../trunk/linphone/linphone)	(revision 3519)
@@ -1,164 +0,0 @@
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.in by autoheader.  */
-#define ENABLE_NLS 1
-/* #undef HAVE_CATGETS */
-#define HAVE_GETTEXT 1
-#define GETTEXT_PACKAGE "linphone"
-/* #undef HAVE_LC_MESSAGES */
-#define HAVE_STPCPY 1
-/* #undef HAVE_LIBSM */
-
-/* Define to 1 if translation of program messages to the user's native
-   language is requested. */
-#define ENABLE_NLS 1
-
-/* The name of the gettext package name */
-#define GETTEXT_PACKAGE "linphone"
-
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
-   CoreFoundation framework. */
-/* #undef HAVE_CFLOCALECOPYCURRENT */
-
-/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
-   the CoreFoundation framework. */
-/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
-
-/* Define if the GNU dcgettext() function is already present or preinstalled.
-   */
-#define HAVE_DCGETTEXT 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Defined when eXosip_get_version is available */
-#define HAVE_EXOSIP_GET_VERSION 1
-
-/* Define to 1 if you have the `getifaddrs' function. */
-#define HAVE_GETIFADDRS 1
-
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#define HAVE_GETTEXT 1
-
-/* Define to 1 if you have the `get_current_dir_name' function. */
-#define HAVE_GET_CURRENT_DIR_NAME 1
-
-/* Defined if we can use the gtk api */
-#define HAVE_GTK 1
-
-/* Define to 1 if you have the <history.h> header file. */
-/* #undef HAVE_HISTORY_H */
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `eXosip2' library (-leXosip2). */
-#define HAVE_LIBEXOSIP2 1
-
-/* Define to 1 if you have the `intl' library (-lintl). */
-/* #undef HAVE_LIBINTL */
-
-/* Define to 1 if you have the `ortp' library (-lortp). */
-/* #undef HAVE_LIBORTP */
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <readline.h> header file. */
-/* #undef HAVE_READLINE_H */
-
-/* Define to 1 if you have the <readline/history.h> header file. */
-#define HAVE_READLINE_HISTORY_H 1
-
-/* Define to 1 if you have the <readline/readline.h> header file. */
-#define HAVE_READLINE_READLINE_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `stpcpy' function. */
-#define HAVE_STPCPY 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strndup' function. */
-#define HAVE_STRNDUP 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Linphone's version number */
-#define LINPHONE_VERSION "2.1.1"
-
-/* Name of package */
-#define PACKAGE "linphone"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "linphone-developers@nongnu.org"
-
-/* Defines the place where data are found */
-#define PACKAGE_DATA_DIR "/usr/local/share"
-
-/* Defines the place where locales can be found */
-#define PACKAGE_LOCALE_DIR "/usr/local/share/locale"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "linphone"
-
-/* Defines the place where linphone sounds are found */
-#define PACKAGE_SOUND_DIR "/usr/local/share/sounds/linphone"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "linphone 2.1.1"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "linphone"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.1.1"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "2.1.1"
-
-/* defined if video support is available */
-#define VIDEO_ENABLED 1
-
-/* Tell whether RSVP support should be compiled. */
-/* #undef VINCENT_MAURY_RSVP */
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-/* Defined if we are compiling for arm processor */
-/* #undef __ARM__ */
-
-/* Defined if we are compiling for FreeBSD */
-/* #undef __FreeBSD__ */
-
-/* Defined if we are compiling for linux */
-#define __LINUX__ 1
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
