diff --git a/sflphone-client-gnome/src/widget/webwidget.c b/sflphone-client-gnome/src/widget/webwidget.c
deleted file mode 100644
index e07d2b2f4a02f913c094861833329349ddae7846..0000000000000000000000000000000000000000
--- a/sflphone-client-gnome/src/widget/webwidget.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *  Copyright (C) 2010 Savoir-Faire Linux Inc.
- *
- *  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.
- *
- *  Additional permission under GNU GPL version 3 section 7:
- *
- *  If you modify this program, or any covered work, by linking or
- *  combining it with the OpenSSL project's OpenSSL library (or a
- *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
- *  grants you additional permission to convey the resulting work.
- *  Corresponding Source for a non-source form of such a combination
- *  shall include the source code for the parts of OpenSSL used as well
- *  as that of the covered work.
- */
-
-#include "imwidget.h"
-#include <JavaScriptCore/JavaScript.h>
-
-
-static void im_widget_init (IMWidget *im);
-static void im_widget_class_init (IMWidgetClass *klass);
-
-GType
-im_widget_get_type (void)
-{
-    static GType im_widget_type = 0;
-
-    if (!im_widget_type) {
-        static const GTypeInfo im_widget_info = {
-            sizeof (IMWidgetClass),
-            NULL, /* base_init */
-            NULL, /* base_finalize */
-            (GClassInitFunc) im_widget_class_init,
-            NULL, /* class_finalize */
-            NULL, /* class_data */
-            sizeof (IMWidget),
-            0,
-            (GInstanceInitFunc) im_widget_init,
-            NULL  /* value_table */
-        };
-
-        im_widget_type = g_type_register_static (
-                             WEBKIT_TYPE_WEB_VIEW,
-                             "IMWidget",
-                             &im_widget_info,
-                             0);
-    }
-
-    return im_widget_type;
-}
-
-static void
-im_widget_class_init (IMWidgetClass *klass)
-{
-}
-
-static void
-im_widget_init (IMWidget *im)
-{
-    /* Load our initial webpage on startup */
-    webkit_web_view_open (WEBKIT_WEB_VIEW (im), "file://" DATA_DIR "/webkit/im.html");
-
-    /* Instantiate our local webkit related variables */
-    im->web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (im));
-    im->js_context = webkit_web_frame_get_global_context (im->web_frame);
-    im->js_global = JSContextGetGlobalObject (im->js_context);
-}
-
-GtkWidget *
-im_widget_new()
-{
-    return GTK_WIDGET (g_object_new (IM_WIDGET_TYPE, NULL));
-}
diff --git a/sflphone-client-gnome/src/widget/webwidget.h b/sflphone-client-gnome/src/widget/webwidget.h
deleted file mode 100644
index 88def03efda834e998b414a2249723f99646f298..0000000000000000000000000000000000000000
--- a/sflphone-client-gnome/src/widget/webwidget.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *  Copyright (C) 2010 Savoir-Faire Linux Inc.
- *
- *  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.
- *
- *  Additional permission under GNU GPL version 3 section 7:
- *
- *  If you modify this program, or any covered work, by linking or
- *  combining it with the OpenSSL project's OpenSSL library (or a
- *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
- *  grants you additional permission to convey the resulting work.
- *  Corresponding Source for a non-source form of such a combination
- *  shall include the source code for the parts of OpenSSL used as well
- *  as that of the covered work.
- */
-
-
-#ifndef __WEB_WIDGET_H__
-#define __WEB_WIDGET_H__
-
-#include <gtk/gtk.h>
-#include <webkit/webkit.h>
-
-G_BEGIN_DECLS
-
-#define WEB_WIDGET_TYPE             (im_widget_get_type())
-#define WEB_WIDGET(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), WEB_WIDGET_TYPE, WebWidget))
-#define IM_WIDGET_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST((vtable), IM_WIDGET_TYPE, WebWidgetClass))
-#define IS_IM_WIDGET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), IM_WIDGET_TYPE))
-#define IS_IM_WIDGET_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE((vtable), IM_WIDGET_TYPE))
-#define IM_WIDGET_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS((inst), IM_WIDGET_TYPE, WebWidgetClass))
-
-typedef struct _WebWidget      WebWidget;
-typedef struct _WebWidgetClass WebWidgetClass;
-
-struct _WebWidget {
-    WebKitWebView parent_instance;
-
-    /* Private */
-    WebKitWebFrame *web_frame;      // Our web frame
-    JSGlobalContextRef js_context;  // The frame's global JS context
-    JSObjectRef js_global;          // The frame's global context JS object
-};
-
-struct _WebWidgetClass {
-    WebKitWebViewClass parent_class;
-};
-
-
-GType         im_widget_get_type (void) G_GNUC_CONST;
-GtkWidget    *im_widget_new (void);
-
-G_END_DECLS
-
-#endif  /* __IM_WIDGET_H__ */
diff --git a/sflphone-common/src/MimeParameters.h b/sflphone-common/src/MimeParameters.h
index 6699dcc1da1dd5b3be35344baf6785c3a9d7082e..8aa682e78e828865336609f0e6305be40c3e9d1b 100644
--- a/sflphone-common/src/MimeParameters.h
+++ b/sflphone-common/src/MimeParameters.h
@@ -30,8 +30,6 @@
 #ifndef __SFL_MIME_PARAMETERS_H__
 #define __SFL_MIME_PARAMETERS_H__
 
-using namespace std;
-
 /**
  * Start a new payload format definition.
  */
diff --git a/sflphone-common/src/account.cpp b/sflphone-common/src/account.cpp
index c82915b40cc167d25e0683d526bf02ed08e6c990..735a5e0e479fc56761b49aba8bf6ff3cf6dc813c 100644
--- a/sflphone-common/src/account.cpp
+++ b/sflphone-common/src/account.cpp
@@ -33,7 +33,7 @@
 #include "account.h"
 #include "manager.h"
 
-Account::Account (const AccountID& accountID, std::string type) :
+Account::Account (const AccountID& accountID, const std::string &type) :
     _accountID (accountID)
     , _link (NULL)
     , _enabled (true)
diff --git a/sflphone-common/src/account.h b/sflphone-common/src/account.h
index e14cbe3d7b6bf52d0dadec6accf0436fda10d0d9..252bb57e0d95d280ac3cf82ac40873a3622fb070 100644
--- a/sflphone-common/src/account.h
+++ b/sflphone-common/src/account.h
@@ -156,7 +156,7 @@ class Account : public Serializable
 
     public:
 
-        Account (const AccountID& accountID, std::string type);
+        Account (const AccountID& accountID, const std::string &type);
 
         /**
          * Virtual destructor
@@ -177,7 +177,7 @@ class Account : public Serializable
 
         virtual void setAccountDetails (const std::map<std::string, std::string>& details) = 0;
 
-        virtual std::map<std::string, std::string> getAccountDetails() = 0;
+        virtual std::map<std::string, std::string> getAccountDetails() const = 0;
 
         /**
          * Load the settings for this account.
@@ -188,7 +188,7 @@ class Account : public Serializable
          * Get the account ID
          * @return constant account id
          */
-        inline const AccountID& getAccountID() {
+        const AccountID& getAccountID() const {
             return _accountID;
         }
 
@@ -196,7 +196,7 @@ class Account : public Serializable
          * Get the voiplink pointer
          * @return VoIPLink* the pointer or 0
          */
-        inline VoIPLink* getVoIPLink() {
+        VoIPLink* getVoIPLink() const {
             return _link;
         }
 
@@ -219,7 +219,7 @@ class Account : public Serializable
          * @return true if enabled
          *	     false otherwise
          */
-        bool isEnabled() {
+        bool isEnabled() const {
             return _enabled;
         }
 
@@ -231,7 +231,7 @@ class Account : public Serializable
          * Get the registration state of the specified link
          * @return RegistrationState	The registration state of underlying VoIPLink
          */
-        inline RegistrationState getRegistrationState() {
+        RegistrationState getRegistrationState() const {
             return _registrationState;
         }
 
@@ -259,44 +259,44 @@ class Account : public Serializable
          * @param void
          * @return std::pair<int, std::string> A Code:Description state
          */
-        std::pair<int, std::string> getRegistrationStateDetailed (void) {
+        std::pair<int, std::string> getRegistrationStateDetailed (void) const {
             return _registrationStateDetailed;
         }
 
         /* They should be treated like macro definitions by the C++ compiler */
-        inline std::string getUsername (void) {
+        std::string getUsername (void) const {
             return _username;
         }
 
-        inline void setUsername (std::string username) {
+        void setUsername (const std::string &username) {
             _username = username;
         }
 
-        inline std::string getHostname (void) {
+        std::string getHostname (void) const {
             return _hostname;
         }
-        inline void setHostname (std::string hostname) {
+        void setHostname (const std::string &hostname) {
             _hostname = hostname;
         }
 
-        inline std::string getPassword (void) {
+        std::string getPassword (void) const {
             return _password;
         }
-        inline void setPassword (std::string password) {
+        void setPassword (const std::string &password) {
             _password = password;
         }
 
-        inline std::string getAlias (void) {
+        std::string getAlias (void) const {
             return _alias;
         }
-        inline void setAlias (std::string alias) {
+        void setAlias (const std::string &alias) {
             _alias = alias;
         }
 
-        inline std::string getType (void) {
+        std::string getType (void) const {
             return _type;
         }
-        inline void setType (std::string type) {
+        void setType (const std::string &type) {
             _type = type;
         }
 
@@ -304,7 +304,7 @@ class Account : public Serializable
          * Accessor to data structures
          * @return CodecOrder& The list that reflects the user's choice
          */
-        inline CodecOrder& getActiveCodecs (void) {
+        const CodecOrder& getActiveCodecs (void) const {
             return _codecOrder;
         }
 
@@ -314,39 +314,39 @@ class Account : public Serializable
          */
         void setActiveCodecs (const std::vector <std::string>& list);
 
-        inline std::string getRingtonePath (void) {
+        std::string getRingtonePath (void) const {
             return _ringtonePath;
         }
-        inline void setRingtonePath (std::string path) {
+        void setRingtonePath (const std::string &path) {
             _ringtonePath = path;
         }
 
-        inline bool getRingtoneEnabled (void) {
+        bool getRingtoneEnabled (void) const {
             return _ringtoneEnabled;
         }
-        inline void setRingtoneEnabled (bool enabl) {
+        void setRingtoneEnabled (bool enabl) {
             _ringtoneEnabled = enabl;
         }
 
-        inline std::string getDisplayName (void) {
+        std::string getDisplayName (void) const {
             return _displayName;
         }
-        inline void setDisplayName (std::string name) {
+        void setDisplayName (const std::string &name) {
             _displayName = name;
         }
 
-        std::string getUseragent (void) {
+        std::string getUseragent (void) const {
             return _useragent;
         }
-        void setUseragent (std::string ua) {
+        void setUseragent (const std::string &ua) {
             _useragent = ua;
         }
 
-        std::string getMailBox (void) {
+        std::string getMailBox (void) const {
             return _mailBox;
         }
 
-        void setMailBox (std::string mb) {
+        void setMailBox (const std::string &mb) {
             _mailBox = mb;
         }
 
diff --git a/sflphone-common/src/audio/audiorecord.cpp b/sflphone-common/src/audio/audiorecord.cpp
index 98413b7ae6340ae89b9a824bbeede92d616d9613..52cc81b9d894ae6500f37b8553b55bded0b8c530 100644
--- a/sflphone-common/src/audio/audiorecord.cpp
+++ b/sflphone-common/src/audio/audiorecord.cpp
@@ -29,6 +29,8 @@
  */
 
 #include "audiorecord.h"
+#include <cstring> // for strstr
+#include <sstream> // for stringstream
 
 // structure for the wave header
 
@@ -249,7 +251,7 @@ void AudioRecord::createFilename()
     rawtime = time (NULL);
     timeinfo = localtime (&rawtime);
 
-    stringstream out;
+    std::stringstream out;
 
     // DATE
     out << timeinfo->tm_year+1900;
diff --git a/sflphone-common/src/audio/audiorecord.h b/sflphone-common/src/audio/audiorecord.h
index 73bd1a0a75cc70090008fcad2678236157af08b3..8432130c6008eaf887182c4cfb06a85fbe51e456 100644
--- a/sflphone-common/src/audio/audiorecord.h
+++ b/sflphone-common/src/audio/audiorecord.h
@@ -31,15 +31,11 @@
 #ifndef _AUDIO_RECORD_H
 #define _AUDIO_RECORD_H
 
-#include <iostream>
-#include <string.h>
-#include <stdlib.h>
-#include <sstream>
+#include <string>
+#include <cstdlib>
 
 #include "global.h"
 
-using namespace std;
-
 typedef std::string CallID;
 
 class AudioRecord
diff --git a/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.cpp b/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.cpp
index 02aa5ee387e1412aeaaa93cf7c09f3a41893729e..eccbaa98b327f331da29b6d7488e516cc39ffb30 100644
--- a/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.cpp
+++ b/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.cpp
@@ -28,6 +28,7 @@
  */
 
 #include "AudioRtpRecordHandler.h"
+#include <fstream>
 
 #include "audio/audiolayer.h"
 #include "manager.h"
@@ -249,7 +250,7 @@ void AudioRtpRecordHandler::putDtmfEvent (int digit)
     _debug ("AudioRtpSession: Put Dtmf Event %d", digit);
 }
 
-ofstream teststream("test_process_data_encode.raw");
+std::ofstream teststream("test_process_data_encode.raw");
 
 int AudioRtpRecordHandler::processDataEncode (void)
 {
diff --git a/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.h b/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.h
index e1d76d2f34778a4b0b4090e395a8cb3790c36a48..506fadd0c234ef9b02112a09685193a21223861d 100644
--- a/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.h
+++ b/sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.h
@@ -40,6 +40,7 @@
 #include "audio/gaincontrol.h"
 #include "managerimpl.h"
 #include <ccrtp/rtp.h>
+#include <list>
 
 namespace sfl
 {
@@ -80,7 +81,7 @@ typedef struct DtmfEvent {
     bool newevent;
 } DtmfEvent;
 
-typedef list<DtmfEvent *> EventQueue;
+typedef std::list<DtmfEvent *> EventQueue;
 
 /**
  * Class meant to store internal data in order to encode/decode,
diff --git a/sflphone-common/src/audio/audiortp/AudioZrtpSession.h b/sflphone-common/src/audio/audiortp/AudioZrtpSession.h
index 60039d77cdec6be42d4072997b6b7b33102872d3..71a2ac5e9326c316d28c41c87da1efec267c738c 100644
--- a/sflphone-common/src/audio/audiortp/AudioZrtpSession.h
+++ b/sflphone-common/src/audio/audiortp/AudioZrtpSession.h
@@ -30,8 +30,6 @@
 #ifndef __SFL_AUDIO_ZRTP_SESSION_H__
 #define __SFL_AUDIO_ZRTP_SESSION_H__
 
-using namespace std;
-
 #include <ccrtp/rtp.h>
 
 #include <libzrtpcpp/zrtpccrtp.h>
diff --git a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp
index 870eb42e8047547ceb0fbb0f0c87ab1178878c54..7849c8a11d2cd1837a49f5834d4d81c7e21c035e 100644
--- a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp
+++ b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp
@@ -37,19 +37,20 @@
 #include <cstdlib>
 #include <string>
 #include <map>
+#include <utility> // for std::pair
 
 using namespace GnuZrtpCodes;
 
 using namespace ost;
 
-using namespace std;
-
 namespace sfl
 {
 
 ZrtpSessionCallback::ZrtpSessionCallback (SIPCall *sipcall) :
     _sipcall (sipcall)
 {
+    using std::pair;
+    using std::string;
 
     if (_mapInitialized) {
         return;
@@ -61,63 +62,63 @@ ZrtpSessionCallback::ZrtpSessionCallback (SIPCall *sipcall) :
      * Information Map
      */
 
-    _infoMap.insert (pair<int32, std::string*> (InfoHelloReceived, new string ("Hello received, preparing a Commit")));
-    _infoMap.insert (pair<int32, std::string*> (InfoCommitDHGenerated, new string ("Commit: Generated a public DH key")));
-    _infoMap.insert (pair<int32, std::string*> (InfoRespCommitReceived, new string ("Responder: Commit received, preparing DHPart1")));
-    _infoMap.insert (pair<int32, std::string*> (InfoDH1DHGenerated, new string ("DH1Part: Generated a public DH key")));
-    _infoMap.insert (pair<int32, std::string*> (InfoInitDH1Received, new string ("Initiator: DHPart1 received, preparing DHPart2")));
-    _infoMap.insert (pair<int32, std::string*> (InfoRespDH2Received, new string ("Responder: DHPart2 received, preparing Confirm1")));
-    _infoMap.insert (pair<int32, std::string*> (InfoInitConf1Received, new string ("Initiator: Confirm1 received, preparing Confirm2")));
-    _infoMap.insert (pair<int32, std::string*> (InfoRespConf2Received, new string ("Responder: Confirm2 received, preparing Conf2Ack")));
-    _infoMap.insert (pair<int32, std::string*> (InfoRSMatchFound, new string ("At least one retained secrets matches - security OK")));
-    _infoMap.insert (pair<int32, std::string*> (InfoSecureStateOn, new string ("Entered secure state")));
-    _infoMap.insert (pair<int32, std::string*> (InfoSecureStateOff, new string ("No more security for this session")));
+    _infoMap.insert (pair<int32, string*> (InfoHelloReceived, new string ("Hello received, preparing a Commit")));
+    _infoMap.insert (pair<int32, string*> (InfoCommitDHGenerated, new string ("Commit: Generated a public DH key")));
+    _infoMap.insert (pair<int32, string*> (InfoRespCommitReceived, new string ("Responder: Commit received, preparing DHPart1")));
+    _infoMap.insert (pair<int32, string*> (InfoDH1DHGenerated, new string ("DH1Part: Generated a public DH key")));
+    _infoMap.insert (pair<int32, string*> (InfoInitDH1Received, new string ("Initiator: DHPart1 received, preparing DHPart2")));
+    _infoMap.insert (pair<int32, string*> (InfoRespDH2Received, new string ("Responder: DHPart2 received, preparing Confirm1")));
+    _infoMap.insert (pair<int32, string*> (InfoInitConf1Received, new string ("Initiator: Confirm1 received, preparing Confirm2")));
+    _infoMap.insert (pair<int32, string*> (InfoRespConf2Received, new string ("Responder: Confirm2 received, preparing Conf2Ack")));
+    _infoMap.insert (pair<int32, string*> (InfoRSMatchFound, new string ("At least one retained secrets matches - security OK")));
+    _infoMap.insert (pair<int32, string*> (InfoSecureStateOn, new string ("Entered secure state")));
+    _infoMap.insert (pair<int32, string*> (InfoSecureStateOff, new string ("No more security for this session")));
 
     /**
      * Warning Map
      */
 
-    _warningMap.insert (pair<int32, std::string*> (WarningDHAESmismatch,
+    _warningMap.insert (pair<int32, string*> (WarningDHAESmismatch,
                         new string ("Commit contains an AES256 cipher but does not offer a Diffie-Helman 4096")));
-    _warningMap.insert (pair<int32, std::string*> (WarningGoClearReceived, new string ("Received a GoClear message")));
-    _warningMap.insert (pair<int32, std::string*> (WarningDHShort,
+    _warningMap.insert (pair<int32, string*> (WarningGoClearReceived, new string ("Received a GoClear message")));
+    _warningMap.insert (pair<int32, string*> (WarningDHShort,
                         new string ("Hello offers an AES256 cipher but does not offer a Diffie-Helman 4096")));
-    _warningMap.insert (pair<int32, std::string*> (WarningNoRSMatch, new string ("No retained secret matches - verify SAS")));
-    _warningMap.insert (pair<int32, std::string*> (WarningCRCmismatch, new string ("Internal ZRTP packet checksum mismatch - packet dropped")));
-    _warningMap.insert (pair<int32, std::string*> (WarningSRTPauthError, new string ("Dropping packet because SRTP authentication failed!")));
-    _warningMap.insert (pair<int32, std::string*> (WarningSRTPreplayError, new string ("Dropping packet because SRTP replay check failed!")));
-
-    _severeMap.insert (pair<int32, std::string*> (SevereHelloHMACFailed, new string ("Hash HMAC check of Hello failed!")));
-    _severeMap.insert (pair<int32, std::string*> (SevereCommitHMACFailed, new string ("Hash HMAC check of Commit failed!")));
-    _severeMap.insert (pair<int32, std::string*> (SevereDH1HMACFailed, new string ("Hash HMAC check of DHPart1 failed!")));
-    _severeMap.insert (pair<int32, std::string*> (SevereDH2HMACFailed, new string ("Hash HMAC check of DHPart2 failed!")));
-    _severeMap.insert (pair<int32, std::string*> (SevereCannotSend, new string ("Cannot send data - connection or peer down?")));
-    _severeMap.insert (pair<int32, std::string*> (SevereProtocolError, new string ("Internal protocol error occured!")));
-    _severeMap.insert (pair<int32, std::string*> (SevereNoTimer, new string ("Cannot start a timer - internal resources exhausted?")));
-    _severeMap.insert (pair<int32, std::string*> (SevereTooMuchRetries,
+    _warningMap.insert (pair<int32, string*> (WarningNoRSMatch, new string ("No retained secret matches - verify SAS")));
+    _warningMap.insert (pair<int32, string*> (WarningCRCmismatch, new string ("Internal ZRTP packet checksum mismatch - packet dropped")));
+    _warningMap.insert (pair<int32, string*> (WarningSRTPauthError, new string ("Dropping packet because SRTP authentication failed!")));
+    _warningMap.insert (pair<int32, string*> (WarningSRTPreplayError, new string ("Dropping packet because SRTP replay check failed!")));
+
+    _severeMap.insert (pair<int32, string*> (SevereHelloHMACFailed, new string ("Hash HMAC check of Hello failed!")));
+    _severeMap.insert (pair<int32, string*> (SevereCommitHMACFailed, new string ("Hash HMAC check of Commit failed!")));
+    _severeMap.insert (pair<int32, string*> (SevereDH1HMACFailed, new string ("Hash HMAC check of DHPart1 failed!")));
+    _severeMap.insert (pair<int32, string*> (SevereDH2HMACFailed, new string ("Hash HMAC check of DHPart2 failed!")));
+    _severeMap.insert (pair<int32, string*> (SevereCannotSend, new string ("Cannot send data - connection or peer down?")));
+    _severeMap.insert (pair<int32, string*> (SevereProtocolError, new string ("Internal protocol error occured!")));
+    _severeMap.insert (pair<int32, string*> (SevereNoTimer, new string ("Cannot start a timer - internal resources exhausted?")));
+    _severeMap.insert (pair<int32, string*> (SevereTooMuchRetries,
                        new string ("Too much retries during ZRTP negotiation - connection or peer down?")));
 
     /**
      * Zrtp protocol related messages map
      */
 
-    _zrtpMap.insert (pair<int32, std::string*> (MalformedPacket, new string ("Malformed packet (CRC OK, but wrong structure)")));
-    _zrtpMap.insert (pair<int32, std::string*> (CriticalSWError, new string ("Critical software error")));
-    _zrtpMap.insert (pair<int32, std::string*> (UnsuppZRTPVersion, new string ("Unsupported ZRTP version")));
-    _zrtpMap.insert (pair<int32, std::string*> (HelloCompMismatch, new string ("Hello components mismatch")));
-    _zrtpMap.insert (pair<int32, std::string*> (UnsuppHashType, new string ("Hash type not supported")));
-    _zrtpMap.insert (pair<int32, std::string*> (UnsuppCiphertype, new string ("Cipher type not supported")));
-    _zrtpMap.insert (pair<int32, std::string*> (UnsuppPKExchange, new string ("Public key exchange not supported")));
-    _zrtpMap.insert (pair<int32, std::string*> (UnsuppSRTPAuthTag, new string ("SRTP auth. tag not supported")));
-    _zrtpMap.insert (pair<int32, std::string*> (UnsuppSASScheme, new string ("SAS scheme not supported")));
-    _zrtpMap.insert (pair<int32, std::string*> (NoSharedSecret, new string ("No shared secret available, DH mode required")));
-    _zrtpMap.insert (pair<int32, std::string*> (DHErrorWrongPV, new string ("DH Error: bad pvi or pvr ( == 1, 0, or p-1)")));
-    _zrtpMap.insert (pair<int32, std::string*> (DHErrorWrongHVI, new string ("DH Error: hvi != hashed data")));
-    _zrtpMap.insert (pair<int32, std::string*> (SASuntrustedMiTM, new string ("Received relayed SAS from untrusted MiTM")));
-    _zrtpMap.insert (pair<int32, std::string*> (ConfirmHMACWrong, new string ("Auth. Error: Bad Confirm pkt HMAC")));
-    _zrtpMap.insert (pair<int32, std::string*> (NonceReused, new string ("Nonce reuse")));
-    _zrtpMap.insert (pair<int32, std::string*> (EqualZIDHello, new string ("Equal ZIDs in Hello")));
-    _zrtpMap.insert (pair<int32, std::string*> (GoCleatNotAllowed, new string ("GoClear packet received, but not allowed")));
+    _zrtpMap.insert (pair<int32, string*> (MalformedPacket, new string ("Malformed packet (CRC OK, but wrong structure)")));
+    _zrtpMap.insert (pair<int32, string*> (CriticalSWError, new string ("Critical software error")));
+    _zrtpMap.insert (pair<int32, string*> (UnsuppZRTPVersion, new string ("Unsupported ZRTP version")));
+    _zrtpMap.insert (pair<int32, string*> (HelloCompMismatch, new string ("Hello components mismatch")));
+    _zrtpMap.insert (pair<int32, string*> (UnsuppHashType, new string ("Hash type not supported")));
+    _zrtpMap.insert (pair<int32, string*> (UnsuppCiphertype, new string ("Cipher type not supported")));
+    _zrtpMap.insert (pair<int32, string*> (UnsuppPKExchange, new string ("Public key exchange not supported")));
+    _zrtpMap.insert (pair<int32, string*> (UnsuppSRTPAuthTag, new string ("SRTP auth. tag not supported")));
+    _zrtpMap.insert (pair<int32, string*> (UnsuppSASScheme, new string ("SAS scheme not supported")));
+    _zrtpMap.insert (pair<int32, string*> (NoSharedSecret, new string ("No shared secret available, DH mode required")));
+    _zrtpMap.insert (pair<int32, string*> (DHErrorWrongPV, new string ("DH Error: bad pvi or pvr ( == 1, 0, or p-1)")));
+    _zrtpMap.insert (pair<int32, string*> (DHErrorWrongHVI, new string ("DH Error: hvi != hashed data")));
+    _zrtpMap.insert (pair<int32, string*> (SASuntrustedMiTM, new string ("Received relayed SAS from untrusted MiTM")));
+    _zrtpMap.insert (pair<int32, string*> (ConfirmHMACWrong, new string ("Auth. Error: Bad Confirm pkt HMAC")));
+    _zrtpMap.insert (pair<int32, string*> (NonceReused, new string ("Nonce reuse")));
+    _zrtpMap.insert (pair<int32, string*> (EqualZIDHello, new string ("Equal ZIDs in Hello")));
+    _zrtpMap.insert (pair<int32, string*> (GoCleatNotAllowed, new string ("GoClear packet received, but not allowed")));
 
     _mapInitialized = true;
 }
@@ -155,7 +156,7 @@ ZrtpSessionCallback::zrtpNotSuppOther()
 void
 ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t subCode)
 {
-    string* msg;
+    std::string* msg;
 
     if (sev == Info) {
         msg = _infoMap[subCode];
@@ -199,7 +200,7 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub
 void
 ZrtpSessionCallback::zrtpNegotiationFailed (MessageSeverity severity, int subCode)
 {
-    string* msg;
+    std::string* msg;
 
     if (severity == ZrtpError) {
         if (subCode < 0) {  // received an error packet from peer
@@ -229,10 +230,10 @@ ZrtpSessionCallback::confirmGoClear()
     DBusManager::instance().getCallManager()->zrtpNotSuppOther (_sipcall->getCallId());
 }
 
-map<int32, std::string*>ZrtpSessionCallback::_infoMap;
-map<int32, std::string*>ZrtpSessionCallback::_warningMap;
-map<int32, std::string*>ZrtpSessionCallback::_severeMap;
-map<int32, std::string*>ZrtpSessionCallback::_zrtpMap;
+std::map<int32, std::string*>ZrtpSessionCallback::_infoMap;
+std::map<int32, std::string*>ZrtpSessionCallback::_warningMap;
+std::map<int32, std::string*>ZrtpSessionCallback::_severeMap;
+std::map<int32, std::string*>ZrtpSessionCallback::_zrtpMap;
 
 bool ZrtpSessionCallback::_mapInitialized = false;
 }
diff --git a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.h b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.h
index 24d6194d350fb43ffb4eebb2efef1dbc52203705..2fad01eed47517cfda17904a1563a9a1430b08f2 100644
--- a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.h
+++ b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.h
@@ -31,8 +31,6 @@
 #ifndef __SFL_ZRTP_CALLBACK_H__
 #define __SFL_ZRTP_CALLBACK_H__
 
-using namespace std;
-
 #include <libzrtpcpp/zrtpccrtp.h>
 #include <libzrtpcpp/ZrtpQueue.h>
 #include <libzrtpcpp/ZrtpUserCallback.h>
@@ -67,7 +65,7 @@ class ZrtpSessionCallback: public ZrtpUserCallback
 
     private:
         SIPCall* _sipcall;
-
+        /* FIXME: why are these strings dynamically allocated? */
         static std::map<int32, std::string*> _infoMap;
         static std::map<int32, std::string*> _warningMap;
         static std::map<int32, std::string*> _severeMap;
diff --git a/sflphone-common/src/audio/echocancel.cpp b/sflphone-common/src/audio/echocancel.cpp
index a19b309f1acd1474e8623387a2d106d449c967b2..e0f2fa077f8b67ad0c660197f27e95a0b03aa4e7 100644
--- a/sflphone-common/src/audio/echocancel.cpp
+++ b/sflphone-common/src/audio/echocancel.cpp
@@ -69,8 +69,8 @@ EchoCancel::EchoCancel (int smplRate, int frameLength) : _samplingRate (smplRate
     // echoFile = new ofstream("echoData", ofstream::binary);
     // spkrFile = new ofstream("spkrData", ofstream::binary);
 
-    micLevelData = new ofstream ("micLevelData", ofstream::binary);
-    spkrLevelData = new ofstream ("spkrLevelData", ofstream::binary);
+    micLevelData = new std::ofstream ("micLevelData", std::ofstream::binary);
+    spkrLevelData = new std::ofstream ("spkrLevelData", std::ofstream::binary);
 
 
     _micData = new RingBuffer (50000);
diff --git a/sflphone-common/src/audio/echocancel.h b/sflphone-common/src/audio/echocancel.h
index d7bed3ccaca8366b6b9c53806c6f3496c460d83f..263a386c8a6dcd0080066d2b2d598a796f760a7f 100644
--- a/sflphone-common/src/audio/echocancel.h
+++ b/sflphone-common/src/audio/echocancel.h
@@ -31,6 +31,7 @@
 #ifndef ECHOCANCEL_H
 #define ECHOCANCEL_H
 
+#include <iosfwd> // for forward declarations of ofstream
 #include <cc++/thread.h>
 #include <speex/speex_preprocess.h>
 
@@ -376,12 +377,12 @@ class EchoCancel : public Algorithm
 
         int _correlationArray[BUFF_SIZE];
 
-        ofstream *micFile;
-        ofstream *spkrFile;
-        ofstream *echoFile;
+        std::ofstream *micFile;
+        std::ofstream *spkrFile;
+        std::ofstream *echoFile;
 
-        ofstream *micLevelData;
-        ofstream *spkrLevelData;
+        std::ofstream *micLevelData;
+        std::ofstream *spkrLevelData;
 
         // #ifdef HAVE_SPEEXDSP_LIB
         /**
diff --git a/sflphone-common/src/audio/mainbuffer.cpp b/sflphone-common/src/audio/mainbuffer.cpp
index 1ca2794e5573fc2da31587c41720eef8ae33107b..83f4b51941e503f0205ebdd7285c6d45721eec41 100644
--- a/sflphone-common/src/audio/mainbuffer.cpp
+++ b/sflphone-common/src/audio/mainbuffer.cpp
@@ -30,7 +30,7 @@
  */
 
 #include "mainbuffer.h"
-
+#include <utility> // for std::pair
 #include "manager.h"
 
 MainBuffer::MainBuffer() : _internalSamplingRate (8000)
@@ -84,7 +84,7 @@ bool MainBuffer::createCallIDSet (CallID set_id)
 
     CallIDSet* newCallIDSet = new CallIDSet;
 
-    _callIDMap.insert (pair<CallID, CallIDSet*> (set_id, newCallIDSet));
+    _callIDMap.insert (std::pair<CallID, CallIDSet*> (set_id, newCallIDSet));
 
     return true;
 
@@ -149,7 +149,7 @@ RingBuffer* MainBuffer::createRingBuffer (CallID call_id)
 {
     RingBuffer* newRingBuffer = new RingBuffer (SIZEBUF, call_id);
 
-    _ringBufferMap.insert (pair<CallID, RingBuffer*> (call_id, newRingBuffer));
+    _ringBufferMap.insert (std::pair<CallID, RingBuffer*> (call_id, newRingBuffer));
 
     return newRingBuffer;
 }
@@ -646,8 +646,8 @@ void MainBuffer::stateInfo()
     while (iter_call != _callIDMap.end()) {
 
         std::string dbg_str ("    Call: ");
-        dbg_str.append (std::string (iter_call->first.c_str()));
-        dbg_str.append (std::string ("   is bound to: "));
+        dbg_str.append (iter_call->first);
+        dbg_str.append ("   is bound to: ");
 
         CallIDSet* call_id_set = (CallIDSet*) iter_call->second;
 
@@ -655,8 +655,8 @@ void MainBuffer::stateInfo()
 
         while (iter_call_id != call_id_set->end()) {
 
-            dbg_str.append (std::string (*iter_call_id));
-            dbg_str.append (std::string (", "));
+            dbg_str.append (*iter_call_id);
+            dbg_str.append (", ");
 
             iter_call_id++;
         }
@@ -676,8 +676,8 @@ void MainBuffer::stateInfo()
 
         std::string dbg_str ("    Buffer: ");
 
-        dbg_str.append (std::string (iter_buffer->first.c_str()));
-        dbg_str.append (std::string ("   as read pointer: "));
+        dbg_str.append (iter_buffer->first);
+        dbg_str.append ("   as read pointer: ");
 
         if (rbuffer)
             rpointer = rbuffer->getReadPointerList();
@@ -688,8 +688,8 @@ void MainBuffer::stateInfo()
 
             while (iter_pointer != rpointer->end()) {
 
-                dbg_str.append (string (iter_pointer->first.c_str()));
-                dbg_str.append (string (", "));
+                dbg_str.append (iter_pointer->first);
+                dbg_str.append (", ");
 
                 iter_pointer++;
             }
diff --git a/sflphone-common/src/audio/ringbuffer.cpp b/sflphone-common/src/audio/ringbuffer.cpp
index 7790f362a7de343fa8863770f9e04ea465a3eca0..9d51374049ea789790c944239874dacbb8644298 100644
--- a/sflphone-common/src/audio/ringbuffer.cpp
+++ b/sflphone-common/src/audio/ringbuffer.cpp
@@ -32,9 +32,10 @@
  *  as that of the covered work.
  */
 
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
+#include <utility> // for std::pair
 
 #include "ringbuffer.h"
 #include "global.h"
@@ -180,7 +181,7 @@ void
 RingBuffer::createReadPointer (CallID call_id)
 {
     if (!hasThisReadPointer (call_id))
-        _readpointer.insert (pair<CallID, int> (call_id, mEnd));
+        _readpointer.insert (std::pair<CallID, int> (call_id, mEnd));
 
 }
 
diff --git a/sflphone-common/src/audio/ringbuffer.h b/sflphone-common/src/audio/ringbuffer.h
index b52cd3417c21f953cd85aeb47ca936547a89f484..cbb532cb65859338fa45a0b2b0decc7a564c8000 100644
--- a/sflphone-common/src/audio/ringbuffer.h
+++ b/sflphone-common/src/audio/ringbuffer.h
@@ -29,7 +29,7 @@
 
 typedef unsigned char* samplePtr;
 
-typedef map<CallID, int> ReadPointer;
+typedef std::map<CallID, int> ReadPointer;
 
 static CallID default_id = "audiolayer_id";
 
diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h
index b1931ad652bb78630189ac146210660e3a5dd7b4..0d43aab4b89ee734f8c6dfe83110dc627c67b0a0 100644
--- a/sflphone-common/src/dbus/callmanager.h
+++ b/sflphone-common/src/dbus/callmanager.h
@@ -31,9 +31,13 @@
 #ifndef __SFL_CALLMANAGER_H__
 #define __SFL_CALLMANAGER_H__
 
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
+/* This warning option only exists for gcc 4.6.0 and greater. */
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#endif
+
 #pragma GCC diagnostic ignored "-Wignored-qualifiers"
 #pragma GCC diagnostic ignored "-Wunused-parameter"
-#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #include "callmanager-glue.h"
 #pragma GCC diagnostic warning "-Wignored-qualifiers"
 #pragma GCC diagnostic warning "-Wunused-parameter"
diff --git a/sflphone-common/src/dbus/networkmanager.cpp b/sflphone-common/src/dbus/networkmanager.cpp
index 9ca92dad19039541f2823d9849fd8bb3efccaa99..481f46918676d1c206e1d36b5b624e6ab47a2da0 100644
--- a/sflphone-common/src/dbus/networkmanager.cpp
+++ b/sflphone-common/src/dbus/networkmanager.cpp
@@ -36,11 +36,9 @@
 #include <instance.h>
 #include "../manager.h"
 
-using namespace std;
+const std::string NetworkManager::statesString[5] = {"unknown", "asleep", "connecting", "connected", "disconnected"};
 
-const string NetworkManager::statesString[5] = {"unknown", "asleep", "connecting", "connected", "disconnected"};
-
-string NetworkManager::stateAsString (const uint32_t& state)
+std::string NetworkManager::stateAsString (const uint32_t& state)
 {
     return statesString[state];
 }
@@ -52,9 +50,9 @@ void NetworkManager::StateChanged (const uint32_t& state)
 
 void NetworkManager::PropertiesChanged (const std::map< std::string, ::DBus::Variant >& argin0)
 {
-    const map< string, ::DBus::Variant >::const_iterator iter = argin0.begin();
+    const std::map< std::string, ::DBus::Variant >::const_iterator iter = argin0.begin();
 
-    string message = iter->first;
+    std::string message = iter->first;
 
     _warn ("Properties changed: %s", iter->first.c_str());
     /*
diff --git a/sflphone-common/src/dbus/networkmanager.h b/sflphone-common/src/dbus/networkmanager.h
index b87fb538a0b2ea16005bae395c74beba9d4069b0..2282d581259ee238ca8035102c057b61289adc77 100644
--- a/sflphone-common/src/dbus/networkmanager.h
+++ b/sflphone-common/src/dbus/networkmanager.h
@@ -37,8 +37,6 @@
 #pragma GCC diagnostic warning "-Wignored-qualifiers"
 #pragma GCC diagnostic warning "-Wunused-parameter"
 
-using namespace std;
-
 class NetworkManager
     : public org::freedesktop::NetworkManager_proxy,
   public DBus::IntrospectableProxy,
@@ -49,7 +47,7 @@ class NetworkManager
         NetworkManager (DBus::Connection&, const DBus::Path&, const char*);
         void StateChanged (const uint32_t& state);
         void PropertiesChanged (const std::map< std::string, ::DBus::Variant >& argin0);
-        string stateAsString (const uint32_t& state);
+        std::string stateAsString (const uint32_t& state);
 
         enum NMState {
             NM_STATE_UNKNOWN = 0,
@@ -59,7 +57,7 @@ class NetworkManager
             NM_STATE_DISCONNECTED
         };
 
-        static const string statesString[5];
+        static const std::string statesString[5];
 };
 #endif
 
diff --git a/sflphone-common/src/iax/iaxaccount.cpp b/sflphone-common/src/iax/iaxaccount.cpp
index d70d3c75161dd2e7228dafe3d5586ca5e3e510cf..0f23d30483e308bc24a6cb320c46a62d99dd8923 100644
--- a/sflphone-common/src/iax/iaxaccount.cpp
+++ b/sflphone-common/src/iax/iaxaccount.cpp
@@ -216,7 +216,7 @@ void IAXAccount::setAccountDetails (const std::map<std::string, std::string>& de
 
 }
 
-std::map<std::string, std::string> IAXAccount::getAccountDetails()
+std::map<std::string, std::string> IAXAccount::getAccountDetails() const
 {
     std::map<std::string, std::string> a;
 
diff --git a/sflphone-common/src/iax/iaxaccount.h b/sflphone-common/src/iax/iaxaccount.h
index a7f56cccfe363d61c308f89b249aaacae0c8ff3c..654cc70c67102be5bcd1b74125226c61b2c47193 100644
--- a/sflphone-common/src/iax/iaxaccount.h
+++ b/sflphone-common/src/iax/iaxaccount.h
@@ -50,7 +50,7 @@ class IAXAccount : public Account
 
         void setAccountDetails (const std::map<std::string, std::string>& details);
 
-        std::map<std::string, std::string> getAccountDetails();
+        std::map<std::string, std::string> getAccountDetails() const;
 
         void setVoIPLink ();
 
diff --git a/sflphone-common/src/iax/iaxvoiplink.cpp b/sflphone-common/src/iax/iaxvoiplink.cpp
index 21162fa449ddd4ce197cb60c9054fd9fa4ab8a83..08f511dd232e19db93101fd8c58cddba74deb761 100644
--- a/sflphone-common/src/iax/iaxvoiplink.cpp
+++ b/sflphone-common/src/iax/iaxvoiplink.cpp
@@ -364,7 +364,7 @@ IAXVoIPLink::sendAudioFromMic (void)
                         nbSampleForRec_ = nbSample_;
 
 
-                        if (ac->getClockRate() && (ac->getClockRate() != _mainBufferSampleRate)) {
+                        if (ac->getClockRate() && ((int) ac->getClockRate() != _mainBufferSampleRate)) {
 
                             // resample
                             nbSample_ = converter->downsampleData (micData , micDataConverted , (int) ac->getClockRate(), _mainBufferSampleRate, nbSample_);
@@ -705,7 +705,7 @@ IAXVoIPLink::sendTextMessage (sfl::InstantMessaging *module,
 
 
 std::string
-IAXVoIPLink::getCurrentCodecName(const CallID& id)
+IAXVoIPLink::getCurrentCodecName(const CallID& /*id*/)
 {
     IAXCall *call = NULL;
     AudioCodec *ac = NULL;
@@ -1028,7 +1028,7 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
 
         // test if resampling is required
 
-        if (ac->getClockRate() && (ac->getClockRate() != _mainBufferSampleRate)) {
+        if (ac->getClockRate() && ((int) ac->getClockRate() != _mainBufferSampleRate)) {
 
             // resample
             nbInt16 = converter->upsampleData (spkrDataDecoded, spkrDataConverted, ac->getClockRate(), _mainBufferSampleRate, nbSample_);
diff --git a/sflphone-common/src/logger.cpp b/sflphone-common/src/logger.cpp
index b4ee5e3c3dc603641d04b6bfd5ab66aab0901a5b..0340287ecda36bf34e0978bb950133ca2ee62dca 100644
--- a/sflphone-common/src/logger.cpp
+++ b/sflphone-common/src/logger.cpp
@@ -29,11 +29,9 @@
  */
 
 #include "logger.h"
-#include <stdarg.h>
+#include <cstdarg>
 #include <string>
-#include <stdio.h>
-
-using namespace std;
+#include <cstdio>
 
 namespace Logger
 {
@@ -43,6 +41,7 @@ bool debugMode = false;
 
 void log (const int level, const char* format, ...)
 {
+    using std::string;
     if (!debugMode && level == LOG_DEBUG)
         return;
 
diff --git a/sflphone-common/src/main.cpp b/sflphone-common/src/main.cpp
index e4052d5fbd64654098c0a00a81da54d952e38e37..6c9d3083d66c1302f1a2ac1c0fa25983564d888e 100644
--- a/sflphone-common/src/main.cpp
+++ b/sflphone-common/src/main.cpp
@@ -33,6 +33,7 @@
 #include <libintl.h>
 #include <cstring>
 #include <iostream>
+#include <memory> // for auto_ptr
 #include <string>
 #include <dirent.h>
 #include <sys/stat.h>
@@ -45,7 +46,6 @@
 
 #include "audio/audiolayer.h"
 
-using namespace std;
 using namespace ost;
 
 CommandOptionArg	level (
@@ -72,19 +72,21 @@ main (int argc, char **argv)
     Logger::setConsoleLog (false);
     Logger::setDebugMode (false);
 
-    CommandOptionParse * args = makeCommandOptionParse (argc, argv, "");
+    // makeCommandOptionParse allocates the object with operator new, so
+    // auto_ptr is fine in this context.
+    // TODO: This should eventually be replaced with std::unique_ptr for C++0x
+    std::auto_ptr<CommandOptionParse> args(makeCommandOptionParse (argc, argv, ""));
 
     printf ("SFLphone Daemon %s, by Savoir-Faire Linux 2004-2011\n", VERSION);
     printf ("http://www.sflphone.org/\n");
 
     if (help.numSet) {
-        cerr << args->printUsage();
+        std::cerr << args->printUsage();
         ::exit (0);
     }
-
-    if (args->argsHaveError()) {
-        cerr << args->printErrors();
-        cerr << args->printUsage();
+    else if (args->argsHaveError()) {
+        std::cerr << args->printErrors();
+        std::cerr << args->printUsage();
         ::exit (1);
     }
 
@@ -98,8 +100,6 @@ main (int argc, char **argv)
         Logger::setDebugMode (true);
     }
 
-    delete args;
-
     FILE *fp;
     char homepid[128];
     char sfldir[128];
diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index 3e6f02419c3be8b498b618d76836dc159a7c38ed..0facee4b3b84b3c7b837bc480b2c8d681a7c6d5c 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -74,9 +74,6 @@
 
 #define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, len)
 
-// Default account used to get default parametersa if requested by client (to build ne account)
-SIPAccount defaultAccount ("default");
-
 ManagerImpl::ManagerImpl (void) :
     _hasTriedToRegister (false), _config(), _currentCallId2(),
     _currentCallMutex(), _codecBuilder (NULL), _audiodriver (NULL),
@@ -1803,7 +1800,7 @@ bool ManagerImpl::incomingCall (Call* call, const AccountID& accountId)
 
         int startIndex = peerNumber.find ("sip:");
 
-        if (startIndex != (int) string::npos) {
+        if (startIndex != (int) std::string::npos) {
             std::string strippedPeerNumber = peerNumber.substr (startIndex + 4);
             call->setPeerNumber (strippedPeerNumber);
         }
@@ -3751,18 +3748,20 @@ std::vector<std::string> ManagerImpl::getAccountList ()
 std::map<std::string, std::string> ManagerImpl::getAccountDetails (
     const AccountID& accountID)
 {
+    // Default account used to get default parameters if requested by client (to build new account)
+    static const SIPAccount DEFAULT_ACCOUNT("default");
 
     Account * account = _accountMap[accountID];
 
     if (accountID.empty()) {
         _debug ("Manager: Returning default account settings");
         // return a default map
-        return defaultAccount.getAccountDetails();
+        return DEFAULT_ACCOUNT.getAccountDetails();
     } else if (account) {
         return account->getAccountDetails();
     } else {
         _debug ("Manager: Get account details on a non-existing accountID %s. Returning default", accountID.c_str());
-        return defaultAccount.getAccountDetails();
+        return DEFAULT_ACCOUNT.getAccountDetails();
     }
 
 }
diff --git a/sflphone-common/src/sip/sdp.cpp b/sflphone-common/src/sip/sdp.cpp
index fe99ba7a5e4ba489ac7d68e1743a3a6365ac575f..797aea0f3625317162298a00825f53781cc8bfc0 100644
--- a/sflphone-common/src/sip/sdp.cpp
+++ b/sflphone-common/src/sip/sdp.cpp
@@ -266,14 +266,14 @@ void Sdp::setTelephoneEventRtpmap(pjmedia_sdp_media *med)
     pjmedia_sdp_attr *attr_fmtp = NULL;
 
     attr_rtpmap = static_cast<pjmedia_sdp_attr *>(pj_pool_zalloc(memPool, sizeof(pjmedia_sdp_attr)));
-    attr_rtpmap->name = pj_str("rtpmap");
-    attr_rtpmap->value = pj_str("101 telephone-event/8000");
+    attr_rtpmap->name = pj_str((char *) "rtpmap");
+    attr_rtpmap->value = pj_str((char *) "101 telephone-event/8000");
 
     med->attr[med->attr_count++] = attr_rtpmap;
 
     attr_fmtp = static_cast<pjmedia_sdp_attr *>(pj_pool_zalloc(memPool, sizeof(pjmedia_sdp_attr)));
-    attr_fmtp->name = pj_str("fmtp");
-    attr_fmtp->value = pj_str("101 0-15");
+    attr_fmtp->name = pj_str((char *) "fmtp");
+    attr_fmtp->value = pj_str((char *) "101 0-15");
 
     med->attr[med->attr_count++] = attr_fmtp;
 }
diff --git a/sflphone-common/src/sip/sipaccount.cpp b/sflphone-common/src/sip/sipaccount.cpp
index 0e7bef541dafddc966c38c3d0c3c6cef57f48570..e1614fce3160d8760eaf3df7ce4dd7441566a999 100644
--- a/sflphone-common/src/sip/sipaccount.cpp
+++ b/sflphone-common/src/sip/sipaccount.cpp
@@ -40,7 +40,9 @@ Credentials::Credentials() : credentialCount (0) {}
 
 Credentials::~Credentials() {}
 
-void Credentials::setNewCredential (std::string username, std::string password, std::string realm)
+void Credentials::setNewCredential (const std::string &username,
+                                    const std::string &password,
+                                    const std::string &realm)
 {
     credentialArray[credentialCount].username = username;
     credentialArray[credentialCount].password = password;
@@ -48,7 +50,7 @@ void Credentials::setNewCredential (std::string username, std::string password,
 
 }
 
-CredentialItem *Credentials::getCredential (int index)
+const CredentialItem *Credentials::getCredential (int index) const
 {
     if ( (index >= 0) && (index < credentialCount))
         return & (credentialArray[index]);
@@ -814,7 +816,7 @@ void SIPAccount::setAccountDetails (const std::map<std::string, std::string>& de
     }
 }
 
-std::map<std::string, std::string> SIPAccount::getAccountDetails()
+std::map<std::string, std::string> SIPAccount::getAccountDetails() const
 {
     std::map<std::string, std::string> a;
 
@@ -1170,12 +1172,12 @@ void SIPAccount::loadConfig()
     Account::loadConfig();
 }
 
-bool SIPAccount::fullMatch (const std::string& username, const std::string& hostname)
+bool SIPAccount::fullMatch (const std::string& username, const std::string& hostname) const
 {
     return (userMatch (username) && hostnameMatch (hostname));
 }
 
-bool SIPAccount::userMatch (const std::string& username)
+bool SIPAccount::userMatch (const std::string& username) const
 {
     if (username.empty()) {
         return false;
@@ -1184,19 +1186,19 @@ bool SIPAccount::userMatch (const std::string& username)
     return (username == getUsername());
 }
 
-bool SIPAccount::hostnameMatch (const std::string& hostname)
+bool SIPAccount::hostnameMatch (const std::string& hostname) const
 {
     return (hostname == getHostname());
 }
 
-std::string SIPAccount::getMachineName (void)
+std::string SIPAccount::getMachineName (void) const
 {
     std::string hostname;
     hostname = std::string (pj_gethostname()->ptr, pj_gethostname()->slen);
     return hostname;
 }
 
-std::string SIPAccount::getLoginName (void)
+std::string SIPAccount::getLoginName (void) const
 {
     std::string username;
 
@@ -1212,7 +1214,7 @@ std::string SIPAccount::getLoginName (void)
     return username;
 }
 
-std::string SIPAccount::getTransportMapKey (void)
+std::string SIPAccount::getTransportMapKey (void) const
 {
 
     std::stringstream out;
@@ -1223,7 +1225,7 @@ std::string SIPAccount::getTransportMapKey (void)
 }
 
 
-std::string SIPAccount::getFromUri (void)
+std::string SIPAccount::getFromUri (void) const
 {
     char uri[PJSIP_MAX_URL_SIZE];
 
@@ -1265,7 +1267,7 @@ std::string SIPAccount::getFromUri (void)
     return std::string (uri, len);
 }
 
-std::string SIPAccount::getToUri (const std::string& username)
+std::string SIPAccount::getToUri (const std::string& username) const
 {
     char uri[PJSIP_MAX_URL_SIZE];
 
@@ -1305,7 +1307,7 @@ std::string SIPAccount::getToUri (const std::string& username)
     return std::string (uri, len);
 }
 
-std::string SIPAccount::getServerUri (void)
+std::string SIPAccount::getServerUri (void) const
 {
     char uri[PJSIP_MAX_URL_SIZE];
 
@@ -1332,7 +1334,7 @@ std::string SIPAccount::getServerUri (void)
     return std::string (uri, len);
 }
 
-std::string SIPAccount::getContactHeader (const std::string& address, const std::string& port)
+std::string SIPAccount::getContactHeader (const std::string& address, const std::string& port) const
 {
     char contact[PJSIP_MAX_URL_SIZE];
     const char * beginquote, * endquote;
diff --git a/sflphone-common/src/sip/sipaccount.h b/sflphone-common/src/sip/sipaccount.h
index 3450ce135cfed3ca0fc251f00be7e219c65a5dc4..4e9cf88e697f46613fc9152da9f4769e463a561b 100644
--- a/sflphone-common/src/sip/sipaccount.h
+++ b/sflphone-common/src/sip/sipaccount.h
@@ -143,15 +143,17 @@ class Credentials : public Serializable
 
         virtual void unserialize (Conf::MappingNode *map);
 
-        int getCredentialCount (void) {
+        int getCredentialCount (void) const {
             return credentialCount;
         }
         void setCredentialCount (int count) {
             credentialCount = count;
         }
 
-        void setNewCredential (std::string username, std::string password, std::string realm);
-        CredentialItem *getCredential (int index);
+        void setNewCredential (const std::string &username,
+                               const std::string &password,
+                               const std::string &realm);
+        const CredentialItem *getCredential (int index) const;
 
     private:
 
@@ -188,19 +190,19 @@ class SIPAccount : public Account
 
         virtual void setAccountDetails (const std::map<std::string, std::string>& details);
 
-        virtual std::map<std::string, std::string> getAccountDetails();
+        virtual std::map<std::string, std::string> getAccountDetails() const;
 
         /**
          * Set route header to appears in sip messages for this account
          */
-        void setRouteSet (std::string route) {
+        void setRouteSet (const std::string &route) {
             _routeSet = route;
         }
 
         /**
          * Get route header to appear in sip messages for this account
          */
-        std::string getRouteSet (void) {
+        std::string getRouteSet (void) const {
             return _routeSet;
         }
 
@@ -225,21 +227,21 @@ class SIPAccount : public Account
          */
         int unregisterVoIPLink();
 
-        inline void setCredInfo (pjsip_cred_info *cred) {
+        void setCredInfo (pjsip_cred_info *cred) {
             _cred = cred;
         }
-        inline pjsip_cred_info *getCredInfo() {
+        pjsip_cred_info *getCredInfo() const {
             return _cred;
         }
 
-        inline std::string& getAuthenticationUsername (void) {
+        const std::string& getAuthenticationUsername (void) const {
             return _authenticationUsername;
         }
-        inline void setAuthenticationUsername (const std::string& username) {
+        void setAuthenticationUsername (const std::string& username) {
             _authenticationUsername = username;
         }
 
-        inline bool isResolveOnce (void) {
+        bool isResolveOnce (void) const {
             return _resolveOnce;
         }
         void setResolveOnce (bool reslv) {
@@ -254,7 +256,7 @@ class SIPAccount : public Account
          *
          * @return A string describing the expiration value.
          */
-        inline std::string& getRegistrationExpire (void) {
+        const std::string& getRegistrationExpire (void) const {
             return _registrationExpire;
         }
 
@@ -263,16 +265,16 @@ class SIPAccount : public Account
          *
          * @param A string describing the expiration value.
          */
-        inline void setRegistrationExpire (std::string expr) {
+        void setRegistrationExpire (const std::string &expr) {
             _registrationExpire = expr;
         }
 
-        bool fullMatch (const std::string& username, const std::string& hostname);
-        bool userMatch (const std::string& username);
-        bool hostnameMatch (const std::string& hostname);
+        bool fullMatch (const std::string& username, const std::string& hostname) const;
+        bool userMatch (const std::string& username) const;
+        bool hostnameMatch (const std::string& hostname) const;
 
         /* Registration flag */
-        bool isRegister() {
+        bool isRegister() const {
             return _bRegister;
         }
         void setRegister (bool result) {
@@ -286,7 +288,7 @@ class SIPAccount : public Account
          * @param void
          * @return pjsip_regc* A pointer to the registration structure
          */
-        pjsip_regc* getRegistrationInfo (void) {
+        pjsip_regc* getRegistrationInfo (void) const {
             return _regc;
         }
 
@@ -306,10 +308,10 @@ class SIPAccount : public Account
          * @param none
          * @return int The number of credentials set for this account.
          */
-        inline int getCredentialCount (void) {
+        int getCredentialCount (void) const {
             return credentials.getCredentialCount() + 1;
         }
-        inline void setCredentialCount (int count) {
+        void setCredentialCount (int count) {
             return credentials.setCredentialCount (count);
         }
 
@@ -318,7 +320,7 @@ class SIPAccount : public Account
          * file, that can be used directly by PJSIP to initialize
          * TLS transport.
          */
-        inline pjsip_tls_setting * getTlsSetting (void) {
+        pjsip_tls_setting * getTlsSetting (void) const {
             return _tlsSetting;
         }
 
@@ -327,14 +329,14 @@ class SIPAccount : public Account
          * file, that can be used directly by PJSIP to initialize
          * an alternate UDP transport.
          */
-        inline std::string getStunServer (void) {
+        std::string getStunServer (void) const {
             return _stunServer;
         }
-        inline void setStunServer (std::string srv) {
+        void setStunServer (const std::string &srv) {
             _stunServer = srv;
         }
 
-        inline pj_str_t getStunServerName (void) {
+        pj_str_t getStunServerName (void) const {
             return _stunServerName;
         }
 
@@ -343,10 +345,10 @@ class SIPAccount : public Account
          * file, that can be used directly by PJSIP to initialize
          * an alternate UDP transport.
          */
-        inline pj_uint16_t getStunPort (void) {
+        pj_uint16_t getStunPort (void) const {
             return _stunPort;
         }
-        inline void setStunPort (pj_uint16_t port) {
+        void setStunPort (pj_uint16_t port) {
             _stunPort = port;
         }
 
@@ -354,7 +356,7 @@ class SIPAccount : public Account
          * @return bool Tells if current transport for that
          * account is set to TLS.
          */
-        inline bool isTlsEnabled (void) {
+        bool isTlsEnabled (void) const {
             return (_transportType == PJSIP_TRANSPORT_TLS) ? true: false;
         }
 
@@ -362,14 +364,14 @@ class SIPAccount : public Account
          * @return bool Tells if current transport for that
          * account is set to OTHER.
          */
-        inline bool isStunEnabled (void) {
+        bool isStunEnabled (void) const {
             return _stunEnabled;
         }
 
         /**
          * Set wether or not stun is enabled for this account
          */
-        inline void setStunEnabled (bool enabl) {
+        void setStunEnabled (bool enabl) {
             _stunEnabled = enabl;
         }
 
@@ -382,7 +384,7 @@ class SIPAccount : public Account
          * of the host on which the UA is running, since these are not logical
          * names."
          */
-        std::string getFromUri (void);
+        std::string getFromUri (void) const;
 
         /*
          * This method adds the correct scheme, hostname and append
@@ -392,7 +394,7 @@ class SIPAccount : public Account
          * @return pj_str_t "To" uri based on @param username
          * @param username A string formatted as : "username"
          */
-        std::string getToUri (const std::string& username);
+        std::string getToUri (const std::string& username) const;
 
         /*
          * In the current version of SFLPhone, "srv" uri is obtained in the preformated
@@ -402,28 +404,28 @@ class SIPAccount : public Account
          * @return pj_str_t "server" uri based on @param hostPort
          * @param hostPort A string formatted as : "hostname:port"
          */
-        std::string getServerUri (void);
+        std::string getServerUri (void) const;
 
         /**
          * @param port Optional port. Otherwise set to the port defined for that account.
          * @param hostname Optional local address. Otherwise set to the hostname defined for that account.
          * @return pj_str_t The contact header based on account information
          */
-        std::string getContactHeader (const std::string& address, const std::string& port);
+        std::string getContactHeader (const std::string& address, const std::string& port) const;
 
         /**
          * Set the interface name on which this account is bound, "default" means
          * that the account is bound to the ANY interafec (0.0.0.0). This method should be
          * when binding the account to a new sip transport only.
          */
-        inline void setLocalInterface (const std::string& interface) {
+        void setLocalInterface (const std::string& interface) {
             _interface = interface;
         }
 
         /**
          * Get the local interface name on which this account is bound.
          */
-        inline std::string getLocalInterface (void) {
+        std::string getLocalInterface (void) const {
             return _interface;
         }
 
@@ -432,7 +434,7 @@ class SIPAccount : public Account
          * IP address and port (_localAddress and _localPort) or to an address set
          * manually (_publishedAddress and _publishedPort).
          */
-        bool getPublishedSameasLocal() {
+        bool getPublishedSameasLocal() const {
             return _publishedSameasLocal;
         }
 
@@ -450,7 +452,7 @@ class SIPAccount : public Account
          * actually using.
          * @return pj_uint16 The port used for that account
          */
-        inline pj_uint16_t getLocalPort (void) {
+        pj_uint16_t getLocalPort (void) const {
             return (pj_uint16_t) _localPort;
         }
 
@@ -458,7 +460,7 @@ class SIPAccount : public Account
          * Set the new port on which this account is running over.
          * @pram port The port used by this account.
          */
-        inline void setLocalPort (pj_uint16_t port) {
+        void setLocalPort (pj_uint16_t port) {
             _localPort = port;
         }
 
@@ -467,7 +469,7 @@ class SIPAccount : public Account
          * for the chosen SIP transport.
          * @return pj_uint16 The port used for that account
          */
-        inline pj_uint16_t getPublishedPort (void) {
+        pj_uint16_t getPublishedPort (void) const {
             return (pj_uint16_t) _publishedPort;
         }
 
@@ -476,7 +478,7 @@ class SIPAccount : public Account
          * for the chosen SIP transport.
          * @pram port The port used by this account.
          */
-        inline void setPublishedPort (pj_uint16_t port) {
+        void setPublishedPort (pj_uint16_t port) {
             _publishedPort = port;
         }
 
@@ -484,7 +486,7 @@ class SIPAccount : public Account
              * Get the local port for TLS listener.
              * @return pj_uint16 The port used for that account
              */
-        inline pj_uint16_t getTlsListenerPort (void) {
+        pj_uint16_t getTlsListenerPort (void) const {
             return (pj_uint16_t) _tlsListenerPort;
         }
 
@@ -492,7 +494,7 @@ class SIPAccount : public Account
          * Set the local port for TLS listener.
          * @pram port The port used for TLS listener.
          */
-        inline void setTlsListenerPort (pj_uint16_t port) {
+        void setTlsListenerPort (pj_uint16_t port) {
             _tlsListenerPort = port;
         }
 
@@ -502,7 +504,7 @@ class SIPAccount : public Account
          * will be used.
          * @return std::string The public IPV4 address formatted in the standard dot notation.
          */
-        inline std::string getPublishedAddress (void) {
+        std::string getPublishedAddress (void) const {
             return _publishedIpAddress;
         }
 
@@ -511,15 +513,15 @@ class SIPAccount : public Account
          * @param The public IPV4 address in the standard dot notation.
          * @return void
          */
-        inline void setPublishedAddress (const std::string& publishedIpAddress) {
+        void setPublishedAddress (const std::string& publishedIpAddress) {
             _publishedIpAddress = publishedIpAddress;
         }
 
-        inline std::string getServiceRoute (void) {
+        std::string getServiceRoute (void) const {
             return _serviceRoute;
         }
 
-        inline void setServiceRoute (std::string route) {
+        void setServiceRoute (const std::string &route) {
             _serviceRoute = route;
         }
 
@@ -527,70 +529,70 @@ class SIPAccount : public Account
          * Get the chosen transport type.
          * @return pjsip_transport_type_e Transport type chosen by the user for this account.
          */
-        inline pjsip_transport_type_e getTransportType (void) {
+        pjsip_transport_type_e getTransportType (void) const {
             return _transportType;
         }
 
-        inline pjsip_transport* getAccountTransport (void) {
+        pjsip_transport* getAccountTransport (void) const {
             return _transport;
         }
 
-        inline void setAccountTransport (pjsip_transport *transport) {
+        void setAccountTransport (pjsip_transport *transport) {
             _transport = transport;
         }
 
-        std::string getTransportMapKey (void);
+        std::string getTransportMapKey (void) const;
 
-        DtmfType getDtmfType (void) {
+        DtmfType getDtmfType (void) const {
             return _dtmfType;
         }
         void setDtmfType (DtmfType type) {
             _dtmfType = type;
         }
 
-        bool getSrtpEnable (void) {
+        bool getSrtpEnable (void) const {
             return _srtpEnabled;
         }
         void setSrtpEnable (bool enabl) {
             _srtpEnabled = enabl;
         }
 
-        std::string getSrtpKeyExchange (void) {
+        std::string getSrtpKeyExchange (void) const {
             return _srtpKeyExchange;
         }
-        void setSrtpKeyExchange (std::string key) {
+        void setSrtpKeyExchange (const std::string &key) {
             _srtpKeyExchange = key;
         }
 
-        bool getSrtpFallback (void) {
+        bool getSrtpFallback (void) const {
             return _srtpFallback;
         }
         void setSrtpFallback (bool fallback) {
             _srtpFallback = fallback;
         }
 
-        bool getZrtpDisplaySas (void) {
+        bool getZrtpDisplaySas (void) const {
             return _zrtpDisplaySas;
         }
         void setZrtpDisplaySas (bool sas) {
             _zrtpDisplaySas = sas;
         }
 
-        bool getZrtpDiaplaySasOnce (void) {
+        bool getZrtpDiaplaySasOnce (void) const {
             return _zrtpDisplaySasOnce;
         }
         void setZrtpDiaplaySasOnce (bool sasonce) {
             _zrtpDisplaySasOnce = sasonce;
         }
 
-        bool getZrtpNotSuppWarning (void) {
+        bool getZrtpNotSuppWarning (void) const {
             return _zrtpNotSuppWarning;
         }
         void setZrtpNotSuppWarning (bool warning) {
             _zrtpNotSuppWarning = warning;
         }
 
-        bool getZrtpHelloHash (void) {
+        bool getZrtpHelloHash (void) const {
             return _zrtpHelloHash;
         }
         void setZrtpHelloHash (bool hellohash) {
@@ -598,101 +600,101 @@ class SIPAccount : public Account
         }
         // void setSrtpKeyExchange
 
-        std::string getRealm (void) {
+        std::string getRealm (void) const {
             return _realm;
         }
-        void setRealm (std::string r) {
+        void setRealm (const std::string &r) {
             _realm = r;
         }
 
-        std::string getTlsEnable (void) {
+        std::string getTlsEnable (void) const {
             return _tlsEnable;
         }
-        void setTlsEnable (std::string enabl) {
+        void setTlsEnable (const std::string &enabl) {
             _tlsEnable = enabl;
         }
 
-        std::string getTlsCaListFile (void) {
+        std::string getTlsCaListFile (void) const {
             return _tlsCaListFile;
         }
-        void setTlsCaListFile (std::string calist) {
+        void setTlsCaListFile (const std::string &calist) {
             _tlsCaListFile = calist;
         }
 
-        std::string getTlsCertificateFile (void) {
+        std::string getTlsCertificateFile (void) const {
             return _tlsCertificateFile;
         }
-        void setTlsCertificateFile (std::string cert) {
+        void setTlsCertificateFile (const std::string &cert) {
             _tlsCertificateFile = cert;
         }
 
-        std::string getTlsPrivateKeyFile (void) {
+        std::string getTlsPrivateKeyFile (void) const {
             return _tlsPrivateKeyFile;
         }
-        void setTlsPrivateKeyFile (std::string priv) {
+        void setTlsPrivateKeyFile (const std::string &priv) {
             _tlsPrivateKeyFile = priv;
         }
 
-        std::string getTlsPassword (void) {
+        std::string getTlsPassword (void) const {
             return _tlsPassword;
         }
-        void setTlsPassword (std::string pass) {
+        void setTlsPassword (const std::string &pass) {
             _tlsPassword = pass;
         }
 
-        std::string getTlsMethod (void) {
+        std::string getTlsMethod (void) const {
             return _tlsMethod;
         }
-        void setTlsMethod (std::string meth) {
+        void setTlsMethod (const std::string &meth) {
             _tlsMethod = meth;
         }
 
-        std::string getTlsCiphers (void) {
+        std::string getTlsCiphers (void) const {
             return _tlsCiphers;
         }
-        void setTlsCiphers (std::string cipher) {
+        void setTlsCiphers (const std::string &cipher) {
             _tlsCiphers = cipher;
         }
 
-        std::string getTlsServerName (void) {
+        std::string getTlsServerName (void) const {
             return _tlsServerName;
         }
-        void setTlsServerName (std::string name) {
+        void setTlsServerName (const std::string &name) {
             _tlsServerName = name;
         }
 
-        bool getTlsVerifyServer (void) {
+        bool getTlsVerifyServer (void) const {
             return _tlsVerifyServer;
         }
         void setTlsVerifyServer (bool verif) {
             _tlsVerifyServer = verif;
         }
 
-        bool getTlsVerifyClient (void) {
+        bool getTlsVerifyClient (void) const {
             return _tlsVerifyClient;
         }
         void setTlsVerifyClient (bool verif) {
             _tlsVerifyClient = verif;
         }
 
-        bool getTlsRequireClientCertificate (void) {
+        bool getTlsRequireClientCertificate (void) const {
             return _tlsRequireClientCertificate;
         }
         void setTlsRequireClientCertificate (bool require) {
             _tlsRequireClientCertificate = require;
         }
 
-        std::string getTlsNegotiationTimeoutSec (void) {
+        std::string getTlsNegotiationTimeoutSec (void) const {
             return _tlsNegotiationTimeoutSec;
         }
-        void setTlsNegotiationTimeoutSec (std::string timeout) {
+        void setTlsNegotiationTimeoutSec (const std::string &timeout) {
             _tlsNegotiationTimeoutSec = timeout;
         }
 
-        std::string getTlsNegotiationTimeoutMsec (void) {
+        std::string getTlsNegotiationTimeoutMsec (void) const {
             return _tlsNegotiationTimeoutMsec;
         }
-        void setTlsNegotiationTimeoutMsec (std::string timeout) {
+        void setTlsNegotiationTimeoutMsec (const std::string &timeout) {
             _tlsNegotiationTimeoutMsec = timeout;
         }
 
@@ -737,7 +739,7 @@ class SIPAccount : public Account
          * onto.
          * @return std::string The machine hostname as returned by pj_gethostname()
          */
-        std::string getMachineName (void);
+        std::string getMachineName (void) const;
 
         /**
          * If username is not provided, as it happens for Direct ip calls,
@@ -745,7 +747,7 @@ class SIPAccount : public Account
          * running this program.
          * @return std::string The login name under which SFLPhone is running.
          */
-        std::string getLoginName (void);
+        std::string getLoginName (void) const;
 
         /**
          * List of routes (proxies) used for registration and calls
diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp
index e8f42747d9f42178d6b306a69f004d93a9abc200..69f52d70a459d1dc212a3279837c308149b913d7 100644
--- a/sflphone-common/src/sip/sipvoiplink.cpp
+++ b/sflphone-common/src/sip/sipvoiplink.cpp
@@ -45,6 +45,7 @@
 #include "dbus/dbusmanager.h"
 #include "dbus/callmanager.h"
 
+#include "hooks/urlhook.h"
 #include "im/InstantMessaging.h"
 
 #include "audio/audiolayer.h"
@@ -59,6 +60,7 @@
 #include <arpa/nameser.h>
 #include <resolv.h>
 #include <istream>
+#include <utility> // for std::pair
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -467,7 +469,7 @@ void SIPVoIPLink::sendRegister (AccountID id) throw(VoipLinkException)
     account->setRegister (true);
 
     // Set the expire value of the message from the config file
-    istringstream stream (account->getRegistrationExpire());
+    std::istringstream stream (account->getRegistrationExpire());
     stream >> expire_value;
 
     if (!expire_value) {
@@ -2380,7 +2382,7 @@ bool SIPVoIPLink::addTransportToMap (std::string key, pjsip_transport* transport
     }
 
     _debug ("UserAgent: Storing newly created transport in map using key %s", key.c_str());
-    _transportMap.insert (pair<std::string, pjsip_transport*> (key, transport));
+    _transportMap.insert (std::pair<std::string, pjsip_transport*> (key, transport));
 
     return true;
 
@@ -3530,11 +3532,11 @@ void sdp_media_update_cb (pjsip_inv_session *inv, pj_status_t status)
 
             call->getAudioRtp()->updateSessionMedia (static_cast<AudioCodec *>(audiocodec));
         }
-    } 
-    catch (exception& rtpException) {
+    }  // FIXME: should this really be std::exception? If so, it should be caught last
+    catch (const std::exception& rtpException) {
         _error ("UserAgent: Exception: %s", rtpException.what());
     } 
-    catch (SdpException &e) {
+    catch (const SdpException &e) {
     	_error("UserAgent: Exception: %s", e.what());
     }
 
@@ -3912,7 +3914,7 @@ transaction_request_cb (pjsip_rx_data *rdata)
                 Manager::instance().hookPreference.getUrlCommand());
             }
         } else
-            throw length_error ("UserAgent: Url exceeds std::string max_size");
+            throw std::length_error ("UserAgent: Url exceeds std::string max_size");
 
     }
 
@@ -4430,7 +4432,7 @@ void transfer_client_cb (pjsip_evsub *sub, pjsip_event *event)
 
         pjsip_rx_data *rdata;
         pjsip_generic_string_hdr *refer_sub;
-        const pj_str_t REFER_SUB = { "Refer-Sub", 9 };
+        const pj_str_t REFER_SUB = { (char *) "Refer-Sub", 9 };
 
  	/* Must be receipt of response message */
         pj_assert(event->type == PJSIP_EVENT_TSX_STATE &&
diff --git a/sflphone-common/src/sip/sipvoiplink.h b/sflphone-common/src/sip/sipvoiplink.h
index 986487e0341611d1944021433ecf5596e5683dd6..66f1eac77b2be1ce7546316d34769e05acdfc74a 100644
--- a/sflphone-common/src/sip/sipvoiplink.h
+++ b/sflphone-common/src/sip/sipvoiplink.h
@@ -36,7 +36,6 @@
 #define SIPVOIPLINK_H
 
 #include <map>
-#include <sstream>
 #include <exception>
 
 //////////////////////////////
@@ -49,8 +48,10 @@
 ///////////////////////////////
 
 #include "voiplink.h"
-#include "hooks/urlhook.h"
-#include "../im/InstantMessaging.h"
+
+namespace sfl {
+    class InstantMessaging;
+}
 
 class EventThread;
 class SIPCall;
diff --git a/sflphone-common/src/video/Makefile.am b/sflphone-common/src/video/Makefile.am
deleted file mode 100644
index b7a60a35b6d3e5f440656a835268f4e42a8f4e13..0000000000000000000000000000000000000000
--- a/sflphone-common/src/video/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-include $(top_srcdir)/globals.mak
-
-SUBDIRS = decoder rtp
-
-AM_CXXFLAGS = $(GSTREAMER_CFLAGS)
-
-noinst_LTLIBRARIES = libvideo.la
-
-libvideo_la_SOURCES = \
-	VideoInputSource.cpp \
-	VideoInputSourceGst.cpp  \
-	VideoEndpoint.cpp \
-	VideoFrame.cpp  \
-	FrameFormat.cpp \
-	VideoDevice.cpp \
-	GstVideoDevice.cpp
-
-libvideo_la_LIBADD = \
-	decoder/libvideodecoder.la \
-	rtp/libvideortp.la
-
-libvideo_la_LDFLAGS = $(GSTREAMER_LIBS) $(LIBS)
-
-noinst_HEADERS = \
-	VideoInputSource.h \
-	VideoInputSourceGst.h \
-	VideoEndpoint.h \
-	FrameFormat.h \
-	VideoDevice.h \
-	VideoFrame.h \
-	FrameFormat.h \
-	VideoDevice.h \
-	GstVideoDevice.h
-					
-
diff --git a/sflphone-common/src/video/decoder/Makefile.am b/sflphone-common/src/video/decoder/Makefile.am
deleted file mode 100644
index 6dbf239905378d107cecb4bd6acef0e015955aad..0000000000000000000000000000000000000000
--- a/sflphone-common/src/video/decoder/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-include $(top_srcdir)/globals.mak
-
-AM_CXXFLAGS = $(LIBAVCODEC_CFLAGS) $(LIBSWSCALE_CFLAGS)
-
-noinst_LTLIBRARIES = libvideodecoder.la
-
-libvideodecoder_la_SOURCES = \
-		H264Decoder.cpp \
-		VideoDecoder.cpp
-		
-noinst_HEADERS = \
-		VideoDecoder.h \
-		H264Decoder.h
-			
-libvideodecoder_la_LDFLAGS = $(LIBAVCODEC_LIBS) $(LIBSWSCALE_LIBS) $(LIBS)
-
-libvideodecoder_la_LIBADD = $(LIBAVCODEC_LIBS) $(LIBSWSCALE_LIBS) $(LIBS)
\ No newline at end of file
diff --git a/sflphone-common/src/voiplink.h b/sflphone-common/src/voiplink.h
index 3c8533f55aade3d2ee5b72012616e5ec19c35b41..5ccbfcf66ca947543fe7092e5dda58a90b2bd472 100644
--- a/sflphone-common/src/voiplink.h
+++ b/sflphone-common/src/voiplink.h
@@ -36,7 +36,6 @@
 
 #include "call.h"
 
-class AudioCodec;
 class Account;
 
 /** Define AccountID type */