diff --git a/sflphone-gtk/src/MemManager.c b/sflphone-gtk/src/MemManager.c
index e6f450ea4c88c9ffeaffa9c360bb9587e2c10252..d2db7e6902fab0b31a120378d6d19c564143cfe0 100644
--- a/sflphone-gtk/src/MemManager.c
+++ b/sflphone-gtk/src/MemManager.c
@@ -18,4 +18,4 @@ int fetchData( MemKey *key, MemData *data )
 int putData( MemKey *key, MemData *data )
 {
 	return 0;
-}	
\ No newline at end of file
+}
diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c
index 98ccdfbc1f2f71239bcfc78599ddc2b60dd29758..09075a371327b398e6848b092db50294d02fd7ab 100644
--- a/sflphone-gtk/src/configwindow.c
+++ b/sflphone-gtk/src/configwindow.c
@@ -308,11 +308,11 @@ select_active_input_audio_device()
 /**
  * Select the input audio plugin by calling the server
  */
-static void
-select_input_audio_plugin(GtkWidget* widget, gpointer data)
-{
+//static void
+//select_input_audio_plugin(GtkWidget* widget, gpointer data)
+//{
 	//dbus_set_audio_manager("");
-}
+//}
 
 /**
  * Select the output audio plugin by calling the server
diff --git a/sflphone-gtk/src/main.c b/sflphone-gtk/src/main.c
index ed46bea0598a467d0e0473c70e46d989edae1072..65e54c3a73b39df47102d3002554322e3b136614 100644
--- a/sflphone-gtk/src/main.c
+++ b/sflphone-gtk/src/main.c
@@ -80,29 +80,17 @@ There is NO WARRANTY, to the extent permitted by law.\n\n");
   * Every dbus signal has to have a marshaller.  To generate a new marshaller function, 
   * add its signature to the marshaller.list.  Then run :
   * <pre>glib-genmarshal --body --g-fatal-warnings marshaller.list > marshaller.c
-  *glib-genmarshal --header --g-fatal-warnings marshaller.list > marshaller.h </pre>
-  *
+  * glib-genmarshal --header --g-fatal-warnings marshaller.list > marshaller.h</pre>
   * to get the generated marshallers.
   * Just before connecting to the dbus signal, register the marshaller with: 
   * dbus_g_object_register_marshaller().
   */
   
-/** @file callmanager-glue.h
-  * @brief CallManager dbus API.
-  * This file is generated by dbus-binding-tool using the server's 
-  * callmanager-introspec.xml: 
-  * <pre> dbus-binding-tool --mode=glib-client "../../src/dbus/callmanager-introspec.xml" > callmanager-glue.h</pre>
-  * This file dbus calls wrapper functions to simplify access to dbus API. 
-  * 
-  */
-  
-
-/** @file configurationmanager-glue.h
-  * @brief ConfigurationManager dbus API.
-  * This file is generated by dbus-binding-tool using the server's 
-  * configurationmanager-introspec.xml:
+/** @file callmanager-glue.h, configurationmanager-glue.h, contactmanager-glue.h
+  * @brief CallManager, ConfigurationManager and ContactManager dbus APIs.
+  * These files are generated by dbus-binding-tool using the server's files named *-introspec.xml:
+  * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/callmanager-introspec.xml" > callmanager-glue.h</pre>
   * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/configurationmanager-introspec.xml" > configurationmanager-glue.h</pre>
-  * 
-  * This file dbus calls wrapper functions to simplify access to dbus API. 
-  * 
+  * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/contactmanager-introspec.xml" > contactmanager-glue.h</pre>
+  * These files dbus call wrapper functions to simplify access to dbus API. 
   */
diff --git a/src/dbus/Makefile.am b/src/dbus/Makefile.am
index 2af765781c9b27312086a4f8f5187c7ff59f4a9b..78c50c1f9fa0616405c9dec50c78dc30f8426dba 100644
--- a/src/dbus/Makefile.am
+++ b/src/dbus/Makefile.am
@@ -5,8 +5,9 @@ EXTRA_DIST = *.xml README
 noinst_LTLIBRARIES = libdbus.la
 
 libdbus_la_SOURCES = \
-  callmanager.cpp \
+	callmanager.cpp \
 	configurationmanager.cpp  \
+	contactmanager.cpp \
 	instance.cpp  \
 	dbusmanagerimpl.cpp
 
@@ -19,6 +20,8 @@ noinst_HEADERS = \
 	callmanager.h  \
 	configurationmanager.h  \
 	configurationmanager-glue.h \
+	contactmanager.h \
+	contactmanager-glue.h \
 	instance.h  \
 	instance-glue.h \
 	dbusmanager.h \
@@ -32,4 +35,3 @@ service_DATA = $(service_in_files:.service.in=.service)
 # Rule to make the service file with bindir expanded
 $(service_DATA): $(service_in_files) Makefile
 	sed -e "s|bindir|$(prefix)/bin|" $<> $@
-
diff --git a/src/dbus/README b/src/dbus/README
index de2648e52d55e3d23da74b1b116a8458e7d42df5..068ed5a7bfe34ec39addffb11e7510651c00b25b 100644
--- a/src/dbus/README
+++ b/src/dbus/README
@@ -4,5 +4,7 @@ To build a new dbus interface:
 2. Generate the glue.h header by running "dbusxx-xml2cpp file.xml --adaptor=file.h"
 3. Inheritate from that glue.h class in your code.
 
-Example with configurationManager:
+Examples:
+dbusxx-xml2cpp callmanager-introspec.xml --adaptor=callmanager-glue.h
 dbusxx-xml2cpp configurationmanager-introspec.xml --adaptor=configurationmanager-glue.h
+dbusxx-xml2cpp contactmanager-introspec.xml --adaptor=contactmanager-glue.h
diff --git a/src/dbus/contactmanager-glue.h b/src/dbus/contactmanager-glue.h
new file mode 100644
index 0000000000000000000000000000000000000000..cae0ff7874e1fe4f57052b80cd3c104753113213
--- /dev/null
+++ b/src/dbus/contactmanager-glue.h
@@ -0,0 +1,154 @@
+
+/*
+ *	This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT!
+ */
+
+#ifndef __dbusxx__contactmanager_glue_h__ADAPTOR_MARSHAL_H
+#define __dbusxx__contactmanager_glue_h__ADAPTOR_MARSHAL_H
+
+#include <dbus-c++/dbus.h>
+
+namespace org {
+namespace sflphone {
+namespace SFLphone {
+
+class ContactManager
+: public ::DBus::InterfaceAdaptor
+{
+public:
+
+    ContactManager()
+    : ::DBus::InterfaceAdaptor("org.sflphone.SFLphone.ContactManager")
+    {
+        register_method(ContactManager, getContacts, _getContacts_stub);
+        register_method(ContactManager, setContacts, _setContacts_stub);
+        register_method(ContactManager, setPresence, _setPresence_stub);
+        register_method(ContactManager, setContactPresence, _setContactPresence_stub);
+    }
+
+    ::DBus::IntrospectedInterface* const introspect() const 
+    {
+        static ::DBus::IntrospectedArgument getContacts_args[] = 
+        {
+            { "accountID", "s", true },
+            { "details", "a{ss}", false },
+            { 0, 0, 0 }
+        };
+        static ::DBus::IntrospectedArgument setContacts_args[] = 
+        {
+            { "accountID", "s", true },
+            { "details", "a{ss}", true },
+            { 0, 0, 0 }
+        };
+        static ::DBus::IntrospectedArgument setPresence_args[] = 
+        {
+            { "accountID", "s", true },
+            { "presence", "s", true },
+            { "additionalInfo", "s", true },
+            { 0, 0, 0 }
+        };
+        static ::DBus::IntrospectedArgument setContactPresence_args[] = 
+        {
+            { "accountID", "s", true },
+            { "presence", "s", true },
+            { "additionalInfo", "s", true },
+            { 0, 0, 0 }
+        };
+        static ::DBus::IntrospectedMethod ContactManager_methods[] = 
+        {
+            { "getContacts", getContacts_args },
+            { "setContacts", setContacts_args },
+            { "setPresence", setPresence_args },
+            { "setContactPresence", setContactPresence_args },
+            { 0, 0 }
+        };
+        static ::DBus::IntrospectedMethod ContactManager_signals[] = 
+        {
+            { 0, 0 }
+        };
+        static ::DBus::IntrospectedProperty ContactManager_properties[] = 
+        {
+            { 0, 0, 0, 0 }
+        };
+        static ::DBus::IntrospectedInterface ContactManager_interface = 
+        {
+            "org.sflphone.SFLphone.ContactManager",
+            ContactManager_methods,
+            ContactManager_signals,
+            ContactManager_properties
+        };
+        return &ContactManager_interface;
+    }
+
+public:
+
+    /* properties exposed by this interface, use
+     * property() and property(value) to get and set a particular property
+     */
+
+public:
+
+    /* methods exported by this interface,
+     * you will have to implement them in your ObjectAdaptor
+     */
+    virtual std::map< ::DBus::String, ::DBus::String > getContacts( const ::DBus::String& accountID ) = 0;
+    virtual void setContacts( const ::DBus::String& accountID, const std::map< ::DBus::String, ::DBus::String >& details ) = 0;
+    virtual void setPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo ) = 0;
+    virtual void setContactPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo ) = 0;
+
+public:
+
+    /* signal emitters for this interface
+     */
+
+private:
+
+    /* unmarshalers (to unpack the DBus message before calling the actual interface method)
+     */
+    ::DBus::Message _getContacts_stub( const ::DBus::CallMessage& call )
+    {
+        ::DBus::MessageIter ri = call.reader();
+
+        ::DBus::String argin1; ri >> argin1;
+        std::map< ::DBus::String, ::DBus::String > argout1 = getContacts(argin1);
+        ::DBus::ReturnMessage reply(call);
+        ::DBus::MessageIter wi = reply.writer();
+        wi << argout1;
+        return reply;
+    }
+    ::DBus::Message _setContacts_stub( const ::DBus::CallMessage& call )
+    {
+        ::DBus::MessageIter ri = call.reader();
+
+        ::DBus::String argin1; ri >> argin1;
+        std::map< ::DBus::String, ::DBus::String > argin2; ri >> argin2;
+        setContacts(argin1, argin2);
+        ::DBus::ReturnMessage reply(call);
+        return reply;
+    }
+    ::DBus::Message _setPresence_stub( const ::DBus::CallMessage& call )
+    {
+        ::DBus::MessageIter ri = call.reader();
+
+        ::DBus::String argin1; ri >> argin1;
+        ::DBus::String argin2; ri >> argin2;
+        ::DBus::String argin3; ri >> argin3;
+        setPresence(argin1, argin2, argin3);
+        ::DBus::ReturnMessage reply(call);
+        return reply;
+    }
+    ::DBus::Message _setContactPresence_stub( const ::DBus::CallMessage& call )
+    {
+        ::DBus::MessageIter ri = call.reader();
+
+        ::DBus::String argin1; ri >> argin1;
+        ::DBus::String argin2; ri >> argin2;
+        ::DBus::String argin3; ri >> argin3;
+        setContactPresence(argin1, argin2, argin3);
+        ::DBus::ReturnMessage reply(call);
+        return reply;
+    }
+};
+
+} } } 
+#endif//__dbusxx__contactmanager_glue_h__ADAPTOR_MARSHAL_H
diff --git a/src/dbus/contactmanager-introspec.xml b/src/dbus/contactmanager-introspec.xml
new file mode 100644
index 0000000000000000000000000000000000000000..89d39efb192ecd3fe0604f080a95ff58129368d1
--- /dev/null
+++ b/src/dbus/contactmanager-introspec.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" ?>
+<node name="/org/sflphone/SFLphone">
+  <interface name="org.sflphone.SFLphone.ContactManager">
+    
+  <!-- Contacts related methods -->
+  
+    <!-- Called by the client to get all saved contacts -->
+    <method name="getContacts">
+      <arg type="s" name="accountID" direction="in"/>
+      <arg type="a{ss}" name="details" direction="out"/>
+    </method>
+    
+    <!-- Called by the client to save all local contacts -->
+    <method name="setContacts">
+      <arg type="s" name="accountID" direction="in"/>
+      <arg type="a{ss}" name="details" direction="in"/>
+    </method>
+   
+  <!--      ///////////////////////               -->
+
+  <!-- Presence related methods -->
+ 
+    <!-- Called by the client to set its new presence status -->
+    <method name="setPresence">
+      <arg type="s" name="accountID" direction="in"/>
+      <arg type="s" name="presence" direction="in"/>
+      <arg type="s" name="additionalInfo" direction="in"/>
+    </method>
+  
+    <!-- Called by the daemon when a contact presence changes -->
+    <method name="setContactPresence">
+      <arg type="s" name="accountID" direction="in"/>
+      <arg type="s" name="presence" direction="in"/>
+      <arg type="s" name="additionalInfo" direction="in"/>
+    </method>
+
+  </interface>
+</node>
diff --git a/src/dbus/contactmanager.cpp b/src/dbus/contactmanager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..27e9c8cc8c7ce6e4c8458c38cedb45f1852cdbec
--- /dev/null
+++ b/src/dbus/contactmanager.cpp
@@ -0,0 +1,47 @@
+/*
+ *  Copyright (C) 2008 Savoir-Faire Linux inc.
+ *  Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com>
+ *                                                                              
+ *  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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <contactmanager.h>
+#include "../manager.h"
+
+const char* ContactManager::SERVER_PATH = "/org/sflphone/SFLphone/ContactManager";
+
+std::map< ::DBus::String, ::DBus::String >
+ContactManager::getContacts( const ::DBus::String& accountID )
+{
+	// TODO
+}
+
+void
+ContactManager::setContacts( const ::DBus::String& accountID, const std::map< ::DBus::String, ::DBus::String >& details )
+{
+	// TODO
+}
+
+void
+ContactManager::setPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo )
+{
+	// TODO
+}
+
+void
+ContactManager::setContactPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo )
+{
+	// TODO
+}
diff --git a/src/dbus/contactmanager.h b/src/dbus/contactmanager.h
new file mode 100644
index 0000000000000000000000000000000000000000..796eb33269a6a38eace77ed77b549d45695fd1c0
--- /dev/null
+++ b/src/dbus/contactmanager.h
@@ -0,0 +1,46 @@
+/*
+ *  Copyright (C) 2008 Savoir-Faire Linux inc.
+ *  Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com>
+ *                                                                              
+ *  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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+ 
+#ifndef CONTACTMANAGER_H
+#define CONTACTMANAGER_H
+
+#include "contactmanager-glue.h"
+#include <dbus-c++/dbus.h>
+
+    
+class ContactManager
+: public org::sflphone::SFLphone::ContactManager,
+  public DBus::IntrospectableAdaptor,
+  public DBus::ObjectAdaptor
+{
+public:
+
+    ContactManager(DBus::Connection& connection);
+    static const char* SERVER_PATH;
+
+public:
+    std::map< ::DBus::String, ::DBus::String > getContacts( const ::DBus::String& accountID );
+    void setContacts( const ::DBus::String& accountID, const std::map< ::DBus::String, ::DBus::String >& details );
+    void setPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo );
+    void setContactPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo );
+
+};
+
+
+#endif//CONTACTMANAGER_H
diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp
index eda68f48710a675c866dd411594bccd8fe4979ea..5d7cf7fb2365f279c08c80277f3c23ef202cb766 100644
--- a/src/sipvoiplink.cpp
+++ b/src/sipvoiplink.cpp
@@ -222,137 +222,139 @@ SIPVoIPLink::getEvent()
 		return;
 	}
 
-	_debug("> SIP Event: [cdt=%4d:%4d:%4d] type=#%03d %s \n", event->cid, event->did, event->tid, event->type, event->textinfo);
+	_debugMid("> SIP Event: [cdt=%4d:%4d:%4d] type=#%03d %s  = ", event->cid, event->did, event->tid, event->type, event->textinfo);
 	switch (event->type) {
 	
 	/* REGISTER related events */
 	case EXOSIP_REGISTRATION_NEW:         /** 00 < announce new registration.       */
-		_debug(" !EXOSIP_REGISTRATION_NEW event is not implemented\n");
+		_debugMid(" !EXOSIP_REGISTRATION_NEW event is not implemented\n");
 		break;
 	case EXOSIP_REGISTRATION_SUCCESS:     /** 01 < user is successfully registred.  */
 		setRegistrationState(Registered);
-		_debug(" !EXOSIP_REGISTRATION_SUCCES\n");// TMP
+		_debugMid(" !EXOSIP_REGISTRATION_SUCCES\n");
 		//Manager::instance().registrationSucceed(getAccountID());
 		break;
 	case EXOSIP_REGISTRATION_FAILURE:     /** 02 < user is not registred.           */
 		setRegistrationState(Error, "SIP registration failure.");
-		_debug(" !EXOSIP_REGISTRATION_FAILURE\n");// TMP
+		_debugMid(" !EXOSIP_REGISTRATION_FAILURE\n");
 		//Manager::instance().registrationFailed(getAccountID());
 		break;
 	case EXOSIP_REGISTRATION_REFRESHED:   /** 03 < registration has been refreshed. */
-		_debug(" !EXOSIP_REGISTRATION_REFRESHED event is not implemented\n");
+		_debugMid(" !EXOSIP_REGISTRATION_REFRESHED event is not implemented\n");
 		break;
 	case EXOSIP_REGISTRATION_TERMINATED:  /** 04 < UA is not registred any more.    */
 		setRegistrationState(Unregistered, "Registration terminated by remote host");
-		_debug(" !EXOSIP_REGISTRATION_TERMINATED event is not implemented\n");
+		_debugMid(" !EXOSIP_REGISTRATION_TERMINATED event is not implemented\n");
 		break;
 
 	/* INVITE related events within calls */
 	case EXOSIP_CALL_INVITE:          /** 05 < announce a new call                   */
 		SIPCallInvite(event);
+		_debugMid(" !EXOSIP_CALL_INVITE\n");
 		break;
 	case EXOSIP_CALL_REINVITE:        /** 06 < announce a new INVITE within call     */
 		SIPCallReinvite(event);
+		_debugMid(" !EXOSIP_REGISTRATION_TERMINATED event is not implemented\n");
 		break;
 
 	/* CALL related events */
 	case EXOSIP_CALL_NOANSWER:        /** 07 < announce no answer within the timeout */
-		_debug(" !EXOSIP_CALL_NOANSWER event is not implemented\n");
+		_debugMid(" !EXOSIP_CALL_NOANSWER event is not implemented\n");
 		break;
 	case EXOSIP_CALL_PROCEEDING:      /** 08 < announce processing by a remote app   */
-		_debug(" !EXOSIP_CALL_PROCEEDING event is not implemented\n");
+		_debugMid(" !EXOSIP_CALL_PROCEEDING event is not implemented\n");
 		break;
 	case EXOSIP_CALL_RINGING:         /** 09 < announce ringback                     */
-		_debug(" !EXOSIP_CALL_RINGING\n");// TMP
+		_debugMid(" !EXOSIP_CALL_RINGING\n");
 		SIPCallRinging(event);
 		break;
 	case EXOSIP_CALL_ANSWERED:        /** 10 < announce start of call                */
-		_debug(" !EXOSIP_CALL_ANSWERED\n");// TMP
+		_debugMid(" !EXOSIP_CALL_ANSWERED\n");
 		SIPCallAnswered(event);
 		break;
 	case EXOSIP_CALL_REDIRECTED:      /** 11 < announce a redirection                */
-		_debug(" !EXOSIP_CALL_REDIRECTED event is not implemented\n");
+		_debugMid(" !EXOSIP_CALL_REDIRECTED event is not implemented\n");
 		break;
 	case EXOSIP_CALL_REQUESTFAILURE:  /** 12 < announce a request failure            */
-		_debug(" !EXOSIP_CALL_REQUESTFAILURE");// TMP
+		_debugMid(" !EXOSIP_CALL_REQUESTFAILURE");
 		SIPCallRequestFailure(event);
 		break;
 	case EXOSIP_CALL_SERVERFAILURE:   /** 13 < announce a server failure             */
-		_debug(" !EXOSIP_CALL_SERVERFAILURE");// TMP
+		_debugMid(" !EXOSIP_CALL_SERVERFAILURE");
 		SIPCallServerFailure(event);
 		break;
 	case EXOSIP_CALL_GLOBALFAILURE:   /** 14 < announce a global failure             */
-		_debug(" !EXOSIP_CALL_GLOBALFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_CALL_GLOBALFAILURE\n");
 		SIPCallServerFailure(event);
 		break;
 	case EXOSIP_CALL_ACK:             /** 15 < ACK received for 200ok to INVITE      */
-		_debug(" !EXOSIP_CALL_ACK\n");// TMP
+		_debugMid(" !EXOSIP_CALL_ACK\n");
 		SIPCallAck(event);
 		break;
 	case EXOSIP_CALL_CANCELLED:       /** 16 < announce that call has been cancelled */
-		_debug(" !EXOSIP_CALL_CANCELLED\n");// TMP
+		_debugMid(" !EXOSIP_CALL_CANCELLED\n");
 		break;
 	case EXOSIP_CALL_TIMEOUT:         /** 17 < announce that call has failed         */
-		_debug(" !EXOSIP_CALL_TIMEOUT\n");// TMP
+		_debugMid(" !EXOSIP_CALL_TIMEOUT\n");
 		Manager::instance().displayError(" !EXOSIP Call Error not implemented yet");
 		break;
 
 	/* Request related events within calls (except INVITE) */
 	case EXOSIP_CALL_MESSAGE_NEW:            /** 18 < announce new incoming MESSAGE. */
-		_debug(" !EXOSIP_CALL_MESSAGE_NEW\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_NEW\n");
 		SIPCallMessageNew(event);
 		break;
 	case EXOSIP_CALL_MESSAGE_PROCEEDING:     /** 19 < announce a 1xx for MESSAGE. */
-		_debug(" !EXOSIP_CALL_MESSAGE_PROCEEDING\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_PROCEEDING\n");
 		break;
 	case EXOSIP_CALL_MESSAGE_ANSWERED:       /** 20 < announce a 200ok  */
 		// 200 OK
-		_debug(" !EXOSIP_CALL_MESSAGE_ANSWERED\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_ANSWERED\n");
 		break;
 	case EXOSIP_CALL_MESSAGE_REDIRECTED:     /** 21 < announce a failure. */
-		_debug(" !EXOSIP_CALL_MESSAGE_REDIRECTED\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_REDIRECTED\n");
 		break;
 	case EXOSIP_CALL_MESSAGE_REQUESTFAILURE: /** 22 < announce a failure. */
-		_debug(" !EXOSIP_CALL_MESSAGE_REQUESTFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_REQUESTFAILURE\n");
 		break;
 	case EXOSIP_CALL_MESSAGE_SERVERFAILURE:  /** 23 < announce a failure. */
-		_debug(" !EXOSIP_CALL_MESSAGE_SERVERFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_SERVERFAILURE\n");
 		break;
 	case EXOSIP_CALL_MESSAGE_GLOBALFAILURE:  /** 24 < announce a failure. */
-		_debug(" !EXOSIP_CALL_MESSAGE_GLOBALFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_CALL_MESSAGE_GLOBALFAILURE\n");
 		Manager::instance().displayError(" !EXOSIP Call Message not implemented yet");
 		break;
 
 	case EXOSIP_CALL_CLOSED:          /** 25 < a BYE was received for this call */
-		_debug(" !EXOSIP_CALL_CLOSED\n");// TMP
+		_debugMid(" !EXOSIP_CALL_CLOSED\n");
 		SIPCallClosed(event);
 		break;
 
 	/* For both UAS & UAC events */
 	case EXOSIP_CALL_RELEASED:           /** 26 < call context is cleared. */
-		_debug(" !EXOSIP_CALL_RELEASED\n");// TMP
+		_debugMid(" !EXOSIP_CALL_RELEASED\n");
 		SIPCallReleased(event);
 		break;
 
 	/* Response received for request outside calls */
 	case EXOSIP_MESSAGE_NEW:            /** 27 < announce new incoming MESSAGE. */
-		_debug(" !EXOSIP_MESSAGE_NEW\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_NEW\n");
 		if (event->request == NULL) { break; }
 		SIPMessageNew(event);
 		break;
 	case EXOSIP_MESSAGE_PROCEEDING:     /** 28 < announce a 1xx for MESSAGE. */
-		_debug(" !EXOSIP_MESSAGE_PROCEEDING\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_PROCEEDING\n");
 		break;
 	case EXOSIP_MESSAGE_ANSWERED:       /** 29 < announce a 200ok  */
-		_debug(" !EXOSIP_MESSAGE_ANSWERED\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_ANSWERED\n");
 		break;
 	case EXOSIP_MESSAGE_REDIRECTED:     /** 30 < announce a failure. */
-		_debug(" !EXOSIP_MESSAGE_REDIRECTED\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_REDIRECTED\n");
 		Manager::instance().displayError(" !EXOSIP Message not implemented yet");
 		break;
 
 	case EXOSIP_MESSAGE_REQUESTFAILURE: /** 31 < announce a failure. */
-		_debug(" !EXOSIP_MESSAGE_REQUESTFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_REQUESTFAILURE\n");
 		if (event->response !=0 && event->response->status_code == SIP_METHOD_NOT_ALLOWED) {
 			Manager::instance().incomingMessage(getAccountID(), "Message are not allowed");
 		} else {
@@ -360,80 +362,80 @@ SIPVoIPLink::getEvent()
 		}
 		break;
 	case EXOSIP_MESSAGE_SERVERFAILURE:  /** 32 < announce a failure. */
-		_debug(" !EXOSIP_MESSAGE_SERVERFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_SERVERFAILURE\n");
 		break;
 	case EXOSIP_MESSAGE_GLOBALFAILURE:  /** 33 < announce a failure. */
-		_debug(" !EXOSIP_MESSAGE_GLOBALFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_MESSAGE_GLOBALFAILURE\n");
 		Manager::instance().displayError(" !EXOSIP Message not implemented yet");
 		break;
 
 	/* Presence and Instant Messaging */
 	case EXOSIP_SUBSCRIPTION_UPDATE:       /** 34 < announce incoming SUBSCRIBE.      */
-		_debug(" !EXOSIP_SUBSCRIPTION_UPDATE\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_UPDATE\n");
 		break;
 	case EXOSIP_SUBSCRIPTION_CLOSED:       /** 35 < announce end of subscription.     */
-		_debug(" !EXOSIP_SUBSCRIPTION_CLOSED\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_CLOSED\n");
 		Manager::instance().displayError(" !EXOSIP Subscription not implemented yet");
 		break;
 
 	case EXOSIP_SUBSCRIPTION_NOANSWER:        /** 37 < announce no answer              */
-		_debug(" !EXOSIP_SUBSCRIPTION_NOANSWER\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_NOANSWER\n");
 		break;
 	case EXOSIP_SUBSCRIPTION_PROCEEDING:      /** 38 < announce a 1xx                  */
-		_debug(" !EXOSIP_SUBSCRIPTION_PROCEEDING\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_PROCEEDING\n");
 		Manager::instance().displayError(" !EXOSIP Subscription response not implemented yet");
 		break;
 	case EXOSIP_SUBSCRIPTION_ANSWERED:        /** 39 < announce a 200ok                */
-		_debug(" !EXOSIP_SUBSCRIPTION_ANSWERED\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_ANSWERED\n");
 		eXosip_lock();
 		eXosip_automatic_action();
 		eXosip_unlock();
 		break;
 
 	case EXOSIP_SUBSCRIPTION_REDIRECTED:      /** 40 < announce a redirection          */
-		_debug(" !EXOSIP_SUBSCRIPTION_REDIRECTED\n");// TMP
+		_debugMid(" !EXOSIP_SUBSCRIPTION_REDIRECTED\n");
 		break;
 	case EXOSIP_SUBSCRIPTION_REQUESTFAILURE:  /** 41 < announce a request failure      */
-		_debug(" !EXOSIP_SUBSCRIPTION_REQUESTFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_SUBSCRIPTION_REQUESTFAILURE\n");
 		break;
 	case EXOSIP_SUBSCRIPTION_SERVERFAILURE:   /** 42 < announce a server failure       */
-		_debug(" !EXOSIP_SUBSCRIPTION_REQUESTFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_SUBSCRIPTION_REQUESTFAILURE\n");
 		break;
 	case EXOSIP_SUBSCRIPTION_GLOBALFAILURE:   /** 43 < announce a global failure       */
-		_debug(" !EXOSIP_SUBSCRIPTION_GLOBALFAILURE\n");// TMP
+		_debugMid(" !EXOSIP_SUBSCRIPTION_GLOBALFAILURE\n");
 		break;
 	case EXOSIP_SUBSCRIPTION_NOTIFY:          /** 44 < announce new NOTIFY request     */
-		_debug(" !EXOSIP_SUBSCRIPTION_NOTIFY\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_NOTIFY\n");
 		osip_body_t* body;
 		osip_from_to_str(event->request->from, &tmp2);
 		osip_message_get_body(event->request, 0, &body);
 		if (body != NULL && body->body != NULL) {
-			printf("\n---------------------------------\n");
-			printf ("(%i) from: %s\n  %s\n", event->tid, tmp2, body->body);
-			printf("---------------------------------\n");
-			osip_free(tmp2);
+//			printf("\n---------------------------------\n");
+//			printf ("(%i) from: %s\n  %s\n", event->tid, tmp2, body->body);
+//			printf("---------------------------------\n");
 		}
+		osip_free(tmp2);
 		break;
 	case EXOSIP_SUBSCRIPTION_RELEASED:        /** 45 < call context is cleared.        */
-		_debug(" !EXOSIP_SUBSCRIPTION_RELEASED\n");
+		_debugMid(" !EXOSIP_SUBSCRIPTION_RELEASED\n");
 		Manager::instance().displayError(" !EXOSIP Subscription response not implemented yet.");
 		break;
 
 	case EXOSIP_IN_SUBSCRIPTION_NEW:          /** 46 < announce new incoming SUBSCRIBE.*/
-		_debug(" !EXOSIP_IN_SUBSCRIPTION_NEW\n");
+		_debugMid(" !EXOSIP_IN_SUBSCRIPTION_NEW\n");
 		break;
 	case EXOSIP_IN_SUBSCRIPTION_RELEASED:     /** 47 < announce end of subscription.   */
-		_debug(" !EXOSIP_IN_SUBSCRIPTION_RELEASED\n");
+		_debugMid(" !EXOSIP_IN_SUBSCRIPTION_RELEASED\n");
 		Manager::instance().displayError(" !EXOSIP Subscription not implemented yet");
 		break;
 
 	case EXOSIP_EVENT_COUNT:               /** 48 < MAX number of events  */
-		_debug(" !EXOSIP_EVENT_COUNT : SHOULD NEVER HAPPEN!!!!!\n"); // TMP
+		_debugMid(" !EXOSIP_EVENT_COUNT : SHOULD NEVER HAPPEN!!!!!\n");
 		break;
 	default:
 		printf("received eXosip event (type, did, cid) = (%d, %d, %d)", event->type, event->did, event->cid);
 		break;
-	}  
+	}
 	eXosip_event_free(event);
 }
 
@@ -1007,7 +1009,7 @@ SIPVoIPLink::subscribePresenceForContact(Contact* contact)
 void
 SIPVoIPLink::publishPresenceStatus(std::string status)
 {
-	_debug("PUBLISH PRESENCE\n");
+	_debug("Publishing presence status\n");
 	char buf[4096];
 	int i;
 	osip_message_t* publication;
@@ -1042,10 +1044,8 @@ SIPVoIPLink::publishPresenceStatus(std::string status)
 	</tuple>\n\
 </presence>"
 			, url.str().c_str(), basic.data(), url.str().c_str(), note.data());
-		
-	// TMP
-	printf("%s\n", buf);
 	
+	// Build publish request in PIDF
 	i = eXosip_build_publish(&publication, url.str().c_str(), url.str().c_str(), NULL, "presence", "1800", "application/pidf+xml", buf);
 	
 	eXosip_lock();