diff --git a/sflphone-common/src/account.cpp b/sflphone-common/src/account.cpp
index f5b542f57f34a97b02a1133a674aaa2c1b94bac6..e916ac6875c8c3ce94d1b949fcbd91b4c277e900 100644
--- a/sflphone-common/src/account.cpp
+++ b/sflphone-common/src/account.cpp
@@ -56,7 +56,7 @@ void Account::setRegistrationState (RegistrationState state)
 {
 
     if (state != _registrationState) {
-        _debug ("Account::setRegistrationState\n");
+        _debug ("Account::setRegistrationState");
         _registrationState = state;
 
         // Notify the client
diff --git a/sflphone-common/src/audio/alsa/alsalayer.cpp b/sflphone-common/src/audio/alsa/alsalayer.cpp
index bdbc27ed2d8964c1522d7ca58820f0b5cda6065c..920ab666b3be0e2e0824f8130dc4943e722b0542 100644
--- a/sflphone-common/src/audio/alsa/alsalayer.cpp
+++ b/sflphone-common/src/audio/alsa/alsalayer.cpp
@@ -41,7 +41,7 @@ AlsaLayer::AlsaLayer (ManagerImpl* manager)
         , _audioThread (NULL)
 
 {
-    _debug (" Constructor of AlsaLayer called\n");
+    _debug (" Constructor of AlsaLayer called");
     /* Instanciate the audio thread */
     // _audioThread = new AudioThread (this);
     // _audioThread = NULL;
@@ -53,7 +53,7 @@ AlsaLayer::AlsaLayer (ManagerImpl* manager)
 // Destructor
 AlsaLayer::~AlsaLayer (void)
 {
-    _debug ("Destructor of AlsaLayer called\n");
+    _debug ("Destructor of AlsaLayer called");
     closeLayer();
 
     if (_converter) {
@@ -70,17 +70,17 @@ AlsaLayer::~AlsaLayer (void)
 bool
 AlsaLayer::closeLayer()
 {
-    _debugAlsa ("Close ALSA streams\n");
+    _debugAlsa ("Close ALSA streams");
 
     try {
         /* Stop the audio thread first */
         if (_audioThread) {
-            _debug ("Stop Audio Thread\n");
+            _debug ("Stop Audio Thread");
             delete _audioThread;
             _audioThread=NULL;
         }
     } catch (...) {
-        _debugException ("! ARTP Exception: when stopping audiortp\n");
+        _debugException ("! ARTP Exception: when stopping audiortp");
         throw;
     }
 
@@ -119,13 +119,13 @@ AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize,
 
     _audioPlugin = std::string (plugin);
 
-    _debugAlsa (" Setting AlsaLayer: device     in=%2d, out=%2d\n", _indexIn, _indexOut);
+    _debugAlsa (" Setting AlsaLayer: device     in=%2d, out=%2d", _indexIn, _indexOut);
 
-    _debugAlsa ("                   : alsa plugin=%s\n", _audioPlugin.c_str());
+    _debugAlsa ("                   : alsa plugin=%s", _audioPlugin.c_str());
 
-    _debugAlsa ("                   : nb channel in=%2d, out=%2d\n", _inChannel, _outChannel);
+    _debugAlsa ("                   : nb channel in=%2d, out=%2d", _inChannel, _outChannel);
 
-    _debugAlsa ("                   : sample rate=%5d, format=%s\n", _audioSampleRate, SFLDataFormatString);
+    _debugAlsa ("                   : sample rate=%5d, format=%s", _audioSampleRate, SFLDataFormatString);
 
     _audioThread = NULL;
 
@@ -144,7 +144,7 @@ AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize,
 void
 AlsaLayer::startStream (void)
 {
-    _debug ("AlsaLayer:: startStream\n");
+    _debug ("AlsaLayer:: startStream");
 
     std::string pcmp = buildDeviceTopo (_audioPlugin, _indexOut, 0);
     std::string pcmc = buildDeviceTopo (_audioPlugin, _indexIn, 0);
@@ -171,11 +171,11 @@ AlsaLayer::startStream (void)
 
     if (_audioThread == NULL) {
         try {
-            _debug ("Start Audio Thread\n");
+            _debug ("Start Audio Thread");
             _audioThread = new AudioThread (this);
             _audioThread->start();
         } catch (...) {
-            _debugException ("Fail to start audio thread\n");
+            _debugException ("Fail to start audio thread");
         }
     }
 
@@ -184,17 +184,17 @@ AlsaLayer::startStream (void)
 void
 AlsaLayer::stopStream (void)
 {
-    _debug ("AlsaLayer:: stopStream\n");
+    _debug ("AlsaLayer:: stopStream");
 
     try {
         /* Stop the audio thread first */
         if (_audioThread) {
-            _debug ("Stop Audio Thread\n");
+            _debug ("Stop Audio Thread");
             delete _audioThread;
             _audioThread=NULL;
         }
     } catch (...) {
-        _debugException ("! ARTP Exception: when stopping audiortp\n");
+        _debugException ("! ARTP Exception: when stopping audiortp");
         throw;
     }
 
@@ -228,10 +228,10 @@ void AlsaLayer::stopCaptureStream (void)
     int err;
 
     if (_CaptureHandle) {
-        _debug ("AlsaLayer:: stop Alsa capture\n");
+        _debug ("AlsaLayer:: stop Alsa capture");
 
         if ( (err = snd_pcm_drop (_CaptureHandle)) < 0)
-            _debug ("AlsaLayer:: Error stopping ALSA capture: %s\n", snd_strerror (err));
+            _debug ("AlsaLayer:: Error stopping ALSA capture: %s", snd_strerror (err));
         else
             stop_capture ();
 
@@ -246,10 +246,10 @@ void AlsaLayer::closeCaptureStream (void)
         stopCaptureStream ();
 
     if (is_capture_open()) {
-        _debug ("AlsaLayer:: close ALSA capture\n");
+        _debug ("AlsaLayer:: close ALSA capture");
 
         if ( (err = snd_pcm_close (_CaptureHandle)) < 0)
-            _debug ("Error closing ALSA capture: %s\n", snd_strerror (err));
+            _debug ("Error closing ALSA capture: %s", snd_strerror (err));
         else
             close_capture ();
     }
@@ -260,10 +260,10 @@ void AlsaLayer::startCaptureStream (void)
     int err;
 
     if (_CaptureHandle && !is_capture_running()) {
-        _debug ("AlsaLayer:: start ALSA capture\n");
+        _debug ("AlsaLayer:: start ALSA capture");
 
         if ( (err = snd_pcm_start (_CaptureHandle)) < 0)
-            _debug ("Error starting ALSA capture: %s\n",  snd_strerror (err));
+            _debug ("Error starting ALSA capture: %s",  snd_strerror (err));
         else
             start_capture();
     }
@@ -274,10 +274,10 @@ void AlsaLayer::prepareCaptureStream (void)
     int err;
 
     if (is_capture_open() && !is_capture_prepared()) {
-        _debug ("AlsaLayer:: prepare ALSA capture\n");
+        _debug ("AlsaLayer:: prepare ALSA capture");
 
         if ( (err = snd_pcm_prepare (_CaptureHandle)) < 0)
-            _debug ("Error preparing ALSA capture: %s\n", snd_strerror (err));
+            _debug ("Error preparing ALSA capture: %s", snd_strerror (err));
         else
             prepare_capture ();
     }
@@ -288,10 +288,10 @@ void AlsaLayer::stopPlaybackStream (void)
     int err;
 
     if (_PlaybackHandle && is_playback_running()) {
-        _debug ("AlsaLayer:: stop ALSA playback\n");
+        _debug ("AlsaLayer:: stop ALSA playback");
 
         if ( (err = snd_pcm_drop (_PlaybackHandle)) < 0)
-            _debug ("Error stopping ALSA playback: %s\n", snd_strerror (err));
+            _debug ("Error stopping ALSA playback: %s", snd_strerror (err));
         else
             stop_playback ();
     }
@@ -306,10 +306,10 @@ void AlsaLayer::closePlaybackStream (void)
         stopPlaybackStream ();
 
     if (is_playback_open()) {
-        _debug ("AlsaLayer:: close ALSA playback\n");
+        _debug ("AlsaLayer:: close ALSA playback");
 
         if ( (err = snd_pcm_close (_PlaybackHandle)) < 0)
-            _debug ("Error closing ALSA playback: %s\n", snd_strerror (err));
+            _debug ("Error closing ALSA playback: %s", snd_strerror (err));
         else
             close_playback ();
     }
@@ -320,10 +320,10 @@ void AlsaLayer::startPlaybackStream (void)
     int err;
 
     if (_PlaybackHandle && !is_playback_running()) {
-        _debug ("AlsaLayer:: start ALSA playback\n");
+        _debug ("AlsaLayer:: start ALSA playback");
 
         if ( (err = snd_pcm_start (_PlaybackHandle)) < 0)
-            _debug ("Error starting ALSA playback: %s\n", snd_strerror (err));
+            _debug ("Error starting ALSA playback: %s", snd_strerror (err));
         else
             start_playback();
     }
@@ -334,10 +334,10 @@ void AlsaLayer::preparePlaybackStream (void)
     int err;
 
     if (is_playback_open() && !is_playback_prepared()) {
-        _debug ("AlsaLayer:: prepare playback stream\n");
+        _debug ("AlsaLayer:: prepare playback stream");
 
         if ( (err = snd_pcm_prepare (_PlaybackHandle)) < 0)
-            _debug ("Error preparing the device: %s\n", snd_strerror (err));
+            _debug ("Error preparing the device: %s", snd_strerror (err));
         else
             prepare_playback ();
     }
@@ -350,9 +350,9 @@ void AlsaLayer::recoverPlaybackStream(int error)
     int err;
 
     if (is_playback_open() && is_playback_running()) {
-	_debug("AlsaLayer:: recover playback stream\n");
+	_debug("AlsaLayer:: recover playback stream");
 	if((err = snd_pcm_recover(_PlaybackHandle, error, 0)) < 0 )
-	    _debug("Error recovering the device: %s\n", snd_strerror(err));
+	    _debug("Error recovering the device: %s", snd_strerror(err));
     }
 }
 */
@@ -364,9 +364,9 @@ void AlsaLayer::recoverPlaybackStream(int error)
     int err;
 
     if (is_capture_open() && is_capture_running()) {
-	_debug("AlsaLayer:: recover capture stream\n");
+	_debug("AlsaLayer:: recover capture stream");
 	if((err = snd_pcm_recover(_PlaybackHandle, error, 0)) < 0 )
-	    _debug("Error recovering the device: %s\n", snd_strerror(err));
+	    _debug("Error recovering the device: %s", snd_strerror(err));
     }
 }
 */
@@ -392,12 +392,12 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     /* Full configuration space */
 
     if ( (err = snd_pcm_hw_params_any (pcm_handle, hwparams)) < 0) {
-        _debugAlsa (" Cannot initialize hardware parameter structure (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot initialize hardware parameter structure (%s)", snd_strerror (err));
         return false;
     }
 
     if ( (err = snd_pcm_hw_params_set_access (pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
-        _debugAlsa (" Cannot set access type (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set access type (%s)", snd_strerror (err));
         return false;
     }
 
@@ -405,7 +405,7 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     format = SND_PCM_FORMAT_S16_LE;
 
     if ( (err = snd_pcm_hw_params_set_format (pcm_handle, hwparams, (snd_pcm_format_t) format)) < 0) {
-        _debugAlsa (" Cannot set sample format (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set sample format (%s)", snd_strerror (err));
         return false;
     }
 
@@ -417,17 +417,17 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     exact_ivalue = rate;
 
     if ( (err = snd_pcm_hw_params_set_rate_near (pcm_handle, hwparams, &exact_ivalue, &dir) < 0)) {
-        _debugAlsa (" Cannot set sample rate (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set sample rate (%s)", snd_strerror (err));
         return false;
     }
 
     if (dir!= 0) {
-        _debugAlsa (" (%i) The choosen rate %d Hz is not supported by your hardware.\nUsing %d Hz instead.\n ",type ,rate, exact_ivalue);
+        _debugAlsa (" (%i) The choosen rate %d Hz is not supported by your hardware.Using %d Hz instead. ",type ,rate, exact_ivalue);
     }
 
     /* Set the number of channels */
     if ( (err = snd_pcm_hw_params_set_channels (pcm_handle, hwparams, 1)) < 0) {
-        _debugAlsa (" Cannot set channel count (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set channel count (%s)", snd_strerror (err));
         return false;
     }
 
@@ -437,12 +437,12 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     dir=0;
 
     if ( (err = snd_pcm_hw_params_set_period_size_near (pcm_handle, hwparams, &exact_lvalue , &dir)) < 0) {
-        _debugAlsa (" Cannot set period time (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set period time (%s)", snd_strerror (err));
         return false;
     }
 
     if (dir!=0) {
-        _debugAlsa ("(%i) The choosen period size %d bytes is not supported by your hardware.\nUsing %d instead.\n ", type, (int) periodsize, (int) exact_lvalue);
+        _debugAlsa ("(%i) The choosen period size %d bytes is not supported by your hardware.Using %d instead. ", type, (int) periodsize, (int) exact_lvalue);
     }
 
     periodsize = exact_lvalue;
@@ -453,12 +453,12 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     dir=0;
 
     if ( (err = snd_pcm_hw_params_set_periods_near (pcm_handle, hwparams, &exact_ivalue, &dir)) < 0) {
-        _debugAlsa (" Cannot set periods number (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set periods number (%s)", snd_strerror (err));
         return false;
     }
 
     if (dir!=0) {
-        _debugAlsa (" The choosen period number %i bytes is not supported by your hardware.\nUsing %i instead.\n ", periods, exact_ivalue);
+        _debugAlsa (" The choosen period number %i bytes is not supported by your hardware.Using %i instead. ", periods, exact_ivalue);
     }
 
     periods=exact_ivalue;
@@ -466,7 +466,7 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     /* Set the hw parameters */
 
     if ( (err = snd_pcm_hw_params (pcm_handle, hwparams)) < 0) {
-        _debugAlsa (" Cannot set hw parameters (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set hw parameters (%s)", snd_strerror (err));
         return false;
     }
 
@@ -479,12 +479,12 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
     /* Set the start threshold */
 
     if ( (err = snd_pcm_sw_params_set_start_threshold (pcm_handle, swparams, 2700 /*periodsize*2*/)) < 0) {
-        _debugAlsa (" Cannot set start threshold (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set start threshold (%s)", snd_strerror (err));
         return false;
     }
 
     if ( (err = snd_pcm_sw_params (pcm_handle, swparams)) < 0) {
-        _debugAlsa (" Cannot set sw parameters (%s)\n", snd_strerror (err));
+        _debugAlsa (" Cannot set sw parameters (%s)", snd_strerror (err));
         return false;
     }
 
@@ -503,18 +503,18 @@ AlsaLayer::open_device (std::string pcm_p, std::string pcm_c, int flag)
 
     if (flag == SFL_PCM_BOTH || flag == SFL_PCM_PLAYBACK) {
 
-        _debug ("AlsaLayer:: open playback device\n");
+        _debug ("AlsaLayer:: open playback device");
         // if((err = snd_pcm_open(&_PlaybackHandle, pcm_p.c_str(),  SND_PCM_STREAM_PLAYBACK, 0 )) < 0){
 
         if ( (err = snd_pcm_open (&_PlaybackHandle, pcm_p.c_str(),  SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
-            _debugAlsa ("Error while opening playback device %s\n",  pcm_p.c_str());
+            _debugAlsa ("Error while opening playback device %s",  pcm_p.c_str());
             setErrorMessage (ALSA_PLAYBACK_DEVICE);
             close_playback ();
             return false;
         }
 
         if (!alsa_set_params (_PlaybackHandle, 1, getSampleRate())) {
-            _debug ("playback failed\n");
+            _debug ("playback failed");
             snd_pcm_close (_PlaybackHandle);
             close_playback ();
             return false;
@@ -525,17 +525,17 @@ AlsaLayer::open_device (std::string pcm_p, std::string pcm_c, int flag)
 
     if (flag == SFL_PCM_BOTH || flag == SFL_PCM_CAPTURE) {
 
-        _debug ("AlsaLayer:: open capture device\n");
+        _debug ("AlsaLayer:: open capture device");
 
         if ( (err = snd_pcm_open (&_CaptureHandle,  pcm_c.c_str(),  SND_PCM_STREAM_CAPTURE, 0)) < 0) {
-            _debugAlsa ("Error while opening capture device %s\n",  pcm_c.c_str());
+            _debugAlsa ("Error while opening capture device %s",  pcm_c.c_str());
             setErrorMessage (ALSA_CAPTURE_DEVICE);
             close_capture ();
             return false;
         }
 
         if (!alsa_set_params (_CaptureHandle, 0, 8000)) {
-            _debug ("capture failed\n");
+            _debug ("capture failed");
             snd_pcm_close (_CaptureHandle);
             close_capture ();
             return false;
@@ -551,7 +551,7 @@ AlsaLayer::open_device (std::string pcm_p, std::string pcm_c, int flag)
     try {
         _audioThread->start();
     } catch (...) {
-        _debugException ("Fail to start audio thread\n");
+        _debugException ("Fail to start audio thread");
     }
     */
 
@@ -579,18 +579,18 @@ AlsaLayer::write (void* buffer, int length)
             case -ESTRPIPE:
 
             case -EIO:
-                //_debugAlsa(" XRUN playback ignored (%s)\n", snd_strerror(err));
+                //_debugAlsa(" XRUN playback ignored (%s)", snd_strerror(err));
                 handle_xrun_playback();
 
                 if (snd_pcm_writei (_PlaybackHandle , buffer , frames) <0)
-                    _debugAlsa ("XRUN handling failed\n");
+                    _debugAlsa ("XRUN handling failed");
 
                 _trigger_request = true;
 
                 break;
 
             default:
-                _debugAlsa ("Write error unknown - dropping frames **********************************: %s\n", snd_strerror (err));
+                _debugAlsa ("Write error unknown - dropping frames **********************************: %s", snd_strerror (err));
 
                 stopPlaybackStream ();
 
@@ -623,20 +623,20 @@ AlsaLayer::read (void* buffer, int toCopy)
             case -ESTRPIPE:
 
             case -EIO:
-                _debugAlsa (" XRUN capture ignored (%s)\n", snd_strerror (samples));
+                _debugAlsa (" XRUN capture ignored (%s)", snd_strerror (samples));
                 handle_xrun_capture();
                 //samples = snd_pcm_readi( _CaptureHandle, buffer, frames);
                 //if (samples<0)  samples=0;
                 break;
 
             case EPERM:
-                _debugAlsa (" Capture EPERM (%s)\n", snd_strerror (samples));
+                _debugAlsa (" Capture EPERM (%s)", snd_strerror (samples));
                 prepareCaptureStream ();
                 startCaptureStream ();
                 break;
 
             default:
-                //_debugAlsa("%s\n", snd_strerror(samples));
+                //_debugAlsa("%s", snd_strerror(samples));
                 break;
         }
 
@@ -650,7 +650,7 @@ AlsaLayer::read (void* buffer, int toCopy)
 void
 AlsaLayer::handle_xrun_capture (void)
 {
-    _debugAlsa ("handle_xrun_capture\n");
+    _debugAlsa ("handle_xrun_capture");
 
     snd_pcm_status_t* status;
     snd_pcm_status_alloca (&status);
@@ -664,19 +664,19 @@ AlsaLayer::handle_xrun_capture (void)
             startCaptureStream ();
         }
     } else
-        _debugAlsa (" Get status failed\n");
+        _debugAlsa (" Get status failed");
 }
 
 void
 AlsaLayer::handle_xrun_playback (void)
 {
-    _debugAlsa ("AlsaLayer:: handle_xrun_playback\n");
+    _debugAlsa ("AlsaLayer:: handle_xrun_playback");
 
     int state;
     snd_pcm_status_t* status;
     snd_pcm_status_alloca (&status);
 
-    if ( (state = snd_pcm_status (_PlaybackHandle, status)) < 0)   _debugAlsa (" Error: Cannot get playback handle status (%s)\n" , snd_strerror (state));
+    if ( (state = snd_pcm_status (_PlaybackHandle, status)) < 0)   _debugAlsa (" Error: Cannot get playback handle status (%s)" , snd_strerror (state));
     else {
         state = snd_pcm_status_get_state (status);
 
@@ -743,9 +743,9 @@ AlsaLayer::getSoundCardsInfo (int stream)
                 snd_pcm_info_set_device (pcminfo , 0);
                 snd_pcm_info_set_stream (pcminfo, (stream == SFL_PCM_CAPTURE) ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK);
 
-                if (snd_ctl_pcm_info (handle ,pcminfo) < 0) _debugAlsa (" Cannot get info\n");
+                if (snd_ctl_pcm_info (handle ,pcminfo) < 0) _debugAlsa (" Cannot get info");
                 else {
-                    _debugAlsa ("card %i : %s [%s]\n",
+                    _debugAlsa ("card %i : %s [%s]",
                                 numCard,
                                 snd_ctl_card_info_get_id (info),
                                 snd_ctl_card_info_get_name (info));
@@ -825,7 +825,7 @@ void AlsaLayer::audioCallback (void)
 
     /*
     int writeableSize = snd_pcm_avail_update(_PlaybackHandle);
-    _debug("writeableSize %i\n", writeableSize);
+    _debug("writeableSize %i", writeableSize);
     */
 
     // AvailForGet tell the number of chars inside the buffer
@@ -970,7 +970,7 @@ void AlsaLayer::audioCallback (void)
     if (is_capture_running()) {
 
         micAvailBytes = snd_pcm_avail_update (_CaptureHandle);
-        // _debug("micAvailBytes %i\n", micAvailBytes);
+        // _debug("micAvailBytes %i", micAvailBytes);
 
         if (micAvailBytes > 0) {
             micAvailPut = getMainBuffer()->availForPut();
@@ -990,7 +990,7 @@ void AlsaLayer::audioCallback (void)
                     int nbSample = toPut / sizeof (SFLDataFormat);
                     int nb_sample_up = nbSample;
 
-                    // _debug("nb_sample_up %i\n", nb_sample_up);
+                    // _debug("nb_sample_up %i", nb_sample_up);
                     nbSample = _converter->downsampleData ( (SFLDataFormat*) in, rsmpl_out, _mainBufferSampleRate, _audioSampleRate, nb_sample_up);
 
                     dcblocker->filter_signal (rsmpl_out, nbSample);
@@ -1010,7 +1010,7 @@ void AlsaLayer::audioCallback (void)
 
             in=0;
         } else if (micAvailBytes < 0) {
-            _debug ("AlsaLayer::audioCallback (mic): error: %s\n", snd_strerror (micAvailBytes));
+            _debug ("AlsaLayer::audioCallback (mic): error: %s", snd_strerror (micAvailBytes));
         }
 
     }
diff --git a/sflphone-common/src/audio/audiolayer.cpp b/sflphone-common/src/audio/audiolayer.cpp
index 0687dfa3b4c8e99c8e813ff6bcad52a32c647e21..e0a84d48481a1514b163a5824840f442517ffdbc 100644
--- a/sflphone-common/src/audio/audiolayer.cpp
+++ b/sflphone-common/src/audio/audiolayer.cpp
@@ -40,7 +40,7 @@ void AudioLayer::flushUrgent (void)
 
 int AudioLayer::putUrgent (void* buffer, int toCopy)
 {
-    _debug ("------------------- AudioLayer::putUrgent --------------------\n");
+    _debug ("------------------- AudioLayer::putUrgent --------------------");
     int a;
 
     ost::MutexLock guard (_mutex);
@@ -65,7 +65,7 @@ int AudioLayer::putMain (void *buffer, int toCopy, CallID call_id)
     if (a >= toCopy) {
         return getMainBuffer()->putData (buffer, toCopy, _defaultVolume, call_id);
     } else {
-        _debug ("Chopping sound, Ouch! RingBuffer full ?\n");
+        _debug ("Chopping sound, Ouch! RingBuffer full ?");
         return getMainBuffer()->putData (buffer, a, _defaultVolume, call_id);
     }
 
diff --git a/sflphone-common/src/audio/audiortp.cpp b/sflphone-common/src/audio/audiortp.cpp
index 3887a21f63d18b7f8a5647526fa4efaadef3e942..26615888a789d5b863c2a3e9f284fca381e2b458 100644
--- a/sflphone-common/src/audio/audiortp.cpp
+++ b/sflphone-common/src/audio/audiortp.cpp
@@ -68,14 +68,14 @@ AudioRtp::createNewSession (SIPCall *ca)
 
     ost::MutexLock m (_rtpMutex);
 
-    _debug ("AudioRtp::Create new rtp session\n");
+    _debug ("AudioRtp::Create new rtp session");
 
     // something should stop the thread before...
 
     if (_RTXThread != 0) {
-        _debug ("**********************************************************\n");
-        _debug ("! ARTP Failure: Thread already exists..., stopping it\n");
-        _debug ("**********************************************************\n");
+        _debug ("**********************************************************");
+        _debug ("! ARTP Failure: Thread already exists..., stopping it");
+        _debug ("**********************************************************");
         delete _RTXThread;
         _RTXThread = 0;
     }
@@ -93,14 +93,14 @@ AudioRtp::start (void)
     ost::MutexLock m (_rtpMutex);
 
     if (_RTXThread == 0) {
-        _debug ("! ARTP Failure: Cannot start audiortp thread since not yet created\n");
+        _debug ("! ARTP Failure: Cannot start audiortp thread since not yet created");
         throw AudioRtpException();
     }
 
 
     try {
         if (_RTXThread->start() != 0) {
-            _debug ("! ARTP Failure: unable to start RTX Thread\n");
+            _debug ("! ARTP Failure: unable to start RTX Thread");
             return -1;
         }
     } catch (...) {
@@ -118,7 +118,7 @@ AudioRtp::closeRtpSession ()
 
     ost::MutexLock m (_rtpMutex);
     // This will make RTP threads finish.
-    _debug ("AudioRtp::Stopping rtp session\n");
+    _debug ("AudioRtp::Stopping rtp session");
 
     try {
         if (_RTXThread != 0) {
@@ -126,11 +126,11 @@ AudioRtp::closeRtpSession ()
             _RTXThread = 0;
         }
     } catch (...) {
-        _debugException ("! ARTP Exception: when stopping audiortp\n");
+        _debugException ("! ARTP Exception: when stopping audiortp");
         throw;
     }
 
-    _debug ("AudioRtp::Audio rtp stopped\n");
+    _debug ("AudioRtp::Audio rtp stopped");
 
     return true;
 }
@@ -140,7 +140,7 @@ void
 AudioRtp::setRecording()
 {
 
-    _debug ("AudioRtp::setRecording\n");
+    _debug ("AudioRtp::setRecording");
     _RTXThread->_ca->setRecording();
 
 }
@@ -161,7 +161,7 @@ AudioRtpRTX::AudioRtpRTX (SIPCall *sipcall, bool sym) : time (new ost::Time()),
     std::string localipConfig = _ca->getLocalIp(); // _ca->getLocalIp();
     ost::InetHostAddress local_ip (localipConfig.c_str());
 
-    _debug ("%i\n", _ca->getLocalAudioPort());
+    _debug ("%i", _ca->getLocalAudioPort());
     _session = new ost::SymmetricRTPSession (local_ip, _ca->getLocalAudioPort());
     // _session = new ost::RTPSessionBase(local_ip, _ca->getLocalAudioPort());
     _sessionRecv = NULL;
@@ -209,7 +209,7 @@ AudioRtpRTX::~AudioRtpRTX ()
 
     ost::MutexLock m (_rtpRtxMutex);
 
-    _debug ("Delete AudioRtpRTX instance in callid %s\n", _ca->getCallId().c_str());
+    _debug ("Delete AudioRtpRTX instance in callid %s", _ca->getCallId().c_str());
 
     try {
         this->terminate();
@@ -218,12 +218,12 @@ AudioRtpRTX::~AudioRtpRTX ()
         throw;
     }
 
-    _debug ("Remove audio stream for call id %s\n", _ca->getCallId().c_str());
+    _debug ("Remove audio stream for call id %s", _ca->getCallId().c_str());
 
     _audiolayer->getMainBuffer()->unBindAll (_ca->getCallId());
     // Manager::instance().removeStream(_ca->getCallId());
 
-    _debug ("DELETE print micData address %p\n", micData);
+    _debug ("DELETE print micData address %p", micData);
     delete [] micData;
     micData = NULL;
     delete [] micDataConverted;
@@ -248,7 +248,7 @@ AudioRtpRTX::~AudioRtpRTX ()
     delete _session;
     _session = NULL;
 
-    _debug ("AudioRtpRTX instance deleted\n");
+    _debug ("AudioRtpRTX instance deleted");
 
     rtp_input_rec->close();
     rtp_output_rec->close();
@@ -261,17 +261,17 @@ AudioRtpRTX::initBuffers()
 {
     ost::MutexLock m (_rtpRtxMutex);
 
-    _debug ("AudioRtpRTX::initBuffers Init RTP buffers for %s\n", _ca->getCallId().c_str());
+    _debug ("AudioRtpRTX::initBuffers Init RTP buffers for %s", _ca->getCallId().c_str());
 
     converter = new SamplerateConverter (_layerSampleRate , _layerFrameSize);
 
     nbSamplesMax = (int) (_layerSampleRate * _layerFrameSize /1000);
 
 
-    _debug ("AudioRtpRTX::initBuffers NBSAMPLEMAX %i\n", nbSamplesMax);
+    _debug ("AudioRtpRTX::initBuffers NBSAMPLEMAX %i", nbSamplesMax);
 
     micData = new SFLDataFormat[nbSamplesMax];
-    _debug ("CREATE print micData address %p\n", micData);
+    _debug ("CREATE print micData address %p", micData);
     micDataConverted = new SFLDataFormat[nbSamplesMax];
     micDataEncoded = new unsigned char[nbSamplesMax];
 
@@ -305,7 +305,7 @@ AudioRtpRTX::setRtpSessionMedia (void)
 {
 
     if (_ca == 0) {
-        _debug (" !ARTP: No call, can't init RTP media\n");
+        _debug (" !ARTP: No call, can't init RTP media");
         return;
     }
 
@@ -314,11 +314,11 @@ AudioRtpRTX::setRtpSessionMedia (void)
     _audiocodec = Manager::instance().getCodecDescriptorMap().instantiateCodec (pl);
 
     if (_audiocodec == NULL) {
-        _debug (" !ARTP: No audiocodec, can't init RTP media\n");
+        _debug (" !ARTP: No audiocodec, can't init RTP media");
         return;
     }
 
-    _debug ("Init audio RTP session: codec payload %i\n", _audiocodec->getPayload());
+    _debug ("Init audio RTP session: codec payload %i", _audiocodec->getPayload());
 
     // _audioCodecInstance = *_audiocodec;
 
@@ -344,34 +344,34 @@ AudioRtpRTX::setRtpSessionRemoteIp (void)
 
     if (!_remoteIpIsSet) {
 
-        _debug ("++++++++++++++++++++++++++ SET IP ADDRESS ++++++++++++++++++++++++++++\n");
+        _debug ("++++++++++++++++++++++++++ SET IP ADDRESS ++++++++++++++++++++++++++++");
 
         if (_ca == 0) {
-            _debug (" !ARTP: No call, can't init RTP media \n");
+            _debug (" !ARTP: No call, can't init RTP media ");
             return;
         }
 
         ost::InetHostAddress remote_ip (_ca->getLocalSDP()->get_remote_ip().c_str());
 
-        _debug ("Init audio RTP session: remote ip %s\n", _ca->getLocalSDP()->get_remote_ip().data());
+        _debug ("Init audio RTP session: remote ip %s", _ca->getLocalSDP()->get_remote_ip().data());
 
         if (!remote_ip) {
-            _debug (" !ARTP Thread Error: Target IP address [%s] is not correct!\n", _ca->getLocalSDP()->get_remote_ip().data());
+            _debug (" !ARTP Thread Error: Target IP address [%s] is not correct!", _ca->getLocalSDP()->get_remote_ip().data());
             return;
         }
 
-        _debug ("++++Address: %s, audioport: %d\n", _ca->getLocalSDP()->get_remote_ip().c_str(), _ca->getLocalSDP()->get_remote_audio_port());
+        _debug ("++++Address: %s, audioport: %d", _ca->getLocalSDP()->get_remote_ip().c_str(), _ca->getLocalSDP()->get_remote_audio_port());
 
-        _debug ("++++Audioport: %d\n", (int) _ca->getLocalSDP()->get_remote_audio_port());
+        _debug ("++++Audioport: %d", (int) _ca->getLocalSDP()->get_remote_audio_port());
 
         if (!_session->addDestination (remote_ip, (unsigned short) _ca->getLocalSDP()->get_remote_audio_port())) {
-            _debug (" !ARTP Thread Error: can't add destination to session!\n");
+            _debug (" !ARTP Thread Error: can't add destination to session!");
             return;
         }
 
         _remoteIpIsSet = true;
     } else {
-        _debug ("+++++++++++++++++++++++ IP ADDRESS ALREADY SET ++++++++++++++++++++++++\n");
+        _debug ("+++++++++++++++++++++++ IP ADDRESS ALREADY SET ++++++++++++++++++++++++");
     }
 
 }
@@ -404,23 +404,23 @@ AudioRtpRTX::processDataEncode()
     // available bytes inside ringbuffer
     int availBytesFromMic = _audiolayer->getMainBuffer()->availForGet (_ca->getCallId());
 
-    // _debug("AudioRtpRTX::processDataEncode() callid: %s availBytesFromMic %i\n", _ca->getCallId().c_str(), availBytesFromMic);
+    // _debug("AudioRtpRTX::processDataEncode() callid: %s availBytesFromMic %i", _ca->getCallId().c_str(), availBytesFromMic);
 
-    // _debug("AudioRtpRTX::processDataEncode: availBytesFromMic: %i\n", availBytesFromMic);
+    // _debug("AudioRtpRTX::processDataEncode: availBytesFromMic: %i", availBytesFromMic);
     // set available byte to maxByteToGet
     int bytesAvail = (availBytesFromMic < maxBytesToGet) ? availBytesFromMic : maxBytesToGet;
-    // _debug("bytesAvail %i\n", bytesAvail);
+    // _debug("bytesAvail %i", bytesAvail);
 
     if (bytesAvail == 0)
         return 0;
 
-    // _debug("AudioRtpRTX::processDataEncode: bytesAvail: %i\n", bytesAvail);
+    // _debug("AudioRtpRTX::processDataEncode: bytesAvail: %i", bytesAvail);
     // Get bytes from micRingBuffer to data_from_mic
     int nbSample = _audiolayer->getMainBuffer()->getData (micData , bytesAvail, 100, _ca->getCallId()) / sizeof (SFLDataFormat);
 
     rtp_output_rec->write ( (char*) micData, bytesAvail);
 
-    // _debug("AudioRtpRTX::processDataEncode: nbSample: %i\n", nbSample);
+    // _debug("AudioRtpRTX::processDataEncode: nbSample: %i", nbSample);
 
     // nb bytes to be sent over RTP
     int compSize = 0;
@@ -429,7 +429,7 @@ AudioRtpRTX::processDataEncode()
     if (_audiocodec->getClockRate() != _layerSampleRate) {
 
         int nb_sample_up = nbSample;
-        //_debug("_nbSample audiolayer->getMic(): %i \n", nbSample);
+        //_debug("_nbSample audiolayer->getMic(): %i ", nbSample);
 
         // Store the length of the mic buffer in samples for recording
         _nSamplesMic = nbSample;
@@ -514,18 +514,18 @@ AudioRtpRTX::sendSessionFromMic (int timestamp)
     // no call, so we do nothing
 
     if (_ca==0) {
-        _debug (" !ARTP: No call associated (mic)\n");
+        _debug (" !ARTP: No call associated (mic)");
         return;
     }
 
     // AudioLayer* audiolayer = Manager::instance().getAudioDriver();
     if (!_audiolayer) {
-        _debug (" !ARTP: No audiolayer available for MIC\n");
+        _debug (" !ARTP: No audiolayer available for MIC");
         return;
     }
 
     if (!_audiocodec) {
-        _debug (" !ARTP: No audiocodec available for MIC\n");
+        _debug (" !ARTP: No audiocodec available for MIC");
         return;
     }
 
@@ -534,7 +534,7 @@ AudioRtpRTX::sendSessionFromMic (int timestamp)
     int compSize = processDataEncode();
 
     // putData put the data on RTP queue, sendImmediate bypass this queue
-    // _debug("AudioRtpRTX::sendSessionFromMic: timestamp: %i, compsize: %i\n", timestamp, compSize);
+    // _debug("AudioRtpRTX::sendSessionFromMic: timestamp: %i, compsize: %i", timestamp, compSize);
 
     if ( (compSize != 0) && (micDataEncoded != NULL))
         _session->putData (timestamp, micDataEncoded, compSize);
@@ -554,12 +554,12 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
     }
 
     if (!_audiolayer) {
-        _debug (" !ARTP: No audiolayer available for SPEAKER\n");
+        _debug (" !ARTP: No audiolayer available for SPEAKER");
         return;
     }
 
     if (!_audiocodec) {
-        _debug (" !ARTP: No audiocodec available for SPEAKER\n");
+        _debug (" !ARTP: No audiocodec available for SPEAKER");
         return;
     }
 
@@ -638,12 +638,12 @@ AudioRtpRTX::run ()
 
     int timestamp = _session->getCurrentTimestamp(); // for mic
 
-    _debug ("- ARTP Action: Start call %s\n",_ca->getCallId().c_str());
+    _debug ("- ARTP Action: Start call %s",_ca->getCallId().c_str());
 
     while (!testCancel()) {
 
 
-        // _debug("Main while loop for call: %s\n", _ca->getCallId().c_str());
+        // _debug("Main while loop for call: %s", _ca->getCallId().c_str());
         // Send session
         sessionWaiting = _session->isWaiting();
 
@@ -676,7 +676,7 @@ AudioRtpRTX::run ()
     }
 
     // _audiolayer->stopStream();
-    _debug ("- ARTP Action: Stop call %s\n",_ca->getCallId().c_str());
+    _debug ("- ARTP Action: Stop call %s",_ca->getCallId().c_str());
 
 
 }
diff --git a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp
index 6785f286e9710b79535442be38f9462dbd954203..bf9a9bf6c8c1da002985e772557db9f8f5852cba 100644
--- a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp
+++ b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp
@@ -60,7 +60,7 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca)
 
     if (_rtpSession != NULL) {
         _debugException ("An audio rtp thread was already created but not" \
-                         "destroyed. Forcing it before continuing.\n");
+                         "destroyed. Forcing it before continuing.");
         stop();
     }
 
@@ -75,16 +75,16 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca)
     if (accountId == AccountNULL) {
         srtpEnabled = Manager::instance().getConfigBool (IP2IP_PROFILE, SRTP_ENABLE);
         keyExchangeProtocol = Manager::instance().getConfigInt (IP2IP_PROFILE, SRTP_KEY_EXCHANGE);
-        _debug ("Ip-to-ip profile selected with key exchange protocol number %d\n", keyExchangeProtocol);
+        _debug ("Ip-to-ip profile selected with key exchange protocol number %d", keyExchangeProtocol);
         helloHashEnabled = Manager::instance().getConfigBool (IP2IP_PROFILE, ZRTP_HELLO_HASH);
     } else {
         srtpEnabled = Manager::instance().getConfigBool (accountId, SRTP_ENABLE);
         keyExchangeProtocol = Manager::instance().getConfigInt (accountId, SRTP_KEY_EXCHANGE);
-        _debug ("Registered account %s profile selected with key exchange protocol number %d\n", accountId.c_str(), keyExchangeProtocol);
+        _debug ("Registered account %s profile selected with key exchange protocol number %d", accountId.c_str(), keyExchangeProtocol);
         helloHashEnabled = Manager::instance().getConfigBool (accountId, ZRTP_HELLO_HASH);
     }
 
-    _debug ("Srtp enable: %d \n", srtpEnabled);
+    _debug ("Srtp enable: %d ", srtpEnabled);
 
     if (srtpEnabled) {
         std::string zidFilename (Manager::instance().getConfigString (SIGNALISATION, ZRTP_ZIDFILE));
@@ -99,7 +99,7 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca)
                     // TODO: be careful with that. The hello hash is computed asynchronously. Maybe it's
                     // not even available at that point.
                     ca->getLocalSDP()->set_zrtp_hash (static_cast<AudioZrtpSession *> (_rtpSession)->getHelloHash());
-                    _debug ("Zrtp hello hash fed to SDP\n");
+                    _debug ("Zrtp hello hash fed to SDP");
                 }
 
                 break;
@@ -112,7 +112,7 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca)
     } else {
         _rtpSessionType = Symmetric;
         _rtpSession = new AudioSymmetricRtpSession (&Manager::instance(), ca);
-        _debug ("Starting a symmetric unencrypted rtp session\n");
+        _debug ("Starting a symmetric unencrypted rtp session");
     }
 }
 
@@ -127,7 +127,7 @@ void AudioRtpFactory::start (void)
         case Sdes:
 
         case Symmetric:
-            _debug ("Starting symmetric rtp thread\n");
+            _debug ("Starting symmetric rtp thread");
 
             if (static_cast<AudioSymmetricRtpSession *> (_rtpSession)->startRtpThread() != 0) {
                 throw AudioRtpFactoryException ("Failed to start AudioSymmetricRtpSession thread");
@@ -148,7 +148,7 @@ void AudioRtpFactory::start (void)
 void AudioRtpFactory::stop (void)
 {
     ost::MutexLock mutex (_audioRtpThreadMutex);
-    _debug ("Stopping audio rtp session\n");
+    _debug ("Stopping audio rtp session");
 
     if (_rtpSession == NULL) {
         _debugException ("_rtpSession is null when trying to stop. Returning.");
@@ -171,7 +171,7 @@ void AudioRtpFactory::stop (void)
 
         _rtpSession = NULL;
     } catch (...) {
-        _debugException ("Exception caught when stopping the audio rtp session\n");
+        _debugException ("Exception caught when stopping the audio rtp session");
         throw AudioRtpFactoryException();
     }
 }
diff --git a/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp
index cec4dd3ff75d4d06e74bb157b4b54a4e0a971c60..cdd2a118214f2d23c1409b6797a2226fac74101e 100644
--- a/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp
+++ b/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp
@@ -36,7 +36,7 @@ AudioZrtpSession::AudioZrtpSession (ManagerImpl * manager, SIPCall * sipcall, co
         AudioRtpSession<AudioZrtpSession> (manager, sipcall),
         _zidFilename (zidFilename)
 {
-    _debug ("AudioZrtpSession initialized\n");
+    _debug ("AudioZrtpSession initialized");
     initializeZid();
     startZrtp();
 }
@@ -54,24 +54,24 @@ void AudioZrtpSession::initializeZid (void)
 
     std::string xdg_config = std::string (HOMEDIR) + DIR_SEPARATOR_STR + ".cache" + DIR_SEPARATOR_STR + PROGDIR + "/" + _zidFilename;
 
-    _debug ("    xdg_config %s\n", xdg_config.c_str());
+    _debug ("    xdg_config %s", xdg_config.c_str());
 
     if (XDG_CACHE_HOME != NULL) {
         std::string xdg_env = std::string (XDG_CACHE_HOME) + _zidFilename;
-        _debug ("    xdg_env %s\n", xdg_env.c_str());
+        _debug ("    xdg_env %s", xdg_env.c_str());
         (xdg_env.length() > 0) ? zidCompleteFilename = xdg_env : zidCompleteFilename = xdg_config;
     } else
         zidCompleteFilename = xdg_config;
 
 
     if (initialize (zidCompleteFilename.c_str()) >= 0) {
-        _debug ("Register callbacks\n");
+        _debug ("Register callbacks");
         setEnableZrtp (true);
         setUserCallback (new ZrtpSessionCallback (_ca));
         return;
     }
 
-    _debug ("Initialization from ZID file failed. Trying to remove...\n");
+    _debug ("Initialization from ZID file failed. Trying to remove...");
 
     if (remove (zidCompleteFilename.c_str()) !=0) {
         _debug ("Failed to remove zid file because of: %s", strerror (errno));
@@ -79,7 +79,7 @@ void AudioZrtpSession::initializeZid (void)
     }
 
     if (initialize (zidCompleteFilename.c_str()) < 0) {
-        _debug ("ZRTP initialization failed\n");
+        _debug ("ZRTP initialization failed");
         throw ZrtpZidException();
     }
 
diff --git a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp
index 1648112382c5a2ee5f5da5e847c2df0868143509..ebdcd8f95e277e0d8de0628045cb3bc6a03ee212 100644
--- a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp
+++ b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp
@@ -44,7 +44,7 @@ ZrtpSessionCallback::ZrtpSessionCallback (SIPCall *sipcall) :
         return;
     }
 
-    _debug ("Initialize callbacks\n");
+    _debug ("Initialize callbacks");
 
     /**
      * Information Map
@@ -114,28 +114,28 @@ ZrtpSessionCallback::ZrtpSessionCallback (SIPCall *sipcall) :
 void
 ZrtpSessionCallback::secureOn (std::string cipher)
 {
-    _debug ("Secure mode is on with cipher %s\n", cipher.c_str());
+    _debug ("Secure mode is on with cipher %s", cipher.c_str());
     DBusManager::instance().getCallManager()->secureOn (_sipcall->getCallId(), cipher);
 }
 
 void
 ZrtpSessionCallback::secureOff (void)
 {
-    _debug ("Secure mode is off\n");
+    _debug ("Secure mode is off");
     DBusManager::instance().getCallManager()->secureOff (_sipcall->getCallId());
 }
 
 void
 ZrtpSessionCallback::showSAS (std::string sas, bool verified)
 {
-    _debug ("SAS is: %s\n", sas.c_str());
+    _debug ("SAS is: %s", sas.c_str());
     DBusManager::instance().getCallManager()->showSAS (_sipcall->getCallId(), sas, verified);
 }
 
 void
 ZrtpSessionCallback::zrtpNotSuppOther()
 {
-    _debug ("Callee does not support ZRTP\n");
+    _debug ("Callee does not support ZRTP");
     DBusManager::instance().getCallManager()->zrtpNotSuppOther (_sipcall->getCallId());
 }
 
@@ -148,7 +148,7 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub
         msg = _infoMap[subCode];
 
         if (msg != NULL) {
-            _debug ("ZRTP Debug:\n");
+            _debug ("ZRTP Debug:");
         }
     }
 
@@ -156,7 +156,7 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub
         msg = _warningMap[subCode];
 
         if (msg != NULL) {
-            _debug ("ZRTP Debug:\n");
+            _debug ("ZRTP Debug:");
         }
     }
 
@@ -164,22 +164,22 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub
         msg = _severeMap[subCode];
 
         if (msg != NULL) {
-            _debug ("ZRTP Debug:\n");
+            _debug ("ZRTP Debug:");
         }
     }
 
     if (sev == ZrtpError) {
         if (subCode < 0) {  // received an error packet from peer
             subCode *= -1;
-            _debug ("Received an error packet from peer:\n");
+            _debug ("Received an error packet from peer:");
         } else {
-            _debug ("Sent error packet to peer:\n");
+            _debug ("Sent error packet to peer:");
         }
 
         msg = _zrtpMap[subCode];
 
         if (msg != NULL) {
-            _debug ("ZRTP Debug: %s\n", msg->c_str());
+            _debug ("ZRTP Debug: %s", msg->c_str());
         }
     }
 }
@@ -192,20 +192,20 @@ ZrtpSessionCallback::zrtpNegotiationFailed (MessageSeverity severity, int subCod
     if (severity == ZrtpError) {
         if (subCode < 0) {  // received an error packet from peer
             subCode *= -1;
-            _debug ("Received error packet: \n");
+            _debug ("Received error packet: ");
         } else {
-            _debug ("Sent error packet: \n");
+            _debug ("Sent error packet: ");
         }
 
         msg = _zrtpMap[subCode];
 
         if (msg != NULL) {
-            _debug ("%s\n", msg->c_str());
+            _debug ("%s", msg->c_str());
             DBusManager::instance().getCallManager()->zrtpNegotiationFailed (_sipcall->getCallId(), *msg, "ZRTP");
         }
     } else {
         msg = _severeMap[subCode];
-        _debug ("%s\n", msg->c_str());
+        _debug ("%s", msg->c_str());
         DBusManager::instance().getCallManager()->zrtpNegotiationFailed (_sipcall->getCallId(), *msg, "severe");
     }
 }
@@ -213,7 +213,7 @@ ZrtpSessionCallback::zrtpNegotiationFailed (MessageSeverity severity, int subCod
 void
 ZrtpSessionCallback::confirmGoClear()
 {
-    _debug ("Received go clear message. Until confirmation, ZRTP won't send any data\n");
+    _debug ("Received go clear message. Until confirmation, ZRTP won't send any data");
     DBusManager::instance().getCallManager()->zrtpNotSuppOther (_sipcall->getCallId());
 }
 
diff --git a/sflphone-common/src/audio/codecs/alaw.cpp b/sflphone-common/src/audio/codecs/alaw.cpp
index e8a3928a7283e620b2dc2341cc0ea5df429f3bb7..9ed3cd56dedfd19cab165897048012f2b49212ca 100644
--- a/sflphone-common/src/audio/codecs/alaw.cpp
+++ b/sflphone-common/src/audio/codecs/alaw.cpp
@@ -38,7 +38,7 @@ class Alaw : public AudioCodec
         virtual ~Alaw() {}
 
         virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) {
-            // _debug("Decoded by alaw \n");
+            // _debug("Decoded by alaw ");
             int16* end = dst+size;
 
             while (dst<end)
@@ -48,7 +48,7 @@ class Alaw : public AudioCodec
         }
 
         virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) {
-            // _debug("Encoded by alaw \n");
+            // _debug("Encoded by alaw ");
             size >>= 1;
             uint8* end = dst+size;
 
diff --git a/sflphone-common/src/audio/codecs/celtcodec.cpp b/sflphone-common/src/audio/codecs/celtcodec.cpp
index 93cf4470d4aac4bb97b56105395db0c5b5f66a3c..8787bd6b6b3f7c8bfeec6fbf31464de24e31816c 100644
--- a/sflphone-common/src/audio/codecs/celtcodec.cpp
+++ b/sflphone-common/src/audio/codecs/celtcodec.cpp
@@ -46,13 +46,13 @@ class Celt : public AudioCodec
             // celt_mode_info(mode, CELT_GET_LOOKAHEAD, &skip);
 
             if (mode == NULL) {
-                printf ("failed to create a mode\n");
+                printf ("failed to create a mode");
             }
 
             // bytes_per_packet = 1024;
             // if (bytes_per_packet < 0 || bytes_per_packet > MAX_PACKET)
             // {
-            //     printf ("bytes per packet must be between 0 and %d\n");
+            //     printf ("bytes per packet must be between 0 and %d");
             // }
 
             // celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size);
diff --git a/sflphone-common/src/audio/codecs/codecDescriptor.cpp b/sflphone-common/src/audio/codecs/codecDescriptor.cpp
index 8c9ca56006cc214451d3e26381521a933218a833..87a3c8c3d300791c0b89415ea8bf806c71f0e57e 100644
--- a/sflphone-common/src/audio/codecs/codecDescriptor.cpp
+++ b/sflphone-common/src/audio/codecs/codecDescriptor.cpp
@@ -51,14 +51,14 @@ CodecDescriptor::init()
     _nbCodecs = CodecDynamicList.size();
 
     if (_nbCodecs <= 0) {
-        _debug (" Error - No codecs available in directory %s\n" , CODECS_DIR);
+        _debug (" Error - No codecs available in directory %s" , CODECS_DIR);
     }
 
     int i;
 
     for (i = 0 ; i < _nbCodecs ; i++) {
         _CodecsMap[ (AudioCodecType) CodecDynamicList[i]->getPayload() ] = CodecDynamicList[i];
-        _debug ("%s\n" , CodecDynamicList[i]->getCodecName().c_str());
+        _debug ("%s" , CodecDynamicList[i]->getCodecName().c_str());
     }
 }
 
@@ -94,11 +94,11 @@ CodecDescriptor::getCodec (AudioCodecType payload)
     CodecsMap::iterator iter = _CodecsMap.find (payload);
 
     if (iter!=_CodecsMap.end()) {
-        // _debug("Found codec %i _CodecsMap from codec descriptor\n", payload);
+        // _debug("Found codec %i _CodecsMap from codec descriptor", payload);
         return (iter->second);
     }
 
-    _debug ("Error cannont found codec %i in _CodecsMap from codec descriptor\n", payload);
+    _debug ("Error cannont found codec %i in _CodecsMap from codec descriptor", payload);
 
     return NULL;
 }
@@ -207,7 +207,7 @@ CodecDescriptor::scanCodecDirectory (void)
 
     for (i = 0 ; (unsigned int) i < dirToScan.size() ; i++) {
         std::string dirStr = dirToScan[i];
-        _debug ("Scanning %s to find audio codecs....\n",  dirStr.c_str());
+        _debug ("Scanning %s to find audio codecs....",  dirStr.c_str());
         DIR *dir = opendir (dirStr.c_str());
         AudioCodec* audioCodec;
 
@@ -218,7 +218,7 @@ CodecDescriptor::scanCodecDirectory (void)
                 tmp =  dirStruct -> d_name ;
                 if (tmp == CURRENT_DIR || tmp == PARENT_DIR) {} else {
                     if (seemsValid (tmp) && !alreadyInCache (tmp)) {
-                        //_debug("Codec : %s\n", tmp.c_str());
+                        //_debug("Codec : %s", tmp.c_str());
                         _Cache.push_back (tmp);
                         audioCodec = loadCodec (dirStr.append (tmp));
                         codecs.push_back (audioCodec);
@@ -237,7 +237,7 @@ CodecDescriptor::scanCodecDirectory (void)
 AudioCodec*
 CodecDescriptor::loadCodec (std::string path)
 {
-    //_debug("Load path %s\n", path.c_str());
+    //_debug("Load path %s", path.c_str());
     CodecHandlePointer p;
     using std::cerr;
     void * codecHandle = dlopen (path.c_str() , RTLD_LAZY);
@@ -265,7 +265,7 @@ CodecDescriptor::loadCodec (std::string path)
 void
 CodecDescriptor::unloadCodec (CodecHandlePointer p)
 {
-    // _debug("Unload codec %s\n", p.first->getCodecName().c_str());
+    // _debug("Unload codec %s", p.first->getCodecName().c_str());
     using std::cerr;
     destroy_t* destroyCodec = (destroy_t*) dlsym (p.second , "destroy");
 
diff --git a/sflphone-common/src/audio/codecs/gsmcodec.cpp b/sflphone-common/src/audio/codecs/gsmcodec.cpp
index 8543dec2b59ed44e86766565444406fc2663de46..9116d76a94a713e8ac7be356902a358b5b6c9386 100644
--- a/sflphone-common/src/audio/codecs/gsmcodec.cpp
+++ b/sflphone-common/src/audio/codecs/gsmcodec.cpp
@@ -42,10 +42,10 @@ class Gsm : public AudioCodec
             _bandwidth = 29.2;
 
             if (! (_decode_gsmhandle = gsm_create()))
-                printf ("ERROR: decode_gsm_create\n");
+                printf ("ERROR: decode_gsm_create");
 
             if (! (_encode_gsmhandle = gsm_create()))
-                printf ("AudioCodec: ERROR: encode_gsm_create\n");
+                printf ("AudioCodec: ERROR: encode_gsm_create");
         }
 
         Gsm (const Gsm&);
@@ -58,18 +58,18 @@ class Gsm : public AudioCodec
         }
 
         virtual int	codecDecode	(short * dst, unsigned char * src, unsigned int size) {
-            // _debug("Decoded by gsm \n");
+            // _debug("Decoded by gsm ");
             (void) size;
 
             if (gsm_decode (_decode_gsmhandle, (gsm_byte*) src, (gsm_signal*) dst) < 0)
-                printf ("ERROR: gsm_decode\n");
+                printf ("ERROR: gsm_decode");
 
             return 320;
         }
 
         virtual int	codecEncode	(unsigned char * dst, short * src, unsigned int size) {
 
-            // _debug("Encoded by gsm \n");
+            // _debug("Encoded by gsm ");
             (void) size;
             gsm_encode (_encode_gsmhandle, (gsm_signal*) src, (gsm_byte*) dst);
             return 33;
diff --git a/sflphone-common/src/audio/mainbuffer.cpp b/sflphone-common/src/audio/mainbuffer.cpp
index 3f2751b6ba8b03eef708411b09ed0d24bd41a874..052e729259131da39342e252bc9214a5a9ca1f8d 100644
--- a/sflphone-common/src/audio/mainbuffer.cpp
+++ b/sflphone-common/src/audio/mainbuffer.cpp
@@ -63,7 +63,7 @@ CallIDSet* MainBuffer::getCallIDSet (CallID call_id)
 
 bool MainBuffer::createCallIDSet (CallID set_id)
 {
-    _debug ("---- MainBuffer::createCallIDSet %s\n", set_id.c_str());
+    _debug ("---- MainBuffer::createCallIDSet %s", set_id.c_str());
 
     CallIDSet* newCallIDSet = new CallIDSet;
 
@@ -77,21 +77,21 @@ bool MainBuffer::createCallIDSet (CallID set_id)
 bool MainBuffer::removeCallIDSet (CallID set_id)
 {
 
-    _debug ("---- MainBuffer::removeCallIDSet %s\n", set_id.c_str());
+    _debug ("---- MainBuffer::removeCallIDSet %s", set_id.c_str());
 
 
     CallIDSet* callid_set = getCallIDSet (set_id);
 
     if (callid_set != NULL) {
         if (_callIDMap.erase (set_id) != 0) {
-            _debug ("          callid set %s erased!\n", set_id.c_str());
+            _debug ("          callid set %s erased!", set_id.c_str());
             return true;
         } else {
-            _debug ("          error while removing callid set %s!\n", set_id.c_str());
+            _debug ("          error while removing callid set %s!", set_id.c_str());
             return false;
         }
     } else {
-        _debug ("          callid set %s does not exist!\n", set_id.c_str());
+        _debug ("          callid set %s does not exist!", set_id.c_str());
         return false;
     }
 
@@ -99,7 +99,7 @@ bool MainBuffer::removeCallIDSet (CallID set_id)
 
 void MainBuffer::addCallIDtoSet (CallID set_id, CallID call_id)
 {
-    _debug ("---- MainBuffer::addCallIDtoSet %s in %s\n", set_id.c_str(), call_id.c_str());
+    _debug ("---- MainBuffer::addCallIDtoSet %s in %s", set_id.c_str(), call_id.c_str());
 
     CallIDSet* callid_set = getCallIDSet (set_id);
     callid_set->insert (call_id);
@@ -108,18 +108,18 @@ void MainBuffer::addCallIDtoSet (CallID set_id, CallID call_id)
 
 void MainBuffer::removeCallIDfromSet (CallID set_id, CallID call_id)
 {
-    _debug ("---- MainBuffer::removeCallIDfromSet element %s from %s\n", call_id.c_str(), set_id.c_str());
+    _debug ("---- MainBuffer::removeCallIDfromSet element %s from %s", call_id.c_str(), set_id.c_str());
 
     CallIDSet* callid_set = getCallIDSet (set_id);
 
     if (callid_set != NULL) {
         if (callid_set->erase (call_id) != 0) {
-            _debug ("          callid %s erased from set %s!\n", call_id.c_str(), set_id.c_str());
+            _debug ("          callid %s erased from set %s!", call_id.c_str(), set_id.c_str());
         } else {
-            _debug ("          error while removing callid %s from set %s!\n", call_id.c_str(), set_id.c_str());
+            _debug ("          error while removing callid %s from set %s!", call_id.c_str(), set_id.c_str());
         }
     } else {
-        _debug ("          callid set %s does not exist!\n", set_id.c_str());
+        _debug ("          callid set %s does not exist!", set_id.c_str());
     }
 }
 
@@ -130,7 +130,7 @@ RingBuffer* MainBuffer::getRingBuffer (CallID call_id)
     RingBufferMap::iterator iter = _ringBufferMap.find (call_id);
 
     if (iter == _ringBufferMap.end()) {
-        // _debug("ringBuffer with ID: \"%s\" doesn't exist! \n", call_id.c_str());
+        // _debug("ringBuffer with ID: \"%s\" doesn't exist! ", call_id.c_str());
         return NULL;
     } else
         return iter->second;
@@ -140,7 +140,7 @@ RingBuffer* MainBuffer::getRingBuffer (CallID call_id)
 RingBuffer* MainBuffer::createRingBuffer (CallID call_id)
 {
 
-    _debug ("---- MainBuffer::createRingBuffer callid %s\n", call_id.c_str());
+    _debug ("---- MainBuffer::createRingBuffer callid %s", call_id.c_str());
 
     RingBuffer* newRingBuffer = new RingBuffer (SIZEBUF, call_id);
 
@@ -153,20 +153,20 @@ RingBuffer* MainBuffer::createRingBuffer (CallID call_id)
 bool MainBuffer::removeRingBuffer (CallID call_id)
 {
 
-    _debug ("---- MainBuffer::removeRingBuffer call_id %s\n", call_id.c_str());
+    _debug ("---- MainBuffer::removeRingBuffer call_id %s", call_id.c_str());
 
     RingBuffer* ring_buffer = getRingBuffer (call_id);
 
     if (ring_buffer != NULL) {
         if (_ringBufferMap.erase (call_id) != 0) {
-            _debug ("          ringbuffer %s removed!\n", call_id.c_str());
+            _debug ("          ringbuffer %s removed!", call_id.c_str());
             return true;
         } else {
-            _debug ("          error while deleting ringbuffer %s!\n", call_id.c_str());
+            _debug ("          error while deleting ringbuffer %s!", call_id.c_str());
             return false;
         }
     } else {
-        _debug ("          error ringbuffer %s does not exist!\n", call_id.c_str());
+        _debug ("          error ringbuffer %s does not exist!", call_id.c_str());
         return true;
     }
 }
@@ -177,7 +177,7 @@ void MainBuffer::bindCallID (CallID call_id1, CallID call_id2)
 
     ost::MutexLock guard (_mutex);
 
-    _debug ("---- MainBuffer::bindCallID %s and callid %s\n", call_id1.c_str(), call_id2.c_str());
+    _debug ("---- MainBuffer::bindCallID %s and callid %s", call_id1.c_str(), call_id2.c_str());
 
     RingBuffer* ring_buffer;
     CallIDSet* callid_set;
@@ -210,7 +210,7 @@ void MainBuffer::unBindCallID (CallID call_id1, CallID call_id2)
 
     ost::MutexLock guard (_mutex);
 
-    _debug ("---- MainBuffer::unBindCallID %s and callid %s\n", call_id1.c_str(), call_id2.c_str());
+    _debug ("---- MainBuffer::unBindCallID %s and callid %s", call_id1.c_str(), call_id2.c_str());
 
     removeCallIDfromSet (call_id1, call_id2);
     removeCallIDfromSet (call_id2, call_id1);
@@ -261,7 +261,7 @@ void MainBuffer::unBindAll (CallID call_id)
 
     CallIDSet::iterator iter_set = temp_set.begin();
 
-    _debug ("MainBuffer::unBindAll\n");
+    _debug ("MainBuffer::unBindAll");
 
     while (iter_set != temp_set.end()) {
         CallID call_id_in_set = *iter_set;
@@ -369,12 +369,12 @@ int MainBuffer::getData (void *buffer, int toCopy, unsigned short volume, CallID
 int MainBuffer::getDataByID (void *buffer, int toCopy, unsigned short volume, CallID call_id, CallID reader_id)
 {
 
-    // _debug("MainBuffer::getDataByID in buffer %s by %s \n", call_id.c_str(), reader_id.c_str());
+    // _debug("MainBuffer::getDataByID in buffer %s by %s ", call_id.c_str(), reader_id.c_str());
 
     RingBuffer* ring_buffer = getRingBuffer (call_id);
 
     if (ring_buffer == NULL) {
-        // _debug("Output RingBuffer ID: \"%s\" does not exist!\n", call_id.c_str());
+        // _debug("Output RingBuffer ID: \"%s\" does not exist!", call_id.c_str());
         return 0;
     }
 
@@ -396,22 +396,22 @@ int MainBuffer::availForGet (CallID call_id)
         return 0;
 
     if (callid_set->empty()) {
-        _debug ("CallIDSet with ID: \"%s\" is empty!\n", call_id.c_str());
+        _debug ("CallIDSet with ID: \"%s\" is empty!", call_id.c_str());
         return 0;
     }
 
     if (callid_set->size() == 1) {
         CallIDSet::iterator iter_id = callid_set->begin();
-        // _debug("MainBuffer::availForGet availForGetByID(%s,%s)\n", (*iter_id).c_str(), call_id.c_str());
+        // _debug("MainBuffer::availForGet availForGetByID(%s,%s)", (*iter_id).c_str(), call_id.c_str());
 
         if ( (call_id != default_id) && (*iter_id == call_id)) {
-            _debug ("This problem should not occur since we have %i element\n", (int) callid_set->size());
+            _debug ("This problem should not occur since we have %i element", (int) callid_set->size());
         }
 
         // else
         return availForGetByID (*iter_id, call_id);
     } else {
-        // _debug("CallIDSet with ID: \"%s\" is a conference!\n", call_id.c_str());
+        // _debug("CallIDSet with ID: \"%s\" is a conference!", call_id.c_str());
         int avail_bytes = 99999;
         int nb_bytes;
         CallIDSet::iterator iter_id = callid_set->begin();
@@ -433,14 +433,14 @@ int MainBuffer::availForGetByID (CallID call_id, CallID reader_id)
 {
 
     if ( (call_id != default_id) && (reader_id == call_id)) {
-        _debug ("**********************************************************************\n");
-        _debug ("Error an RTP session ring buffer is not supposed to have a readpointer on tiself\n");
+        _debug ("**********************************************************************");
+        _debug ("Error an RTP session ring buffer is not supposed to have a readpointer on tiself");
     }
 
     RingBuffer* ringbuffer = getRingBuffer (call_id);
 
     if (ringbuffer == NULL) {
-        _debug ("Error: ring buffer does not exist\n");
+        _debug ("Error: ring buffer does not exist");
         return 0;
     } else
         return ringbuffer->AvailForGet (reader_id);
@@ -450,7 +450,7 @@ int MainBuffer::availForGetByID (CallID call_id, CallID reader_id)
 
 int MainBuffer::discard (int toDiscard, CallID call_id)
 {
-    // _debug("MainBuffer::discard\n");
+    // _debug("MainBuffer::discard");
 
     ost::MutexLock guard (_mutex);
 
@@ -460,17 +460,17 @@ int MainBuffer::discard (int toDiscard, CallID call_id)
         return 0;
 
     if (callid_set->empty()) {
-        // _debug("CallIDSet with ID: \"%s\" is empty!\n", call_id.c_str());
+        // _debug("CallIDSet with ID: \"%s\" is empty!", call_id.c_str());
         return 0;
     }
 
 
     if (callid_set->size() == 1) {
         CallIDSet::iterator iter_id = callid_set->begin();
-        // _debug("Discard Data in \"%s\" RingBuffer for \"%s\" ReaderPointer\n",(*iter_id).c_str(),call_id.c_str());
+        // _debug("Discard Data in \"%s\" RingBuffer for \"%s\" ReaderPointer",(*iter_id).c_str(),call_id.c_str());
         return discardByID (toDiscard, *iter_id, call_id);
     } else {
-        // _debug("CallIDSet with ID: \"%s\" is a conference!\n", call_id.c_str());
+        // _debug("CallIDSet with ID: \"%s\" is a conference!", call_id.c_str());
         CallIDSet::iterator iter_id;
 
         for (iter_id = callid_set->begin(); iter_id != callid_set->end(); iter_id++) {
@@ -501,7 +501,7 @@ void MainBuffer::flush (CallID call_id)
 {
     ost::MutexLock guard (_mutex);
 
-    // _debug("MainBuffer::flush\n");
+    // _debug("MainBuffer::flush");
 
     CallIDSet* callid_set = getCallIDSet (call_id);
 
@@ -509,14 +509,14 @@ void MainBuffer::flush (CallID call_id)
         return;
 
     if (callid_set->empty()) {
-        // _debug("CallIDSet with ID: \"%s\" is empty!\n", call_id.c_str());
+        // _debug("CallIDSet with ID: \"%s\" is empty!", call_id.c_str());
     }
 
     if (callid_set->size() == 1) {
         CallIDSet::iterator iter_id = callid_set->begin();
         flushByID (*iter_id, call_id);
     } else {
-        // _debug("CallIDSet with ID: \"%s\" is a conference!\n", call_id.c_str());
+        // _debug("CallIDSet with ID: \"%s\" is a conference!", call_id.c_str());
         CallIDSet::iterator iter_id;
 
         for (iter_id = callid_set->begin(); iter_id != callid_set->end(); iter_id++) {
@@ -548,12 +548,12 @@ void MainBuffer::flushByID (CallID call_id, CallID reader_id)
 void MainBuffer::flushAllBuffers()
 {
 
-    // _debug("-------------------------- flushAllBuffers()\n");
+    // _debug("-------------------------- flushAllBuffers()");
 
     RingBufferMap::iterator iter_buffer = _ringBufferMap.begin();
 
     while (iter_buffer != _ringBufferMap.end()) {
-        // _debug("--------------------------    flushing: %s\n",iter_buffer->second->getBufferId().c_str());
+        // _debug("--------------------------    flushing: %s",iter_buffer->second->getBufferId().c_str());
 
         iter_buffer->second->flushAll();
 
@@ -564,7 +564,7 @@ void MainBuffer::flushAllBuffers()
 
 void MainBuffer::stateInfo()
 {
-    _debug ("MainBuffer state info\n");
+    _debug ("MainBuffer state info");
 
     CallIDMap::iterator iter_map = _callIDMap.begin();
 
@@ -585,7 +585,7 @@ void MainBuffer::stateInfo()
             }
         }
 
-        _debug ("%s\n", dbg_str.c_str());
+        _debug ("%s", dbg_str.c_str());
 
         iter_map++;
     }
diff --git a/sflphone-common/src/audio/pulseaudio/audiostream.cpp b/sflphone-common/src/audio/pulseaudio/audiostream.cpp
index 89986506eede7627bdde82ca37928eca99300d41..521574dca30d68862af514d5acbc3fe805dae1bd 100644
--- a/sflphone-common/src/audio/pulseaudio/audiostream.cpp
+++ b/sflphone-common/src/audio/pulseaudio/audiostream.cpp
@@ -73,7 +73,7 @@ bool
 AudioStream::drainStream (void)
 {
     if (_audiostream) {
-        _debug ("Draining stream\n");
+        _debug ("Draining stream");
         pa_operation * operation;
 
         pa_threaded_mainloop_lock (_mainloop);
@@ -81,7 +81,7 @@ AudioStream::drainStream (void)
         if ( (operation = pa_stream_drain (_audiostream, success_cb, _mainloop))) {
             while (pa_operation_get_state (operation) != PA_OPERATION_DONE) {
                 if (!_context || pa_context_get_state (_context) != PA_CONTEXT_READY || !_audiostream || pa_stream_get_state (_audiostream) != PA_STREAM_READY) {
-                    _debug ("Connection died: %s\n", _context ? pa_strerror (pa_context_errno (_context)) : "NULL");
+                    _debug ("Connection died: %s", _context ? pa_strerror (pa_context_errno (_context)) : "NULL");
                     pa_operation_unref (operation);
                     break;
                 } else {
@@ -99,7 +99,7 @@ AudioStream::drainStream (void)
 bool
 AudioStream::disconnectStream (void)
 {
-    _debug ("Destroy audio streams\n");
+    _debug ("Destroy audio streams");
 
     // pa_threaded_mainloop_lock (_mainloop);
 
@@ -121,7 +121,7 @@ AudioStream::stream_state_callback (pa_stream* s, void* user_data)
 {
     pa_threaded_mainloop *m;
 
-    _debug ("AudioStream::stream_state_callback :: The state of the stream changed\n");
+    _debug ("AudioStream::stream_state_callback :: The state of the stream changed");
     assert (s);
 
     m = (pa_threaded_mainloop*) user_data;
@@ -130,26 +130,26 @@ AudioStream::stream_state_callback (pa_stream* s, void* user_data)
     switch (pa_stream_get_state (s)) {
 
         case PA_STREAM_CREATING:
-            _debug ("Stream is creating...\n");
+            _debug ("Stream is creating...");
             break;
 
         case PA_STREAM_TERMINATED:
-            _debug ("Stream is terminating...\n");
+            _debug ("Stream is terminating...");
             break;
 
         case PA_STREAM_READY:
-            _debug ("Stream successfully created, connected to %s\n", pa_stream_get_device_name (s));
+            _debug ("Stream successfully created, connected to %s", pa_stream_get_device_name (s));
             // pa_stream_cork( s, 0, NULL, NULL);
             break;
 
         case PA_STREAM_UNCONNECTED:
-            _debug ("Stream unconnected\n");
+            _debug ("Stream unconnected");
             break;
 
         case PA_STREAM_FAILED:
 
         default:
-            _debug ("Stream error - Sink/Source doesn't exists: %s\n" , pa_strerror (pa_context_errno (pa_stream_get_context (s))));
+            _debug ("Stream error - Sink/Source doesn't exists: %s" , pa_strerror (pa_context_errno (pa_stream_get_context (s))));
             exit (0);
             break;
     }
@@ -185,7 +185,7 @@ AudioStream::createStream (pa_context* c)
     pa_buffer_attr* attributes = (pa_buffer_attr*) malloc (sizeof (pa_buffer_attr));
 
     if (! (s = pa_stream_new (c, _streamDescription.c_str() , &sample_spec, &channel_map)))
-        _debug ("%s: pa_stream_new() failed : %s\n" , _streamDescription.c_str(), pa_strerror (pa_context_errno (c)));
+        _debug ("%s: pa_stream_new() failed : %s" , _streamDescription.c_str(), pa_strerror (pa_context_errno (c)));
 
     assert (s);
 
@@ -216,7 +216,7 @@ AudioStream::createStream (pa_context* c)
     } else if (_streamType == UPLOAD_STREAM) {
         pa_stream_connect_upload (s , 1024);
     } else {
-        _debug ("Stream type unknown \n");
+        _debug ("Stream type unknown ");
     }
 
     pa_stream_set_state_callback (s , stream_state_callback, _mainloop);
diff --git a/sflphone-common/src/audio/pulseaudio/pulselayer.cpp b/sflphone-common/src/audio/pulseaudio/pulselayer.cpp
index 8f5b94c5a0b96f0045417116322fc0f96841e15f..b82a15428d291ab1ef873b4a798240ec81672880 100644
--- a/sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+++ b/sflphone-common/src/audio/pulseaudio/pulselayer.cpp
@@ -25,7 +25,7 @@ int framesPerBuffer = 2048;
 
 static  void playback_callback (pa_stream* s, size_t bytes, void* userdata)
 {
-    // _debug("playback_callback\n");
+    // _debug("playback_callback");
 
     assert (s && bytes);
     assert (bytes > 0);
@@ -35,7 +35,7 @@ static  void playback_callback (pa_stream* s, size_t bytes, void* userdata)
 
 static void capture_callback (pa_stream* s, size_t bytes, void* userdata)
 {
-    // _debug("capture_callback\n");
+    // _debug("capture_callback");
 
     assert (s && bytes);
     assert (bytes > 0);
@@ -46,25 +46,25 @@ static void capture_callback (pa_stream* s, size_t bytes, void* userdata)
 /*
 static void stream_suspended_callback (pa_stream *s UNUSED, void *userdata UNUSED)
 {
-    _debug("PulseLayer::Stream Suspended\n");
+    _debug("PulseLayer::Stream Suspended");
 }
 */
 
 /*
 static void stream_moved_callback(pa_stream *s UNUSED, void *userdata UNUSED)
 {
-    _debug("PulseLayer::Stream Moved\n");
+    _debug("PulseLayer::Stream Moved");
 }
 */
 
 static void playback_underflow_callback (pa_stream* s,  void* userdata UNUSED)
 {
-    _debug ("PulseLayer::Buffer Underflow\n");
+    _debug ("PulseLayer::Buffer Underflow");
     // const pa_timing_info* info = pa_stream_get_timing_info(s);
-    // _debug("         pa write_index: %l\n", (long)(info->write_index));
-    // _debug("         pa write_index_corupt (if not 0): %i\n",  info->write_index_corrupt);
-    // _debug("         pa read_index: %l\n", (long)(info->read_index));
-    // _debug("         pa read_index_corrupt (if not 0): %i\n", info->read_index_corrupt);
+    // _debug("         pa write_index: %l", (long)(info->write_index));
+    // _debug("         pa write_index_corupt (if not 0): %i",  info->write_index_corrupt);
+    // _debug("         pa read_index: %l", (long)(info->read_index));
+    // _debug("         pa read_index_corrupt (if not 0): %i", info->read_index_corrupt);
 
 
     // fill in audio buffer twice the prebuffering value to restart playback
@@ -77,7 +77,7 @@ static void playback_underflow_callback (pa_stream* s,  void* userdata UNUSED)
 
 static void playback_overflow_callback (pa_stream* s UNUSED, void* userdata UNUSED)
 {
-    _debug ("PulseLayer::Buffer OverFlow\n");
+    _debug ("PulseLayer::Buffer OverFlow");
     //PulseLayer* pulse = (PulseLayer*) userdata;
     // pa_stream_drop (s);
     // pa_stream_trigger (s, NULL, NULL);
@@ -91,7 +91,7 @@ PulseLayer::PulseLayer (ManagerImpl* manager)
         , playback()
         , record()
 {
-    _debug ("PulseLayer::Pulse audio constructor: Create context\n");
+    _debug ("PulseLayer::Pulse audio constructor: Create context");
 
     _urgentRingBuffer.createReadPointer();
     dcblocker = new DcBlocker();
@@ -116,7 +116,7 @@ PulseLayer::~PulseLayer (void)
 bool
 PulseLayer::closeLayer (void)
 {
-    _debug ("PulseLayer::closeLayer :: Destroy pulselayer\n");
+    _debug ("PulseLayer::closeLayer :: Destroy pulselayer");
 
     // Commenting the line below will make the
     // PulseLayer to close immediately, not
@@ -153,7 +153,7 @@ PulseLayer::closeLayer (void)
 void
 PulseLayer::connectPulseAudioServer (void)
 {
-    _debug ("PulseLayer::connectPulseAudioServer \n");
+    _debug ("PulseLayer::connectPulseAudioServer ");
 
     setenv ("PULSE_PROP_media.role", "phone", 1);
 
@@ -161,7 +161,7 @@ PulseLayer::connectPulseAudioServer (void)
 
     pa_threaded_mainloop_lock (m);
 
-    _debug ("Connect the context to the server\n");
+    _debug ("Connect the context to the server");
     pa_context_connect (context, NULL , flag , NULL);
 
     pa_context_set_state_callback (context, context_state_callback, this);
@@ -170,7 +170,7 @@ PulseLayer::connectPulseAudioServer (void)
     // Run the main loop
 
     if (pa_context_get_state (context) != PA_CONTEXT_READY) {
-        _debug ("Error connecting to pulse audio server\n");
+        _debug ("Error connecting to pulse audio server");
         // pa_threaded_mainloop_unlock (m);
     }
 
@@ -178,13 +178,13 @@ PulseLayer::connectPulseAudioServer (void)
 
     //serverinfo();
     //muteAudioApps(99);
-    _debug ("Context creation done\n");
+    _debug ("Context creation done");
 
 }
 
 void PulseLayer::context_state_callback (pa_context* c, void* user_data)
 {
-    _debug ("PulseLayer::context_state_callback ::The state of the context changed\n");
+    _debug ("PulseLayer::context_state_callback ::The state of the context changed");
     PulseLayer* pulse = (PulseLayer*) user_data;
     assert (c && pulse->m);
 
@@ -195,22 +195,22 @@ void PulseLayer::context_state_callback (pa_context* c, void* user_data)
         case PA_CONTEXT_AUTHORIZING:
 
         case PA_CONTEXT_SETTING_NAME:
-            _debug ("Waiting....\n");
+            _debug ("Waiting....");
             break;
 
         case PA_CONTEXT_READY:
             pulse->createStreams (c);
-            _debug ("Connection to PulseAudio server established\n");
+            _debug ("Connection to PulseAudio server established");
             break;
 
         case PA_CONTEXT_TERMINATED:
-            _debug ("Context terminated\n");
+            _debug ("Context terminated");
             break;
 
         case PA_CONTEXT_FAILED:
 
         default:
-            _debug (" Error : %s\n" , pa_strerror (pa_context_errno (c)));
+            _debug (" Error : %s" , pa_strerror (pa_context_errno (c)));
             pulse->disconnectAudioStream();
             exit (0);
             break;
@@ -219,7 +219,7 @@ void PulseLayer::context_state_callback (pa_context* c, void* user_data)
 
 bool PulseLayer::disconnectAudioStream (void)
 {
-    _debug (" PulseLayer::disconnectAudioStream( void ) \n");
+    _debug (" PulseLayer::disconnectAudioStream( void ) ");
 
     closePlaybackStream();
 
@@ -234,7 +234,7 @@ bool PulseLayer::disconnectAudioStream (void)
 
 bool PulseLayer::createStreams (pa_context* c)
 {
-    _debug ("PulseLayer::createStreams\n");
+    _debug ("PulseLayer::createStreams");
 
     PulseLayerType * playbackParam = new PulseLayerType();
     playbackParam->context = c;
@@ -334,27 +334,27 @@ void PulseLayer::startStream (void)
 
     if (!is_started) {
 
-        _debug ("PulseLayer::Start Stream\n");
+        _debug ("PulseLayer::Start Stream");
 
         if (!m) {
 
-            _debug ("Creating PulseAudio MainLoop\n");
+            _debug ("Creating PulseAudio MainLoop");
             m = pa_threaded_mainloop_new();
             assert (m);
 
             if (pa_threaded_mainloop_start (m) < 0) {
-                _debug ("Failed starting the mainloop\n");
+                _debug ("Failed starting the mainloop");
             }
         }
 
         if (!context) {
 
-            _debug ("Creating new PulseAudio Context\n");
+            _debug ("Creating new PulseAudio Context");
             pa_threaded_mainloop_lock (m);
             // Instanciate a context
 
             if (! (context = pa_context_new (pa_threaded_mainloop_get_api (m) , "SFLphone")))
-                _debug ("Error while creating the context\n");
+                _debug ("Error while creating the context");
 
             pa_threaded_mainloop_unlock (m);
 
@@ -381,7 +381,7 @@ PulseLayer::stopStream (void)
 
     if (is_started) {
 
-        _debug ("PulseLayer::Stop Audio Stream\n");
+        _debug ("PulseLayer::Stop Audio Stream");
         pa_stream_flush (playback->pulseStream(), NULL, NULL);
         pa_stream_flush (record->pulseStream(), NULL, NULL);
 
@@ -391,7 +391,7 @@ PulseLayer::stopStream (void)
 
         disconnectAudioStream();
 
-        _debug ("Disconnecting PulseAudio context\n");
+        _debug ("Disconnecting PulseAudio context");
 
         if (context) {
 
@@ -402,7 +402,7 @@ PulseLayer::stopStream (void)
             context = NULL;
         }
 
-        _debug ("Freeing Pulseaudio mainloop\n");
+        _debug ("Freeing Pulseaudio mainloop");
 
         if (m) {
             pa_threaded_mainloop_free (m);
@@ -420,7 +420,7 @@ PulseLayer::stopStream (void)
 
 // void PulseLayer::underflow (pa_stream* s UNUSED,  void* userdata UNUSED)
 //{
-//    _debug ("PulseLayer::Buffer Underflow\n");
+//    _debug ("PulseLayer::Buffer Underflow");
 //}
 
 /*
@@ -438,7 +438,7 @@ void PulseLayer::processPlaybackData (void)
     // Handle the data for the speakers
     if (playback && (playback->pulseStream()) && (pa_stream_get_state (playback->pulseStream()) == PA_STREAM_READY)) {
 
-        // _debug("PulseLayer::processPlaybackData()\n");
+        // _debug("PulseLayer::processPlaybackData()");
 
         // If the playback buffer is full, we don't overflow it; wait for it to have free space
         if (pa_stream_writable_size (playback->pulseStream()) == 0)
@@ -467,7 +467,7 @@ void PulseLayer::processData (void)
     // Handle the data for the speakers
     if (playback && (playback->pulseStream()) && (pa_stream_get_state (playback->pulseStream()) == PA_STREAM_READY)) {
 
-        // _debug("PulseLayer::processPlaybackData()\n");
+        // _debug("PulseLayer::processPlaybackData()");
 
         // If the playback buffer is full, we don't overflow it; wait for it to have free space
         if (pa_stream_writable_size (playback->pulseStream()) == 0)
@@ -499,17 +499,17 @@ void PulseLayer::writeToSpeaker (void)
 
 
     int writeableSize = pa_stream_writable_size (playback->pulseStream());
-    // _debug("PulseLayer writablesize : %i\n", writeableSize);
+    // _debug("PulseLayer writablesize : %i", writeableSize);
 
     if (writeableSize < 0)
-        _debug ("PulseLayer playback error : %s\n", pa_strerror (writeableSize));
+        _debug ("PulseLayer playback error : %s", pa_strerror (writeableSize));
 
 
     if (urgentAvailBytes > writeableSize) {
 
-        // _debug("urgentAvailBytes: %i\n", urgentAvailBytes);
+        // _debug("urgentAvailBytes: %i", urgentAvailBytes);
 
-        // _debug("Play Urgent!\n");
+        // _debug("Play Urgent!");
 
         out = (SFLDataFormat*) pa_xmalloc (writeableSize);
         _urgentRingBuffer.Get (out, writeableSize, 100);
@@ -533,11 +533,11 @@ void PulseLayer::writeToSpeaker (void)
 
         if (tone != 0) {
 
-            // _debug("PlayTone writeableSize: %i\n", writeableSize);
+            // _debug("PlayTone writeableSize: %i", writeableSize);
 
             if (playback->getStreamState() == PA_STREAM_READY) {
 
-                // _debug("Play Sine Tone!\n");
+                // _debug("Play Sine Tone!");
 
                 out = (SFLDataFormat*) pa_xmalloc (writeableSize);
                 int copied = tone->getNext (out, writeableSize / sizeof (SFLDataFormat), 100);
@@ -553,7 +553,7 @@ void PulseLayer::writeToSpeaker (void)
         else if (file_tone != 0) {
 
             if (playback->getStreamState() == PA_STREAM_READY) {
-                // _debug("Play File Tone!\n");
+                // _debug("Play File Tone!");
 
                 out = (SFLDataFormat*) pa_xmalloc (writeableSize);
                 int copied = file_tone->getNext (out, writeableSize / sizeof (SFLDataFormat), 100);
@@ -614,7 +614,7 @@ void PulseLayer::writeToSpeaker (void)
                     int nbSample = _converter->upsampleData ( (SFLDataFormat*) out, rsmpl_out, _mainBufferSampleRate, _audioSampleRate, nb_sample_down);
 
                     if ( (nbSample*sizeof (SFLDataFormat)) > (unsigned int) writeableSize)
-                        _debug ("Error: nbsbyte exceed buffer length\n");
+                        _debug ("Error: nbsbyte exceed buffer length");
 
                     // pa_threaded_mainloop_lock (m);
                     pa_stream_write (playback->pulseStream(), rsmpl_out, nbSample*sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE);
@@ -666,10 +666,10 @@ void PulseLayer::readFromMic (void)
 
     int readableSize = pa_stream_readable_size (record->pulseStream());
 
-    // _debug("readableSize: %i\n", readableSize);
+    // _debug("readableSize: %i", readableSize);
 
     if (pa_stream_peek (record->pulseStream() , (const void**) &data , &r) < 0 || !data) {
-        _debug ("pa_stream_peek() failed: %s\n" , pa_strerror (pa_context_errno (context)));
+        _debug ("pa_stream_peek() failed: %s" , pa_strerror (pa_context_errno (context)));
     }
 
     if (data != 0) {
@@ -683,7 +683,7 @@ void PulseLayer::readFromMic (void)
 
 
             SFLDataFormat* rsmpl_out = (SFLDataFormat*) pa_xmalloc (readableSize);
-            // _debug("Byte read: %i\n", r);
+            // _debug("Byte read: %i", r);
             int nbSample = r / sizeof (SFLDataFormat);
 
             int nb_sample_up = nbSample;
@@ -709,7 +709,7 @@ void PulseLayer::readFromMic (void)
     }
 
     if (pa_stream_drop (record->pulseStream()) < 0) {
-        //_debug("pa_stream_drop() failed: %s\n" , pa_strerror( pa_context_errno( context) ));
+        //_debug("pa_stream_drop() failed: %s" , pa_strerror( pa_context_errno( context) ));
     }
 
     // pa_threaded_mainloop_unlock (m);
@@ -717,10 +717,10 @@ void PulseLayer::readFromMic (void)
 
 static void retrieve_server_info (pa_context *c UNUSED, const pa_server_info *i, void *userdata UNUSED)
 {
-    _debug ("Server Info: Process owner : %s\n" , i->user_name);
-    _debug ("\t\tServer name : %s - Server version = %s\n" , i->server_name, i->server_version);
-    _debug ("\t\tDefault sink name : %s\n" , i->default_sink_name);
-    _debug ("\t\tDefault source name : %s\n" , i->default_source_name);
+    _debug ("Server Info: Process owner : %s" , i->user_name);
+    _debug ("\t\tServer name : %s - Server version = %s" , i->server_name, i->server_version);
+    _debug ("\t\tDefault sink name : %s" , i->default_sink_name);
+    _debug ("\t\tDefault source name : %s" , i->default_source_name);
 }
 
 static void reduce_sink_list_cb (pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata)
@@ -728,10 +728,10 @@ static void reduce_sink_list_cb (pa_context *c UNUSED, const pa_sink_input_info
     PulseLayer* pulse = (PulseLayer*) userdata;
 
     if (!eol) {
-        //_debug("Sink Info: index : %i\n" , i->index);
-        //_debug("\t\tClient : %i\n" , i->client);
-        //_debug("\t\tVolume : %i\n" , i->volume.values[0]);
-        //_debug("\t\tChannels : %i\n" , i->volume.channels);
+        //_debug("Sink Info: index : %i" , i->index);
+        //_debug("\t\tClient : %i" , i->client);
+        //_debug("\t\tVolume : %i" , i->volume.values[0]);
+        //_debug("\t\tChannels : %i" , i->volume.channels);
         if (strcmp (i->name , PLAYBACK_STREAM_NAME) != 0)
             pulse->setSinkVolume (i->index , i->volume.channels, 10);
     }
@@ -742,11 +742,11 @@ static void restore_sink_list_cb (pa_context *c UNUSED, const pa_sink_input_info
     PulseLayer* pulse = (PulseLayer*) userdata;
 
     if (!eol) {
-        //_debug("Sink Info: index : %i\n" , i->index);
-        //_debug("\t\tSink name : -%s-\n" , i->name);
-        //_debug("\t\tClient : %i\n" , i->client);
-        //_debug("\t\tVolume : %i\n" , i->volume.values[0]);
-        //_debug("\t\tChannels : %i\n" , i->volume.channels);
+        //_debug("Sink Info: index : %i" , i->index);
+        //_debug("\t\tSink name : -%s-" , i->name);
+        //_debug("\t\tClient : %i" , i->client);
+        //_debug("\t\tVolume : %i" , i->volume.values[0]);
+        //_debug("\t\tChannels : %i" , i->volume.channels);
         if (strcmp (i->name , PLAYBACK_STREAM_NAME) != 0)
             pulse->setSinkVolume (i->index , i->volume.channels, 100);
     }
@@ -806,7 +806,7 @@ void PulseLayer::setSinkVolume (int index, int channels, int volume)
     pa_volume_t vol = PA_VOLUME_NORM * ( (double) volume / 100) ;
 
     pa_cvolume_set (&cvolume , channels , vol);
-    _debug ("Set sink volume of index %i\n" , index);
+    _debug ("Set sink volume of index %i" , index);
     pa_context_set_sink_input_volume (context, index, &cvolume, NULL, NULL) ;
 
 }
@@ -818,7 +818,7 @@ void PulseLayer::setSourceVolume (int index, int channels, int volume)
     pa_volume_t vol = PA_VOLUME_NORM * ( (double) volume / 100) ;
 
     pa_cvolume_set (&cvolume , channels , vol);
-    _debug ("Set source volume of index %i\n" , index);
+    _debug ("Set source volume of index %i" , index);
     pa_context_set_source_volume_by_index (context, index, &cvolume, NULL, NULL);
 
 }
diff --git a/sflphone-common/src/audio/ringbuffer.cpp b/sflphone-common/src/audio/ringbuffer.cpp
index 0eb146f397cb03b7d377aa39b2122466ff18cb6c..6e08859c70c796367a8b68ad13750043b22afb34 100644
--- a/sflphone-common/src/audio/ringbuffer.cpp
+++ b/sflphone-common/src/audio/ringbuffer.cpp
@@ -54,7 +54,7 @@ RingBuffer::~RingBuffer()
 void
 RingBuffer::flush (CallID call_id)
 {
-    _debug ("flush: reinit \"%s\" readpointer in \"%s\" ringbuffer\n", call_id.c_str(), buffer_id.c_str());
+    _debug ("flush: reinit \"%s\" readpointer in \"%s\" ringbuffer", call_id.c_str(), buffer_id.c_str());
     storeReadPointer (mEnd, call_id);
 }
 
@@ -62,14 +62,14 @@ RingBuffer::flush (CallID call_id)
 void
 RingBuffer::flushAll ()
 {
-    // _debug("flushall: reinit all readpointer in \"%s\" ringbuffer\n", buffer_id.c_str());
+    // _debug("flushall: reinit all readpointer in \"%s\" ringbuffer", buffer_id.c_str());
 
-    // _debug("------------------------------ flushAll() in \"%s\" ringbuffer\n", buffer_id.c_str());
+    // _debug("------------------------------ flushAll() in \"%s\" ringbuffer", buffer_id.c_str());
 
     ReadPointer::iterator iter_pointer = _readpointer.begin();
 
     while (iter_pointer != _readpointer.end()) {
-        // _debug("------------------------------     reinit readpointer %s\n", iter_pointer->first.c_str());
+        // _debug("------------------------------     reinit readpointer %s", iter_pointer->first.c_str());
         iter_pointer->second = mEnd;
 
         iter_pointer++;
@@ -89,8 +89,8 @@ RingBuffer::putLen()
 
     int length = (mEnd + mBufferSize - mStart) % mBufferSize;
 
-    // _debug("RingBuffer::putLen length %i\n", length);
-    // _debug("    *RingBuffer::putLen: buffer_id %s, mStart %i, mEnd %i, length %i, buffersie %i\n", buffer_id.c_str(), mStart, mEnd, length, mBufferSize);
+    // _debug("RingBuffer::putLen length %i", length);
+    // _debug("    *RingBuffer::putLen: buffer_id %s, mStart %i, mEnd %i, length %i, buffersie %i", buffer_id.c_str(), mStart, mEnd, length, mBufferSize);
     return length;
 }
 
@@ -101,7 +101,7 @@ RingBuffer::getLen (CallID call_id)
     int mStart = getReadPointer (call_id);
 
     int length = (mEnd + mBufferSize - mStart) % mBufferSize;
-    // _debug("    *RingBuffer::getLen: buffer_id %s, call_id %s, mStart %i, mEnd %i, length %i, buffersie %i\n", buffer_id.c_str(), call_id.c_str(), mStart, mEnd, length, mBufferSize);
+    // _debug("    *RingBuffer::getLen: buffer_id %s, call_id %s, mStart %i, mEnd %i, length %i, buffersie %i", buffer_id.c_str(), call_id.c_str(), mStart, mEnd, length, mBufferSize);
     return length;
 
 }
@@ -111,7 +111,7 @@ RingBuffer::debug()
 {
     int mStart = getSmallestReadPointer();
 
-    _debug ("Start=%d; End=%d; BufferSize=%d\n", mStart, mEnd, mBufferSize);
+    _debug ("Start=%d; End=%d; BufferSize=%d", mStart, mEnd, mBufferSize);
 }
 
 int
@@ -121,17 +121,17 @@ RingBuffer::getReadPointer (CallID call_id)
     if (getNbReadPointer() == 0)
         return 0;
 
-    // _debug("RingBuffer::getReadPointer() id %s\n", call_id.c_str());
+    // _debug("RingBuffer::getReadPointer() id %s", call_id.c_str());
 
     ReadPointer::iterator iter = _readpointer.find (call_id);
 
     if (iter == _readpointer.end()) {
-        // _debug("                RingBuffer::getReadPointer Error read pointer size: %i\n", _readpointer.size());
-        // _debug("                RingBuffer::getReadPointer Error read pointer \"%s\" is null\n", call_id.c_str());
+        // _debug("                RingBuffer::getReadPointer Error read pointer size: %i", _readpointer.size());
+        // _debug("                RingBuffer::getReadPointer Error read pointer \"%s\" is null", call_id.c_str());
         ReadPointer::iterator iter2;
 
         for (iter2 = _readpointer.begin(); iter2 != _readpointer.end(); iter2++) {
-            // x_debug("                RingBuffer::getReadPointer list avail pointer \"%s\"\n", iter2->first.c_str());
+            // x_debug("                RingBuffer::getReadPointer list avail pointer \"%s\"", iter2->first.c_str());
         }
 
         return 0;
@@ -169,9 +169,9 @@ RingBuffer::storeReadPointer (int pointer_value, CallID call_id)
 
     if (iter != _readpointer.end()) {
         iter->second = pointer_value;
-        // _debug("store read pointer call_id %s, size: %i \n",call_id.c_str(), _readpointer.size());
+        // _debug("store read pointer call_id %s, size: %i ",call_id.c_str(), _readpointer.size());
     } else {
-        _debug ("storeReadPointer: Cannot find \"%s\" readPointer in \"%s\" ringbuffer\n", call_id.c_str(), buffer_id.c_str());
+        _debug ("storeReadPointer: Cannot find \"%s\" readPointer in \"%s\" ringbuffer", call_id.c_str(), buffer_id.c_str());
     }
 
 }
@@ -181,10 +181,10 @@ void
 RingBuffer::createReadPointer (CallID call_id)
 {
 
-    _debug ("---- createReadPointer ringbuffer_id %s, call_id %s\n", buffer_id.c_str(), call_id.c_str());
+    _debug ("---- createReadPointer ringbuffer_id %s, call_id %s", buffer_id.c_str(), call_id.c_str());
 
     _readpointer.insert (pair<CallID, int> (call_id, mEnd));
-    _debug ("---- createReadPointer ringbuffer_id %s, size %i\n", buffer_id.c_str(), (int) _readpointer.size());
+    _debug ("---- createReadPointer ringbuffer_id %s, size %i", buffer_id.c_str(), (int) _readpointer.size());
 
 }
 
@@ -193,10 +193,10 @@ void
 RingBuffer::removeReadPointer (CallID call_id)
 {
 
-    _debug ("---- removeReadPointer ringbuffer_id %s, call_id %s\n", buffer_id.c_str(), call_id.c_str());
+    _debug ("---- removeReadPointer ringbuffer_id %s, call_id %s", buffer_id.c_str(), call_id.c_str());
 
     _readpointer.erase (call_id);
-    _debug ("---- removeReadPointer ringbuffer_id %s, size %i\n", buffer_id.c_str(), (int) _readpointer.size());
+    _debug ("---- removeReadPointer ringbuffer_id %s, size %i", buffer_id.c_str(), (int) _readpointer.size());
 
 }
 
@@ -227,8 +227,8 @@ int
 RingBuffer::AvailForPut()
 {
     // Always keep 4 bytes safe (?)
-    // z_debug("RingBuffer::AvailForPut: putLen %i\n", putLen());
-    // _debug("RingBuffer::AvailForPut %s --------------------\n", buffer_id.c_str());
+    // z_debug("RingBuffer::AvailForPut: putLen %i", putLen());
+    // _debug("RingBuffer::AvailForPut %s --------------------", buffer_id.c_str());
     return (mBufferSize-4) - putLen();
 }
 
@@ -241,9 +241,9 @@ RingBuffer::Put (void* buffer, int toCopy, unsigned short volume)
     int block;
     int copied;
     int pos;
-    // _debug("RingBuffer::Put buffer_id %s, call_id %s --------------------\n", buffer_id.c_str(), call_id.c_str());
+    // _debug("RingBuffer::Put buffer_id %s, call_id %s --------------------", buffer_id.c_str(), call_id.c_str());
     int len = putLen();
-    // _debug("    RingBuffer::Put bufferid %s, putlen %i\n", buffer_id.c_str(), len);
+    // _debug("    RingBuffer::Put bufferid %s, putlen %i", buffer_id.c_str(), len);
 
     if (toCopy > (mBufferSize-4) - len)
         toCopy = (mBufferSize-4) - len;
@@ -302,7 +302,7 @@ int
 RingBuffer::AvailForGet (CallID call_id)
 {
     // Used space
-    // _debug("RingBuffer::AvailForGet buffer_id %s, call_id %s --------------------\n", buffer_id.c_str(), call_id.c_str());
+    // _debug("RingBuffer::AvailForGet buffer_id %s, call_id %s --------------------", buffer_id.c_str(), call_id.c_str());
     return getLen (call_id);
 }
 
@@ -323,10 +323,10 @@ RingBuffer::Get (void *buffer, int toCopy, unsigned short volume, CallID call_id
 
     int copied;
 
-    // _debug("RingBuffer::Get buffer_id %s, call_id %s --------------------\n", buffer_id.c_str(), call_id.c_str());
+    // _debug("RingBuffer::Get buffer_id %s, call_id %s --------------------", buffer_id.c_str(), call_id.c_str());
     int len = getLen (call_id);
 
-    // _debug("    RingBuffer::Get bufferid %s, getlen %i\n", buffer_id.c_str(), len);
+    // _debug("    RingBuffer::Get bufferid %s, getlen %i", buffer_id.c_str(), len);
 
     if (toCopy > len)
         toCopy = len;
@@ -375,7 +375,7 @@ RingBuffer::Get (void *buffer, int toCopy, unsigned short volume, CallID call_id
 int
 RingBuffer::Discard (int toDiscard, CallID call_id)
 {
-    // _debug("RingBuffer::Discard buffer_id %s, call_id %s --------------------\n", buffer_id.c_str(), call_id.c_str());
+    // _debug("RingBuffer::Discard buffer_id %s, call_id %s --------------------", buffer_id.c_str(), call_id.c_str());
     int len = getLen (call_id);
 
     int mStart = getReadPointer (call_id);
diff --git a/sflphone-common/src/audio/samplerateconverter.cpp b/sflphone-common/src/audio/samplerateconverter.cpp
index 29a3cc286bb27a2da04c38b1087309fd00495fc1..8d115a25560149e1a0b73c54f91d7fea26ace8a3 100644
--- a/sflphone-common/src/audio/samplerateconverter.cpp
+++ b/sflphone-common/src/audio/samplerateconverter.cpp
@@ -104,7 +104,7 @@ int SamplerateConverter::upsampleData (SFLDataFormat* dataIn , SFLDataFormat* da
 {
 
     double upsampleFactor = (double) samplerate2 / samplerate1 ;
-    //_debug("factor = %f\n" , upsampleFactor);
+    //_debug("factor = %f" , upsampleFactor);
     int nbSamplesMax = (int) (samplerate2 * getFramesize() / 1000);
     nbSamplesMax = nbSamplesMax*4;
 
@@ -116,16 +116,16 @@ int SamplerateConverter::upsampleData (SFLDataFormat* dataIn , SFLDataFormat* da
         src_data.output_frames = (int) floor (upsampleFactor * nbSamples);
         src_data.src_ratio = upsampleFactor;
         src_data.end_of_input = 0; // More data will come
-        // _debug("    upsample %d %d %f %d\n" , src_data.input_frames , src_data.output_frames, src_data.src_ratio , nbSamples);
+        // _debug("    upsample %d %d %f %d" , src_data.input_frames , src_data.output_frames, src_data.src_ratio , nbSamples);
         // Override libsamplerate conversion function
         Short2FloatArray (dataIn , _floatBufferDownSpkr, nbSamples);
         //src_short_to_float_array (dataIn , _floatBufferDownSpkr, nbSamples);
-        //_debug("upsample %d %f %d\n" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
+        //_debug("upsample %d %f %d" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
         src_process (_src_state_spkr, &src_data);
-        // _debug("    upsample %d %d %d\n" , samplerate1, samplerate2 , nbSamples);
+        // _debug("    upsample %d %d %d" , samplerate1, samplerate2 , nbSamples);
         nbSamples  = (src_data.output_frames_gen > nbSamplesMax) ? nbSamplesMax : src_data.output_frames_gen;
         src_float_to_short_array (_floatBufferUpSpkr, dataOut, nbSamples);
-        //_debug("upsample %d %d %d\n" , samplerate1, samplerate2 , nbSamples);
+        //_debug("upsample %d %d %d" , samplerate1, samplerate2 , nbSamples);
     }
 
     return nbSamples;
@@ -136,7 +136,7 @@ int SamplerateConverter::downsampleData (SFLDataFormat* dataIn , SFLDataFormat*
 {
 
     double downsampleFactor = (double) samplerate1 / samplerate2;
-    //_debug("factor = %f\n" , downsampleFactor);
+    //_debug("factor = %f" , downsampleFactor);
     int nbSamplesMax = (int) (samplerate1 * getFramesize() / 1000);
 
     nbSamplesMax = nbSamplesMax*4;
@@ -149,15 +149,15 @@ int SamplerateConverter::downsampleData (SFLDataFormat* dataIn , SFLDataFormat*
         src_data.output_frames = (int) floor (downsampleFactor * nbSamples);
         src_data.src_ratio = downsampleFactor;
         src_data.end_of_input = 0; // More data will come
-        //_debug("downsample %d %f %d\n" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
+        //_debug("downsample %d %f %d" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
         // Override libsamplerate conversion function
         Short2FloatArray (dataIn , _floatBufferUpMic, nbSamples);
         //src_short_to_float_array (dataIn, _floatBufferUpMic, nbSamples);
-        //_debug("downsample %d %f %d\n" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
+        //_debug("downsample %d %f %d" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
         src_process (_src_state_mic, &src_data);
-        //_debug("downsample %d %f %d\n" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
+        //_debug("downsample %d %f %d" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
         nbSamples  = (src_data.output_frames_gen > nbSamplesMax) ? nbSamplesMax : src_data.output_frames_gen;
-        //_debug("downsample %d %f %d\n" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
+        //_debug("downsample %d %f %d" ,  src_data.output_frames, src_data.src_ratio , nbSamples);
         src_float_to_short_array (_floatBufferDownMic , dataOut , nbSamples);
     }
 
diff --git a/sflphone-common/src/audio/sound/audiofile.cpp b/sflphone-common/src/audio/sound/audiofile.cpp
index 136938a1a5644f3f56dde8d3933ed6c89feff393..f11b43cbe634026c17109769bd71f6fff15ad5f9 100644
--- a/sflphone-common/src/audio/sound/audiofile.cpp
+++ b/sflphone-common/src/audio/sound/audiofile.cpp
@@ -63,7 +63,7 @@ AudioFile::loadFile (const std::string& filename, AudioCodec* codec , unsigned i
 
     // no filename to load
     if (filename.empty()) {
-        _debug ("Unable to open audio file: filename is empty\n");
+        _debug ("Unable to open audio file: filename is empty");
         return false;
     }
 
@@ -73,7 +73,7 @@ AudioFile::loadFile (const std::string& filename, AudioCodec* codec , unsigned i
 
     if (!file.is_open()) {
         // unable to load the file
-        _debug ("Unable to open audio file %s\n", filename.c_str());
+        _debug ("Unable to open audio file %s", filename.c_str());
         return false;
     }
 
diff --git a/sflphone-common/src/conference.cpp b/sflphone-common/src/conference.cpp
index 6266a30323c8d47f695e03eccd57c774634290cd..667664dfb6ff7bc66ead16cd08a5c353f5d882a8 100644
--- a/sflphone-common/src/conference.cpp
+++ b/sflphone-common/src/conference.cpp
@@ -71,7 +71,7 @@ void Conference::setState (ConferenceState state)
 void Conference::add (CallID participant_id)
 {
 
-    _debug ("---- Conference:: add participant %s\n", participant_id.c_str());
+    _debug ("---- Conference:: add participant %s", participant_id.c_str());
 
     _participants.insert (participant_id);
 
@@ -82,7 +82,7 @@ void Conference::add (CallID participant_id)
 void Conference::remove (CallID participant_id)
 {
 
-    _debug ("---- Conference::remove participant %s\n", participant_id.c_str());
+    _debug ("---- Conference::remove participant %s", participant_id.c_str());
 
     _participants.erase (participant_id);
 
@@ -100,7 +100,7 @@ void Conference::bindParticipant (CallID participant_id)
 
             if (participant_id != (*iter)) {
 
-                _debug ("---- Conference:: bind callid %s with %s in conference add\n", participant_id.c_str(), (*iter).c_str());
+                _debug ("---- Conference:: bind callid %s with %s in conference add", participant_id.c_str(), (*iter).c_str());
                 Manager::instance().getAudioDriver()->getMainBuffer()->bindCallID (participant_id, *iter);
             }
 
@@ -109,7 +109,7 @@ void Conference::bindParticipant (CallID participant_id)
 
     }
 
-    _debug ("---- Conference::bind callid %s with default_id in conference add\n", participant_id.c_str());
+    _debug ("---- Conference::bind callid %s with default_id in conference add", participant_id.c_str());
 
     Manager::instance().getAudioDriver()->getMainBuffer()->bindCallID (participant_id);
 
diff --git a/sflphone-common/src/config/config.cpp b/sflphone-common/src/config/config.cpp
index ec3f7bab8d0aef52ccd09d720cf020b1c3ce558e..80ede64799fada96e1fd74943e58132dac21f315 100644
--- a/sflphone-common/src/config/config.cpp
+++ b/sflphone-common/src/config/config.cpp
@@ -26,6 +26,7 @@
 #include <sys/stat.h>
 #include <errno.h>
 #include <iostream>
+#include <string.h>
 
 namespace Conf
 {
@@ -59,7 +60,7 @@ void ConfigTree::addDefaultValue (const std::pair<std::string, std::string>& tok
 
 std::string ConfigTree::getDefaultValue (const std::string& key)
 {
-    _debug ("Getting default value for %s\n", key.c_str());
+    _debug ("Getting default value for %s", key.c_str());
     std::map<std::string, std::string>::iterator it;
     it = _defaultValueMap.find (key);
 
@@ -147,7 +148,7 @@ ConfigTree::getConfigTreeItemValue (const std::string& section, const std::strin
         return item->getValue();
     }
 
-    _debug ("Option doesn't exist: [%s] %s\n", section.c_str(), itemName.c_str());
+    _debug ("Option doesn't exist: [%s] %s", section.c_str(), itemName.c_str());
 
     return getDefaultValue (itemName);
 }
@@ -292,7 +293,7 @@ ConfigTree::saveConfigTree (const std::string& fileName)
     file.close();
 
     if (chmod (fileName.c_str(), S_IRUSR | S_IWUSR)) {
-        _debug ("Failed to set permission on configuration file because: %s\n",strerror (errno));
+        _debug ("Failed to set permission on configuration file because: %s",strerror (errno));
     }
 
     return true;
@@ -373,7 +374,7 @@ ConfigTree::populateFromFile (const std::string& fileName)
     file.close();
 
     if (chmod (fileName.c_str(), S_IRUSR | S_IWUSR)) {
-        _debug ("Failed to set permission on configuration file because: %s\n",strerror (errno));
+        _debug ("Failed to set permission on configuration file because: %s",strerror (errno));
     }
 
     return 1;
diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp
index b57968d698c24761351eb5d7627a275b832e9c27..805731809da9df61d07278d481252adbc0085c20 100644
--- a/sflphone-common/src/dbus/callmanager.cpp
+++ b/sflphone-common/src/dbus/callmanager.cpp
@@ -39,31 +39,31 @@ CallManager::placeCall (const std::string& accountID,
                         const std::string& callID,
                         const std::string& to)
 {
-    _debug ("CallManager::placeCall received\n");
+    _debug ("CallManager::placeCall received");
     // Check if a destination number is available
 
-    if (to == "")   _debug ("No number entered - Call stopped\n");
+    if (to == "")   _debug ("No number entered - Call stopped");
     else            Manager::instance().outgoingCall (accountID, callID, to);
 }
 
 void
 CallManager::refuse (const std::string& callID)
 {
-    _debug ("CallManager::refuse received\n");
+    _debug ("CallManager::refuse received");
     Manager::instance().refuseCall (callID);
 }
 
 void
 CallManager::accept (const std::string& callID)
 {
-    _debug ("CallManager::accept received\n");
+    _debug ("CallManager::accept received");
     Manager::instance().answerCall (callID);
 }
 
 void
 CallManager::hangUp (const std::string& callID)
 {
-    _debug ("CallManager::hangUp received %s\n", callID.c_str());
+    _debug ("CallManager::hangUp received %s", callID.c_str());
     Manager::instance().hangupCall (callID);
 
 }
@@ -71,7 +71,7 @@ CallManager::hangUp (const std::string& callID)
 void
 CallManager::hangUpConference (const std::string& confID)
 {
-    _debug ("CallManager::hangUpConference received %s\n", confID.c_str());
+    _debug ("CallManager::hangUpConference received %s", confID.c_str());
     Manager::instance().hangupConference (confID);
 
 }
@@ -80,7 +80,7 @@ CallManager::hangUpConference (const std::string& confID)
 void
 CallManager::hold (const std::string& callID)
 {
-    _debug ("CallManager::hold received %s\n", callID.c_str());
+    _debug ("CallManager::hold received %s", callID.c_str());
     Manager::instance().onHoldCall (callID);
 
 }
@@ -88,14 +88,14 @@ CallManager::hold (const std::string& callID)
 void
 CallManager::unhold (const std::string& callID)
 {
-    _debug ("CallManager::unhold received %s\n", callID.c_str());
+    _debug ("CallManager::unhold received %s", callID.c_str());
     Manager::instance().offHoldCall (callID);
 }
 
 void
 CallManager::transfert (const std::string& callID, const std::string& to)
 {
-    _debug ("CallManager::transfert received\n");
+    _debug ("CallManager::transfert received");
     Manager::instance().transferCall (callID, to);
 }
 
@@ -104,7 +104,7 @@ CallManager::transfert (const std::string& callID, const std::string& to)
 void
 CallManager::setVolume (const std::string& device, const double& value)
 {
-    _debug ("CallManager::setVolume received\n");
+    _debug ("CallManager::setVolume received");
 
     if (device == "speaker") {
         Manager::instance().setSpkrVolume ( (int) (value*100.0));
@@ -118,13 +118,13 @@ CallManager::setVolume (const std::string& device, const double& value)
 double
 CallManager::getVolume (const std::string& device)
 {
-    _debug ("CallManager::getVolume received \n");
+    _debug ("CallManager::getVolume received ");
 
     if (device == "speaker") {
-        _debug ("Current speaker = %d\n", Manager::instance().getSpkrVolume());
+        _debug ("Current speaker = %d", Manager::instance().getSpkrVolume());
         return Manager::instance().getSpkrVolume() /100.0;
     } else if (device == "mic") {
-        _debug ("Current mic = %d\n", Manager::instance().getMicVolume());
+        _debug ("Current mic = %d", Manager::instance().getMicVolume());
         return Manager::instance().getMicVolume() /100.0;
     }
 
@@ -134,63 +134,63 @@ CallManager::getVolume (const std::string& device)
 void
 CallManager::joinParticipant (const std::string& sel_callID, const std::string& drag_callID)
 {
-    _debug ("CallManager::joinParticipant received %s, %s\n", sel_callID.c_str(), drag_callID.c_str());
+    _debug ("CallManager::joinParticipant received %s, %s", sel_callID.c_str(), drag_callID.c_str());
     Manager::instance().joinParticipant (sel_callID, drag_callID);
 }
 
 void
 CallManager::addParticipant (const std::string& callID, const std::string& confID)
 {
-    _debug ("CallManager::addParticipant received %s, %s\n", callID.c_str(), confID.c_str());
+    _debug ("CallManager::addParticipant received %s, %s", callID.c_str(), confID.c_str());
     Manager::instance().addParticipant (callID, confID);
 }
 
 void
 CallManager::addMainParticipant (const std::string& confID)
 {
-    _debug ("CallManager::addMainParticipant received %s\n", confID.c_str());
+    _debug ("CallManager::addMainParticipant received %s", confID.c_str());
     Manager::instance().addMainParticipant (confID);
 }
 
 void
 CallManager::detachParticipant (const std::string& callID)
 {
-    _debug ("CallManager::detachParticipant received %s\n", callID.c_str());
+    _debug ("CallManager::detachParticipant received %s", callID.c_str());
     Manager::instance().detachParticipant (callID, "");
 }
 
 void
 CallManager::joinConference (const std::string& sel_confID, const std::string& drag_confID)
 {
-    _debug ("CallManager::joinConference received %s, %s\n", sel_confID.c_str(), drag_confID.c_str());
+    _debug ("CallManager::joinConference received %s, %s", sel_confID.c_str(), drag_confID.c_str());
     Manager::instance().joinConference (sel_confID, drag_confID);
 }
 
 void
 CallManager::holdConference (const std::string& confID)
 {
-    _debug ("CallManager::holdConference received %s\n", confID.c_str());
+    _debug ("CallManager::holdConference received %s", confID.c_str());
     Manager::instance().holdConference (confID);
 }
 
 void
 CallManager::unholdConference (const std::string& confID)
 {
-    _debug ("CallManager::unHoldConference received %s\n", confID.c_str());
+    _debug ("CallManager::unHoldConference received %s", confID.c_str());
     Manager::instance().unHoldConference (confID);
 }
 
 std::map< std::string, std::string >
 CallManager::getConferenceDetails (const std::string& callID)
 {
-    _debug ("CallManager::getCallDetails received\n");
+    _debug ("CallManager::getCallDetails received");
     return Manager::instance().getConferenceDetails (callID);
 }
 
 std::vector< std::string >
 CallManager::getConferenceList (void)
 {
-    _debug ("CallManager::getConferenceList\n");
+    _debug ("CallManager::getConferenceList");
     return Manager::instance().getConferenceList();
 }
 
@@ -203,14 +203,14 @@ CallManager::getParticipantList (const std::string& confID)
 void
 CallManager::setRecording (const std::string& callID)
 {
-    _debug ("CallManager::setRecording received\n");
+    _debug ("CallManager::setRecording received");
     Manager::instance().setRecordingCall (callID);
 }
 
 bool
 CallManager::getIsRecording (const std::string& callID)
 {
-    _debug ("CallManager::getIsRecording received \n");
+    _debug ("CallManager::getIsRecording received ");
     return Manager::instance().isRecording (callID);
 }
 
@@ -218,7 +218,7 @@ CallManager::getIsRecording (const std::string& callID)
 std::string
 CallManager::getCurrentCodecName (const std::string& callID)
 {
-    _debug ("CallManager::getCurrentCodecName received %s \n",Manager::instance().getCurrentCodecName (callID).c_str());
+    _debug ("CallManager::getCurrentCodecName received %s ",Manager::instance().getCurrentCodecName (callID).c_str());
     return Manager::instance().getCurrentCodecName (callID).c_str();
 }
 
@@ -226,7 +226,7 @@ CallManager::getCurrentCodecName (const std::string& callID)
 std::map< std::string, std::string >
 CallManager::getCallDetails (const std::string& callID)
 {
-    _debug ("CallManager::getCallDetails received\n");
+    _debug ("CallManager::getCallDetails received");
     return Manager::instance().getCallDetails (callID);
 }
 
@@ -239,7 +239,7 @@ CallManager::getCallList (void)
 std::string
 CallManager::getCurrentCallID()
 {
-    _debug ("CallManager::getCurrentCallID received\n");
+    _debug ("CallManager::getCurrentCallID received");
     return Manager::instance().getCurrentCallId();
 }
 
@@ -271,7 +271,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
     link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL));
 
     if (link == NULL) {
-        _debug ("Failed to get sip link\n");
+        _debug ("Failed to get sip link");
         throw CallManagerException();
     }
 
@@ -281,7 +281,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
     audioRtp = call->getAudioRtp();
 
     if (audioRtp == NULL) {
-        _debug ("Failed to get AudioRtpFactory\n");
+        _debug ("Failed to get AudioRtpFactory");
         throw CallManagerException();
     }
 
@@ -290,7 +290,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
     zSession = audioRtp->getAudioZrtpSession();
 
     if (zSession == NULL) {
-        _debug ("Failed to get AudioZrtpSession\n");
+        _debug ("Failed to get AudioZrtpSession");
         throw CallManagerException();
     }
 
@@ -300,7 +300,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
 void
 CallManager::setSASVerified (const std::string& callID)
 {
-    _debug ("CallManager::setSASVerified received for account %s\n", callID.c_str());
+    _debug ("CallManager::setSASVerified received for account %s", callID.c_str());
 
     try {
         sfl::AudioZrtpSession * zSession;
@@ -315,7 +315,7 @@ CallManager::setSASVerified (const std::string& callID)
 void
 CallManager::resetSASVerified (const std::string& callID)
 {
-    _debug ("CallManager::resetSASVerified received for account %s\n", callID.c_str());
+    _debug ("CallManager::resetSASVerified received for account %s", callID.c_str());
 
     try {
         sfl::AudioZrtpSession * zSession;
@@ -330,7 +330,7 @@ CallManager::resetSASVerified (const std::string& callID)
 void
 CallManager::setConfirmGoClear (const std::string& callID)
 {
-    _debug ("CallManager::setConfirmGoClear received for account %s\n", callID.c_str());
+    _debug ("CallManager::setConfirmGoClear received for account %s", callID.c_str());
 
     try {
         sfl::AudioZrtpSession * zSession;
@@ -345,7 +345,7 @@ CallManager::setConfirmGoClear (const std::string& callID)
 void
 CallManager::requestGoClear (const std::string& callID)
 {
-    _debug ("CallManager::requestGoClear received for account %s\n", callID.c_str());
+    _debug ("CallManager::requestGoClear received for account %s", callID.c_str());
 
     try {
         sfl::AudioZrtpSession * zSession;
@@ -361,7 +361,7 @@ void
 CallManager::acceptEnrollment (const std::string& callID, const bool& accepted)
 {
 
-    _debug ("CallManager::acceptEnrollment received for account %s\n", callID.c_str());
+    _debug ("CallManager::acceptEnrollment received for account %s", callID.c_str());
 
     try {
         sfl::AudioZrtpSession * zSession;
@@ -377,7 +377,7 @@ void
 CallManager::setPBXEnrollment (const std::string& callID, const bool& yesNo)
 {
 
-    _debug ("CallManager::setPBXEnrollment received for account %s\n", callID.c_str());
+    _debug ("CallManager::setPBXEnrollment received for account %s", callID.c_str());
 
     try {
         sfl::AudioZrtpSession * zSession;
diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp
index 4f5e23df4759b2fd7752b6bffc5f6fd0dd6f164d..34fefc53164a6a7dd7c15c405acc2ced1237b034 100644
--- a/sflphone-common/src/dbus/configurationmanager.cpp
+++ b/sflphone-common/src/dbus/configurationmanager.cpp
@@ -38,14 +38,14 @@ ConfigurationManager::ConfigurationManager (DBus::Connection& connection)
 std::map< std::string, std::string >
 ConfigurationManager::getAccountDetails (const std::string& accountID)
 {
-    _debug ("ConfigurationManager::getAccountDetails\n");
+    _debug ("ConfigurationManager::getAccountDetails");
     return Manager::instance().getAccountDetails (accountID);
 }
 
 std::map< std::string, std::string >
 ConfigurationManager::getTlsSettingsDefault (void)
 {
-    _debug ("ConfigurationManager::getTlsDefaultSettings\n");
+    _debug ("ConfigurationManager::getTlsDefaultSettings");
 
     std::map<std::string, std::string> tlsSettingsDefault;
     tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_CA_LIST_FILE, ""));
@@ -270,7 +270,7 @@ ConfigurationManager::setTlsSettings (const std::string& section, const std::map
 std::map< std::string, std::string >
 ConfigurationManager::getCredential (const std::string& accountID, const int32_t& index)
 {
-    _debug ("ConfigurationManager::getCredential number %i for accountID %s\n", index, accountID.c_str());
+    _debug ("ConfigurationManager::getCredential number %i for accountID %s", index, accountID.c_str());
 
     std::string credentialIndex;
     std::stringstream streamOut;
@@ -294,7 +294,7 @@ ConfigurationManager::getCredential (const std::string& accountID, const int32_t
 int32_t
 ConfigurationManager::getNumberOfCredential (const std::string& accountID)
 {
-    _debug ("ConfigurationManager::getNumberOfCredential\n");
+    _debug ("ConfigurationManager::getNumberOfCredential");
     return Manager::instance().getConfigInt (accountID, CONFIG_CREDENTIAL_NUMBER);
 }
 
@@ -310,14 +310,14 @@ void
 ConfigurationManager::setCredential (const std::string& accountID, const int32_t& index,
                                      const std::map< std::string, std::string >& details)
 {
-    _debug ("ConfigurationManager::setCredential received\n");
+    _debug ("ConfigurationManager::setCredential received");
     Manager::instance().setCredential (accountID, index, details);
 }
 
 void
 ConfigurationManager::deleteAllCredential (const std::string& accountID)
 {
-    _debug ("ConfigurationManager::deleteAllCredential received\n");
+    _debug ("ConfigurationManager::deleteAllCredential received");
     Manager::instance().deleteAllCredential (accountID);
 }
 
@@ -325,21 +325,21 @@ void
 ConfigurationManager::setAccountDetails (const std::string& accountID,
         const std::map< std::string, std::string >& details)
 {
-    _debug ("ConfigurationManager::setAccountDetails received\n");
+    _debug ("ConfigurationManager::setAccountDetails received");
     Manager::instance().setAccountDetails (accountID, details);
 }
 
 void
 ConfigurationManager::sendRegister (const std::string& accountID, const int32_t& expire)
 {
-    _debug ("ConfigurationManager::sendRegister received\n");
+    _debug ("ConfigurationManager::sendRegister received");
     Manager::instance().sendRegister (accountID, expire);
 }
 
 std::string
 ConfigurationManager::addAccount (const std::map< std::string, std::string >& details)
 {
-    _debug ("ConfigurationManager::addAccount received\n");
+    _debug ("ConfigurationManager::addAccount received");
     return Manager::instance().addAccount (details);
 }
 
@@ -347,14 +347,14 @@ ConfigurationManager::addAccount (const std::map< std::string, std::string >& de
 void
 ConfigurationManager::removeAccount (const std::string& accoundID)
 {
-    _debug ("ConfigurationManager::removeAccount received\n");
+    _debug ("ConfigurationManager::removeAccount received");
     return Manager::instance().removeAccount (accoundID);
 }
 
 std::vector< std::string >
 ConfigurationManager::getAccountList()
 {
-    _debug ("ConfigurationManager::getAccountList received\n");
+    _debug ("ConfigurationManager::getAccountList received");
     return Manager::instance().getAccountList();
 }
 
@@ -363,7 +363,7 @@ std::vector< std::string >
 ConfigurationManager::getToneLocaleList()
 {
     std::vector< std::string > ret;
-    _debug ("ConfigurationManager::getToneLocaleList received\n");
+    _debug ("ConfigurationManager::getToneLocaleList received");
     return ret;
 }
 
@@ -372,7 +372,7 @@ std::string
 ConfigurationManager::getVersion()
 {
     std::string ret ("");
-    _debug ("ConfigurationManager::getVersion received\n");
+    _debug ("ConfigurationManager::getVersion received");
     return ret;
 }
 
@@ -381,7 +381,7 @@ std::vector< std::string >
 ConfigurationManager::getRingtoneList()
 {
     std::vector< std::string >  ret;
-    _debug ("ConfigurationManager::getRingtoneList received\n");
+    _debug ("ConfigurationManager::getRingtoneList received");
     return ret;
 }
 
@@ -390,14 +390,14 @@ ConfigurationManager::getRingtoneList()
 std::vector< std::string  >
 ConfigurationManager::getCodecList (void)
 {
-    _debug ("ConfigurationManager::getCodecList received\n");
+    _debug ("ConfigurationManager::getCodecList received");
     return Manager::instance().getCodecList();
 }
 
 std::vector<std::string>
 ConfigurationManager::getSupportedTlsMethod (void)
 {
-    _debug ("ConfigurationManager::getSupportedTlsMethod received\n");
+    _debug ("ConfigurationManager::getSupportedTlsMethod received");
     std::vector<std::string> method;
     method.push_back ("Default");
     method.push_back ("TLSv1");
@@ -410,21 +410,21 @@ ConfigurationManager::getSupportedTlsMethod (void)
 std::vector< std::string >
 ConfigurationManager::getCodecDetails (const int32_t& payload)
 {
-    _debug ("ConfigurationManager::getCodecDetails received\n");
+    _debug ("ConfigurationManager::getCodecDetails received");
     return Manager::instance().getCodecDetails (payload);
 }
 
 std::vector< std::string >
 ConfigurationManager::getActiveCodecList()
 {
-    _debug ("ConfigurationManager::getActiveCodecList received\n");
+    _debug ("ConfigurationManager::getActiveCodecList received");
     return Manager::instance().getActiveCodecList();
 }
 
 void
 ConfigurationManager::setActiveCodecList (const std::vector< std::string >& list)
 {
-    _debug ("ConfigurationManager::setActiveCodecList received\n");
+    _debug ("ConfigurationManager::setActiveCodecList received");
     Manager::instance().setActiveCodecList (list);
 }
 
@@ -432,77 +432,77 @@ ConfigurationManager::setActiveCodecList (const std::vector< std::string >& list
 std::vector< std::string >
 ConfigurationManager::getInputAudioPluginList()
 {
-    _debug ("ConfigurationManager::getInputAudioPluginList received\n");
+    _debug ("ConfigurationManager::getInputAudioPluginList received");
     return Manager::instance().getInputAudioPluginList();
 }
 
 std::vector< std::string >
 ConfigurationManager::getOutputAudioPluginList()
 {
-    _debug ("ConfigurationManager::getOutputAudioPluginList received\n");
+    _debug ("ConfigurationManager::getOutputAudioPluginList received");
     return Manager::instance().getOutputAudioPluginList();
 }
 
 void
 ConfigurationManager::setInputAudioPlugin (const std::string& audioPlugin)
 {
-    _debug ("ConfigurationManager::setInputAudioPlugin received\n");
+    _debug ("ConfigurationManager::setInputAudioPlugin received");
     return Manager::instance().setInputAudioPlugin (audioPlugin);
 }
 
 void
 ConfigurationManager::setOutputAudioPlugin (const std::string& audioPlugin)
 {
-    _debug ("ConfigurationManager::setOutputAudioPlugin received\n");
+    _debug ("ConfigurationManager::setOutputAudioPlugin received");
     return Manager::instance().setOutputAudioPlugin (audioPlugin);
 }
 
 std::vector< std::string >
 ConfigurationManager::getAudioOutputDeviceList()
 {
-    _debug ("ConfigurationManager::getAudioOutputDeviceList received\n");
+    _debug ("ConfigurationManager::getAudioOutputDeviceList received");
     return Manager::instance().getAudioOutputDeviceList();
 }
 
 void
 ConfigurationManager::setAudioOutputDevice (const int32_t& index)
 {
-    _debug ("ConfigurationManager::setAudioOutputDevice received\n");
+    _debug ("ConfigurationManager::setAudioOutputDevice received");
     return Manager::instance().setAudioOutputDevice (index);
 }
 
 std::vector< std::string >
 ConfigurationManager::getAudioInputDeviceList()
 {
-    _debug ("ConfigurationManager::getAudioInputDeviceList received\n");
+    _debug ("ConfigurationManager::getAudioInputDeviceList received");
     return Manager::instance().getAudioInputDeviceList();
 }
 
 void
 ConfigurationManager::setAudioInputDevice (const int32_t& index)
 {
-    _debug ("ConfigurationManager::setAudioInputDevice received\n");
+    _debug ("ConfigurationManager::setAudioInputDevice received");
     return Manager::instance().setAudioInputDevice (index);
 }
 
 std::vector< std::string >
 ConfigurationManager::getCurrentAudioDevicesIndex()
 {
-    _debug ("ConfigurationManager::getCurrentAudioDeviceIndex received\n");
+    _debug ("ConfigurationManager::getCurrentAudioDeviceIndex received");
     return Manager::instance().getCurrentAudioDevicesIndex();
 }
 
 int32_t
 ConfigurationManager::getAudioDeviceIndex (const std::string& name)
 {
-    _debug ("ConfigurationManager::getAudioDeviceIndex received\n");
+    _debug ("ConfigurationManager::getAudioDeviceIndex received");
     return Manager::instance().getAudioDeviceIndex (name);
 }
 
 std::string
 ConfigurationManager::getCurrentAudioOutputPlugin (void)
 {
-    _debug ("ConfigurationManager::getCurrentAudioOutputPlugin received\n");
+    _debug ("ConfigurationManager::getCurrentAudioOutputPlugin received");
     return Manager::instance().getCurrentAudioOutputPlugin();
 }
 
@@ -511,7 +511,7 @@ std::vector< std::string >
 ConfigurationManager::getPlaybackDeviceList()
 {
     std::vector< std::string >  ret;
-    _debug ("ConfigurationManager::getPlaybackDeviceList received\n");
+    _debug ("ConfigurationManager::getPlaybackDeviceList received");
     return ret;
 }
 
@@ -519,7 +519,7 @@ std::vector< std::string >
 ConfigurationManager::getRecordDeviceList()
 {
     std::vector< std::string >  ret;
-    _debug ("ConfigurationManager::getRecordDeviceList received\n");
+    _debug ("ConfigurationManager::getRecordDeviceList received");
     return ret;
 
 }
@@ -645,70 +645,70 @@ std::string ConfigurationManager::getHistoryEnabled (void)
 void
 ConfigurationManager::startHidden (void)
 {
-    _debug ("Manager received startHidden\n");
+    _debug ("Manager received startHidden");
     Manager::instance().startHidden();
 }
 
 int32_t
 ConfigurationManager::isStartHidden (void)
 {
-    _debug ("Manager received isStartHidden\n");
+    _debug ("Manager received isStartHidden");
     return Manager::instance().isStartHidden();
 }
 
 void
 ConfigurationManager::switchPopupMode (void)
 {
-    _debug ("Manager received switchPopupMode\n");
+    _debug ("Manager received switchPopupMode");
     Manager::instance().switchPopupMode();
 }
 
 int32_t
 ConfigurationManager::popupMode (void)
 {
-    _debug ("Manager received popupMode\n");
+    _debug ("Manager received popupMode");
     return Manager::instance().popupMode();
 }
 
 void
 ConfigurationManager::setNotify (void)
 {
-    _debug ("Manager received setNotify\n");
+    _debug ("Manager received setNotify");
     Manager::instance().setNotify();
 }
 
 int32_t
 ConfigurationManager::getNotify (void)
 {
-    _debug ("Manager received getNotify\n");
+    _debug ("Manager received getNotify");
     return Manager::instance().getNotify();
 }
 
 void
 ConfigurationManager::setAudioManager (const int32_t& api)
 {
-    _debug ("Manager received setAudioManager\n");
+    _debug ("Manager received setAudioManager");
     Manager::instance().setAudioManager (api);
 }
 
 int32_t
 ConfigurationManager::getAudioManager (void)
 {
-    _debug ("Manager received getAudioManager\n");
+    _debug ("Manager received getAudioManager");
     return Manager::instance().getAudioManager();
 }
 
 void
 ConfigurationManager::setMailNotify (void)
 {
-    _debug ("Manager received setMailNotify\n");
+    _debug ("Manager received setMailNotify");
     Manager::instance().setMailNotify();
 }
 
 int32_t
 ConfigurationManager::getMailNotify (void)
 {
-    _debug ("Manager received getMailNotify\n");
+    _debug ("Manager received getMailNotify");
     return Manager::instance().getMailNotify();
 }
 
@@ -723,7 +723,7 @@ ConfigurationManager::getSipAddress (void)
 void
 ConfigurationManager::setSipAddress (const std::string& address)
 {
-    _debug ("Manager received setSipAddress: %s\n", address.c_str());
+    _debug ("Manager received setSipAddress: %s", address.c_str());
     Manager::instance().setSipAddress (address);
 }
 
@@ -744,7 +744,7 @@ std::vector< std::string > ConfigurationManager::getAddressbookList (void)
 
 void ConfigurationManager::setAddressbookList (const std::vector< std::string >& list)
 {
-    _debug ("Manager received setAddressbookList\n") ;
+    _debug ("Manager received setAddressbookList") ;
     Manager::instance().setAddressbookList (list);
 }
 
@@ -775,7 +775,7 @@ void ConfigurationManager::setHistory (const std::map <std::string, std::string>
 
 std::vector<std::string> ConfigurationManager::getAllIpInterface (void)
 {
-    _debug ("ConfigurationManager::getAllIpInterface received\n");
+    _debug ("ConfigurationManager::getAllIpInterface received");
 
     std::vector<std::string> vector;
     SIPVoIPLink * sipLink = NULL;
diff --git a/sflphone-common/src/dbus/dbusmanagerimpl.cpp b/sflphone-common/src/dbus/dbusmanagerimpl.cpp
index fbe35e56f9990e3949e3c8fd3b3d88009f45d90a..61504e8782fa68c3c5b3ffddba638cccfed8cad7 100644
--- a/sflphone-common/src/dbus/dbusmanagerimpl.cpp
+++ b/sflphone-common/src/dbus/dbusmanagerimpl.cpp
@@ -46,7 +46,7 @@ DBusManagerImpl::exec()
     // Register accounts
     Manager::instance().initRegisterAccounts(); //getEvents();
 
-    _debug ("Starting DBus event loop\n");
+    _debug ("Starting DBus event loop");
     _dispatcher.enter();
 
     return 1;
diff --git a/sflphone-common/src/dbus/instance.cpp b/sflphone-common/src/dbus/instance.cpp
index 233978ae630d03f1425977a42a3ba1a1b309389c..e70322d6fc19c5426cd8037f4942a4c975a3a616 100644
--- a/sflphone-common/src/dbus/instance.cpp
+++ b/sflphone-common/src/dbus/instance.cpp
@@ -32,7 +32,7 @@ void
 Instance::Register (const int32_t& pid UNUSED,
                     const std::string& name UNUSED)
 {
-    _debug ("Instance::register received\n");
+    _debug ("Instance::register received");
     count++;
 }
 
@@ -40,7 +40,7 @@ Instance::Register (const int32_t& pid UNUSED,
 void
 Instance::Unregister (const int32_t& pid UNUSED)
 {
-    _debug ("Instance::unregister received\n");
+    _debug ("Instance::unregister received");
     count --;
 
     if (count <= 0) {
diff --git a/sflphone-common/src/history/historymanager.cpp b/sflphone-common/src/history/historymanager.cpp
index d56d3f67155aa3cd67a2b4bc380a3bf7c3f50170..9ea8f933d35495dedaaf444c24642ee18520ac18 100644
--- a/sflphone-common/src/history/historymanager.cpp
+++ b/sflphone-common/src/history/historymanager.cpp
@@ -109,7 +109,7 @@ int HistoryManager::load_history_items_map (Conf::ConfigTree *history_list, int
 
 bool HistoryManager::save_history_to_file (Conf::ConfigTree *history_list)
 {
-    _debug ("Saving history in XDG directory: %s\n", _history_path.data());
+    _debug ("Saving history in XDG directory: %s", _history_path.data());
     return  history_list->saveConfigTree (_history_path.data());
 }
 
@@ -165,7 +165,7 @@ int HistoryManager::create_history_path (std::string path)
         if (mkdir (userdata.data(), 0755) != 0) {
             // If directory	creation failed
             if (errno != EEXIST) {
-                _debug ("Cannot create directory: %s\n", strerror (errno));
+                _debug ("Cannot create directory: %s", strerror (errno));
                 return -1;
             }
         }
diff --git a/sflphone-common/src/iax/iaxcall.cpp b/sflphone-common/src/iax/iaxcall.cpp
index 93ecdcdfdb26cc88876e73f06360ba0b817323b1..04899f17bc61bb3eb092ce9ba8bbaeb3a6c12d5d 100644
--- a/sflphone-common/src/iax/iaxcall.cpp
+++ b/sflphone-common/src/iax/iaxcall.cpp
@@ -40,37 +40,37 @@ IAXCall::setFormat (int format)
     switch (format) {
 
         case AST_FORMAT_ULAW:
-            printf ("PCMU\n");
+            printf ("PCMU");
             setAudioCodec (PAYLOAD_CODEC_ULAW);
             break;
 
         case AST_FORMAT_GSM:
-            printf ("GSM\n");
+            printf ("GSM");
             setAudioCodec (PAYLOAD_CODEC_GSM);
             break;
 
         case AST_FORMAT_ALAW:
-            printf ("ALAW\n");
+            printf ("ALAW");
             setAudioCodec (PAYLOAD_CODEC_ALAW);
             break;
 
         case AST_FORMAT_ILBC:
-            printf ("ILBC\n");
+            printf ("ILBC");
             setAudioCodec (PAYLOAD_CODEC_ILBC_20);
             break;
 
         case AST_FORMAT_SPEEX:
-            printf ("SPEEX\n");
+            printf ("SPEEX");
             setAudioCodec (PAYLOAD_CODEC_SPEEX_8000);
             break;
 
         default:
-            printf ("Error audio codec type %i not supported!\n", format);
+            printf ("Error audio codec type %i not supported!", format);
             setAudioCodec ( (AudioCodecType) -1);
             break;
     }
 
-    printf ("\n");
+    printf ("");
 }
 
 
@@ -118,7 +118,7 @@ IAXCall::getSupportedFormat()
         }
     }
 
-    printf ("\n");
+    printf ("");
 
     return format;
 
@@ -137,27 +137,27 @@ IAXCall::getFirstMatchingFormat (int needles)
         switch (map[iter]) {
 
             case PAYLOAD_CODEC_ULAW:
-                printf ("PCMU\n");
+                printf ("PCMU");
                 format = AST_FORMAT_ULAW;
                 break;
 
             case PAYLOAD_CODEC_GSM:
-                printf ("GSM\n");
+                printf ("GSM");
                 format = AST_FORMAT_GSM;
                 break;
 
             case PAYLOAD_CODEC_ALAW:
-                printf ("PCMA\n");
+                printf ("PCMA");
                 format = AST_FORMAT_ALAW;
                 break;
 
             case PAYLOAD_CODEC_ILBC_20:
-                printf ("ILBC\n");
+                printf ("ILBC");
                 format = AST_FORMAT_ILBC;
                 break;
 
             case PAYLOAD_CODEC_SPEEX_8000:
-                printf ("SPEEX\n");
+                printf ("SPEEX");
                 format = AST_FORMAT_SPEEX;
                 break;
 
@@ -171,7 +171,7 @@ IAXCall::getFirstMatchingFormat (int needles)
 
     }
 
-    printf ("\n");
+    printf ("");
 
     return 0;
 }
diff --git a/sflphone-common/src/iax/iaxvoiplink.cpp b/sflphone-common/src/iax/iaxvoiplink.cpp
index fd486a14fe6f61801732d57916205c5ab612a71b..bc41b6e1668f854532cd76e3bc3a46a47d87b5a8 100644
--- a/sflphone-common/src/iax/iaxvoiplink.cpp
+++ b/sflphone-common/src/iax/iaxvoiplink.cpp
@@ -37,13 +37,13 @@
 
 #define MUSIC_ONHOLD true
 
-#define CHK_VALID_CALL   if (call == NULL) { _debug("IAX: Call doesn't exists\n"); \
+#define CHK_VALID_CALL   if (call == NULL) { _debug("IAX: Call doesn't exists"); \
 	return false; }
 
 IAXVoIPLink::IAXVoIPLink (const AccountID& accountID)
         : VoIPLink (accountID)
 {
-    // _debug("IAXVoIPLink::IAXVoIPLink : creating eventhread \n ");
+    // _debug("IAXVoIPLink::IAXVoIPLink : creating eventhread  ");
     _evThread = new EventThread (this);
     _regSession = NULL;
     _nextRefreshStamp = 0;
@@ -116,13 +116,13 @@ IAXVoIPLink::init()
         port = iax_init (port);
 
         if (port < 0) {
-            _debug ("IAX Warning: already initialize on port %d\n", last_port);
+            _debug ("IAX Warning: already initialize on port %d", last_port);
             port = RANDOM_IAX_PORT;
         } else if (port == IAX_FAILURE) {
             _debug ("IAX Fail to start on port %d", last_port);
             port = RANDOM_IAX_PORT;
         } else {
-            _debug ("IAX Info: listening on port %d\n", last_port);
+            _debug ("IAX Info: listening on port %d", last_port);
             _localPort = last_port;
             returnValue = true;
             _evThread->start();
@@ -141,7 +141,7 @@ IAXVoIPLink::init()
     }
 
     if (port == IAX_FAILURE || nbTry==0) {
-        _debug ("Fail to initialize iax\n");
+        _debug ("Fail to initialize iax");
 
         initDone (false);
     }
@@ -195,7 +195,7 @@ void IAXVoIPLink::terminateOneCall (const CallID& id)
     IAXCall* call = getIAXCall (id);
 
     if (call) {
-        _debug ("IAXVoIPLink::terminateOneCall()::the call is deleted, should close recording file \n");
+        _debug ("IAXVoIPLink::terminateOneCall()::the call is deleted, should close recording file ");
         delete call;
         call = 0;
     }
@@ -218,7 +218,7 @@ IAXVoIPLink::getEvent()
             continue;
         }
 
-        //_debug ("Receive IAX Event: %d (0x%x)\n", event->etype, event->etype);
+        //_debug ("Receive IAX Event: %d (0x%x)", event->etype, event->etype);
 
         call = iaxFindCallBySession (event->session);
 
@@ -234,7 +234,7 @@ IAXVoIPLink::getEvent()
             iaxHandlePrecallEvent (event);
         }
 
-        // _debug("IAXVoIPLink::getEvent() : timestamp %i \n",event->ts);
+        // _debug("IAXVoIPLink::getEvent() : timestamp %i ",event->ts);
 
         iax_event_free (event);
     }
@@ -263,8 +263,8 @@ IAXVoIPLink::getEvent()
     if ( (Manager::instance().incomingCallWaiting() > 0) && Manager::instance().hasCurrentCall()) {
 
         int countTime_modulo = countTime % 4000;
-        // _debug("countTime: %i\n", countTime);
-        // _debug("countTime_modulo: %i\n", countTime_modulo);
+        // _debug("countTime: %i", countTime);
+        // _debug("countTime_modulo: %i", countTime_modulo);
 
         if ( (countTime_modulo - countTime) < 0) {
             Manager::instance().notificationIncomingCall();
@@ -317,7 +317,7 @@ IAXVoIPLink::sendAudioFromMic (void)
 
                 if (ac && audiolayer) {
 
-                    // _debug("Send sound\n");
+                    // _debug("Send sound");
                     // audiolayer->getMainBuffer()->flush(currentCall->getCallId());
 
                     audiolayer->getMainBuffer()->setInternalSamplingRate (ac->getClockRate());
@@ -366,7 +366,7 @@ IAXVoIPLink::sendAudioFromMic (void)
                         // Make sure the session and the call still exists.
                         if (currentCall->getSession() && micDataEncoded != NULL) {
                             if (iax_send_voice (currentCall->getSession(), currentCall->getFormat(), micDataEncoded, compSize, nbSample_) == -1) {
-                                _debug ("IAX: Error sending voice data.\n");
+                                _debug ("IAX: Error sending voice data.");
                             }
                         }
 
@@ -426,9 +426,9 @@ IAXVoIPLink::sendRegister (AccountID id)
     if (!_regSession) {
         _debug ("Error when generating new session for register");
     } else {
-        _debug ("IAX Sending registration to %s with user %s\n", account->getHostname().c_str() , account->getUsername().c_str());
+        _debug ("IAX Sending registration to %s with user %s", account->getHostname().c_str() , account->getUsername().c_str());
         int val = iax_register (_regSession, account->getHostname().data(), account->getUsername().data(), account->getPassword().data(), 120);
-        _debug ("Return value: %d\n", val);
+        _debug ("Return value: %d", val);
         // set the time-out to 15 seconds, after that, resend a registration request.
         // until we unregister.
         _nextRefreshStamp = time (NULL) + 10;
@@ -466,7 +466,7 @@ IAXVoIPLink::sendUnregister (AccountID id)
 
     _nextRefreshStamp = 0;
 
-    _debug ("IAX2 send unregister\n");
+    _debug ("IAX2 send unregister");
     account->setRegistrationState (Unregistered);
 
     return SUCCESS;
@@ -522,7 +522,7 @@ IAXVoIPLink::answer (const CallID& id)
 bool
 IAXVoIPLink::hangup (const CallID& id)
 {
-    _debug ("IAXVoIPLink::hangup() : function called once hangup \n");
+    _debug ("IAXVoIPLink::hangup() : function called once hangup ");
     IAXCall* call = getIAXCall (id);
     std::string reason = "Dumped Call";
     CHK_VALID_CALL;
@@ -550,7 +550,7 @@ IAXVoIPLink::hangup (const CallID& id)
 bool
 IAXVoIPLink::peerHungup (const CallID& id)
 {
-    _debug ("IAXVoIPLink::peerHangup() : function called once hangup \n");
+    _debug ("IAXVoIPLink::peerHangup() : function called once hangup ");
     IAXCall* call = getIAXCall (id);
     std::string reason = "Dumped Call";
     CHK_VALID_CALL;
@@ -584,7 +584,7 @@ IAXVoIPLink::onhold (const CallID& id)
 
     audiolayer->getMainBuffer()->unBindAll (call->getCallId());
 
-    //if (call->getState() == Call::Hold) { _debug("Call is already on hold\n"); return false; }
+    //if (call->getState() == Call::Hold) { _debug("Call is already on hold"); return false; }
 
     _mutexIAX.enterMutex();
     iax_quelch_moh (call->getSession() , MUSIC_ONHOLD);
@@ -603,7 +603,7 @@ IAXVoIPLink::offhold (const CallID& id)
 
     Manager::instance().addStream (call->getCallId());
 
-    //if (call->getState() == Call::Active) { _debug("Call is already active\n"); return false; }
+    //if (call->getState() == Call::Active) { _debug("Call is already active"); return false; }
     _mutexIAX.enterMutex();
     iax_unquelch (call->getSession());
     _mutexIAX.leaveMutex();
@@ -700,7 +700,7 @@ IAXVoIPLink::iaxOutgoingInvite (IAXCall* call)
     newsession = iax_session_new();
 
     if (!newsession) {
-        _debug ("IAX Error: Can't make new session for a new call\n");
+        _debug ("IAX Error: Can't make new session for a new call");
         return false;
     }
 
@@ -715,7 +715,7 @@ IAXVoIPLink::iaxOutgoingInvite (IAXCall* call)
     audio_format_preferred =  call->getFirstMatchingFormat (call->getSupportedFormat());
     audio_format_capability = call->getSupportedFormat();
 
-    _debug ("IAX New call: %s\n", strNum.c_str());
+    _debug ("IAX New call: %s", strNum.c_str());
     iax_call (newsession, username.c_str(), username.c_str(), strNum.c_str(), lang, wait, audio_format_preferred, audio_format_capability);
 
     return true;
@@ -798,10 +798,10 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
             _debug ("IAX_EVENT_ACCEPT: codec format: ");
 
             if (event->ies.format) {
-                printf ("%i\n", event->ies.format);
+                printf ("%i", event->ies.format);
                 call->setFormat (event->ies.format);
             } else {
-                printf ("no codec format\n");
+                printf ("no codec format");
             }
 
             break;
@@ -820,12 +820,12 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
 
                 if (event->ies.format) {
                     // Should not get here, should have been set in EVENT_ACCEPT
-                    printf ("%i\n", event->ies.format);
+                    printf ("%i", event->ies.format);
                     call->setFormat (event->ies.format);
                 }
 
                 {
-                    printf ("no codec format\n");
+                    printf ("no codec format");
                 }
 
                 Manager::instance().peerAnsweredCall (id);
@@ -849,7 +849,7 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
         case IAX_EVENT_VOICE:
             //if (!audiolayer->isCaptureActive ())
             //  audiolayer->startStream ();
-            // _debug("IAX_EVENT_VOICE: \n");
+            // _debug("IAX_EVENT_VOICE: ");
             iaxHandleVoiceEvent (event, call);
             break;
 
@@ -871,7 +871,7 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
 
             if (Manager::instance().getConfigString (HOOKS, URLHOOK_IAX2_ENABLED) == "1") {
                 if (strcmp ( (char*) event->data, "") != 0) {
-                    _debug ("> IAX_EVENT_URL received: %s\n", event->data);
+                    _debug ("> IAX_EVENT_URL received: %s", event->data);
                     urlhook->addAction ( (char*) event->data, Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND));
                 }
             }
@@ -885,7 +885,7 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
             break;
 
         default:
-            _debug ("iaxHandleCallEvent: Unknown event type (in call event): %d\n", event->etype);
+            _debug ("iaxHandleCallEvent: Unknown event type (in call event): %d", event->etype);
 
     }
 }
@@ -906,7 +906,7 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
 
     if (!event->datalen) {
         // Skip this empty packet.
-        //_debug("IAX: Skipping empty jitter-buffer interpolated packet\n");
+        //_debug("IAX: Skipping empty jitter-buffer interpolated packet");
         return;
     }
 
@@ -929,11 +929,11 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
         // - subclass holds the voiceformat property.
 
         if (event->subclass && event->subclass != call->getFormat()) {
-            _debug ("iaxHandleVoiceEvent: no format found in call setting it to %i\n", event->subclass);
+            _debug ("iaxHandleVoiceEvent: no format found in call setting it to %i", event->subclass);
             call->setFormat (event->subclass);
         }
 
-        //_debug("Receive: len=%d, format=%d, _receiveDataDecoded=%p\n", event->datalen, call->getFormat(), _receiveDataDecoded);
+        //_debug("Receive: len=%d, format=%d, _receiveDataDecoded=%p", event->datalen, call->getFormat(), _receiveDataDecoded);
         // ac = call->getCodecMap().getCodec (call -> getAudioCodec());
 
         data = (unsigned char*) event->data;
@@ -944,7 +944,7 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
         max = (int) (ac->getClockRate() * audiolayer->getFrameSize() / 1000);
 
         if (size > max) {
-            _debug ("The size %d is bigger than expected %d. Packet cropped. Ouch!\n", size, max);
+            _debug ("The size %d is bigger than expected %d. Packet cropped. Ouch!", size, max);
             size = max;
         }
 
@@ -953,7 +953,7 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
         nbInt16      = expandedSize/sizeof (int16);
 
         if (nbInt16 > max) {
-            _debug ("We have decoded an IAX VOICE packet larger than expected: %i VS %i. Cropping.\n", nbInt16, max);
+            _debug ("We have decoded an IAX VOICE packet larger than expected: %i VS %i. Cropping.", nbInt16, max);
             nbInt16 = max;
         }
 
@@ -1012,7 +1012,7 @@ IAXVoIPLink::iaxHandleRegReply (iax_event* event)
         // Looking for the voicemail information
         //if( event->ies != 0 )
         //new_voicemails = processIAXMsgCount(event->ies.msgcount);
-        //_debug("iax voicemail number notification: %i\n", new_voicemails);
+        //_debug("iax voicemail number notification: %i", new_voicemails);
         // Notify the client if new voicemail waiting for the current account
         //account_id = getAccountID();
         //Manager::instance().startVoiceMessageNotification(account_id.c_str(), new_voicemails);
@@ -1062,18 +1062,18 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event)
         case IAX_EVENT_REGACK:
 
         case IAX_EVENT_REGREJ:
-            _debug ("IAX Registration Event in a pre-call setup\n");
+            _debug ("IAX Registration Event in a pre-call setup");
             break;
 
         case IAX_EVENT_REGREQ:
             // Received when someone wants to register to us!?!
             // Asterisk receives and answers to that, not us, we're a phone.
-            _debug ("Registration by a peer, don't allow it\n");
+            _debug ("Registration by a peer, don't allow it");
             break;
 
         case IAX_EVENT_CONNECT:
             // We've got an incoming call! Yikes!
-            _debug ("> IAX_EVENT_CONNECT (receive)\n");
+            _debug ("> IAX_EVENT_CONNECT (receive)");
 
             id = Manager::instance().getNewCallID();
 
@@ -1152,11 +1152,11 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event)
             break;
 
         case IAX_IE_MSGCOUNT:
-            //_debug("messssssssssssssssssssssssssssssssssssssssssssssssages\n");
+            //_debug("messssssssssssssssssssssssssssssssssssssssssssssssages");
             break;
 
         default:
-            _debug ("IAXVoIPLink::iaxHandlePrecallEvent: Unknown event type (in precall): %d\n", event->etype);
+            _debug ("IAXVoIPLink::iaxHandlePrecallEvent: Unknown event type (in precall): %d", event->etype);
     }
 
 }
diff --git a/sflphone-common/src/main.cpp b/sflphone-common/src/main.cpp
index d023997021f9fc7d892ce88346a161ce1b940622..72e2714e40769a9de3a1176b1618f358b9fb71a9 100644
--- a/sflphone-common/src/main.cpp
+++ b/sflphone-common/src/main.cpp
@@ -46,11 +46,11 @@ main (int argc, char **argv)
     if (argc == 2 && strcmp (argv[1], "--help") == 0) {
 
 
-        printf ("%1$s Daemon %2$s, by Savoir-Faire Linux 2004-2009\n\n",
+        printf ("%1$s Daemon %2$s, by Savoir-Faire Linux 2004-2009",
                 PROGNAME,
                 SFLPHONED_VERSION);
-        printf ("USAGE: sflphoned [--help]\nParameters: \n  --help\tfor this message\n\n  --port=3999\tchange the session port\n\n");
-        printf ("See http://www.sflphone.org/ for more information\n");
+        printf ("USAGE: sflphoned [--help]Parameters:   --help\tfor this message  --port=3999\tchange the session port");
+        printf ("See http://www.sflphone.org/ for more information");
 
     } else {
         FILE *fp;
@@ -84,7 +84,7 @@ main (int argc, char **argv)
             if ( (dir = opendir (sfldir)) == NULL) {
                 //Create it
                 if (mkdir (sfldir, 0755) != 0) {
-                    fprintf (stderr, "Creating directory %s failed. Exited.\n", sfldir);
+                    fprintf (stderr, "Creating directory %s failed. Exited.", sfldir);
                     exit (-1);
                 }
             }
@@ -95,14 +95,14 @@ main (int argc, char **argv)
             if ( (dir = opendir (sfldir)) == NULL) {
                 //Create it
                 if (mkdir (sfldir, 0755) != 0) {
-                    fprintf (stderr, "Creating directory %s failed. Exited.\n", sfldir);
+                    fprintf (stderr, "Creating directory %s failed. Exited.", sfldir);
                     exit (-1);
                 }
             }
 
             // PID file doesn't exists, create and write pid in it
             if ( (fp = fopen (homepid,"w")) == NULL) {
-                fprintf (stderr, "Creating PID file %s failed. Exited.\n", homepid);
+                fprintf (stderr, "Creating PID file %s failed. Exited.", homepid);
                 exit (-1);
             } else {
                 fputs (cPid , fp);
@@ -119,11 +119,11 @@ main (int argc, char **argv)
                 fclose (fp);
 
                 if (kill (atoi (cOldPid), 0) == SUCCESS) {
-                    fprintf (stderr, "There is already a sflphoned daemon running in the system. Starting Failed.\n");
+                    fprintf (stderr, "There is already a sflphoned daemon running in the system. Starting Failed.");
                     exit (-1);
                 } else {
                     if ( (fp = fopen (homepid,"w")) == NULL) {
-                        fprintf (stderr, "Writing to PID file %s failed. Exited.\n", homepid);
+                        fprintf (stderr, "Writing to PID file %s failed. Exited.", homepid);
                         exit (-1);
                     } else {
                         fputs (cPid , fp);
@@ -155,7 +155,7 @@ main (int argc, char **argv)
             std::cerr << e.what() << std::endl;
             exit_code = -1;
         } catch (...) {
-            fprintf (stderr, "An exception occured when initializing the system.\n");
+            fprintf (stderr, "An exception occured when initializing the system.");
             exit_code = -1;
         }
 
diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index e8df4d0c8dc363ce372fcacde3bbb9b2a0c88cc9..324ca8c76f3ad47fe68ea8132e29dbc097abdc3a 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -114,7 +114,7 @@ ManagerImpl::~ManagerImpl (void)
     // terminate();
     delete _cleaner;
     _cleaner=0;
-    _debug ("%s stop correctly.\n", PROGNAME);
+    _debug ("%s stop correctly.", PROGNAME);
 }
 
 void
@@ -126,7 +126,7 @@ ManagerImpl::init()
     initVolume();
 
     if (_exist == 0) {
-        _debug ("Cannot create config file in your home directory\n");
+        _debug ("Cannot create config file in your home directory");
     }
 
     initAudioDriver();
@@ -159,23 +159,23 @@ ManagerImpl::init()
 
 void ManagerImpl::terminate()
 {
-    _debug ("ManagerImpl::terminate \n");
+    _debug ("ManagerImpl::terminate ");
     saveConfig();
 
     unloadAccountMap();
 
-    _debug ("Unload DTMF Key \n");
+    _debug ("Unload DTMF Key ");
     delete _dtmfKey;
 
-    _debug ("Unload Audio Driver \n");
+    _debug ("Unload Audio Driver ");
     delete _audiodriver;
     _audiodriver = NULL;
 
-    _debug ("Unload Telephone Tone \n");
+    _debug ("Unload Telephone Tone ");
     delete _telephoneTone;
     _telephoneTone = NULL;
 
-    _debug ("Unload Audio Codecs \n");
+    _debug ("Unload Audio Codecs ");
     _codecDescriptorMap.deleteHandlePointer();
 
 }
@@ -189,7 +189,7 @@ ManagerImpl::isCurrentCall (const CallID& callId)
 bool
 ManagerImpl::hasCurrentCall()
 {
-    // _debug ("ManagerImpl::hasCurrentCall current call ID = %s\n", _currentCallId2.c_str());
+    // _debug ("ManagerImpl::hasCurrentCall current call ID = %s", _currentCallId2.c_str());
 
     if (_currentCallId2 != "") {
         return true;
@@ -208,7 +208,7 @@ void
 ManagerImpl::switchCall (const CallID& id)
 {
     ost::MutexLock m (_currentCallMutex);
-    _debug ("----- Switch current call id to %s -----\n", id.c_str());
+    _debug ("----- Switch current call id to %s -----", id.c_str());
     _currentCallId2 = id;
 
     /*
@@ -223,7 +223,7 @@ ManagerImpl::switchCall (const CallID& id)
         ConferenceMap::iterator iter = _conferencemap.find(id);
         if(iter != _conferencemap.end())
         {
-    	_debug("    set call recordable in audio layer\n");
+    	_debug("    set call recordable in audio layer");
     	conf = iter->second;
     	al->setRecorderInstance((Recordable*)conf);
         }
@@ -237,7 +237,7 @@ ManagerImpl::switchCall (const CallID& id)
         Call *call = NULL;
         call = getAccountLink (account_id)->getCall(id);
 
-        _debug("    set call recordable in audio layer\n");
+        _debug("    set call recordable in audio layer");
         al->setRecorderInstance((Recordable*)call);
     }
     }
@@ -257,7 +257,7 @@ ManagerImpl::outgoingCall (const std::string& account_id, const CallID& call_id,
     Call::CallConfiguration callConfig;
     SIPVoIPLink *siplink;
 
-    _debug ("ManagerImpl::outgoingCall(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::outgoingCall(%s)", call_id.c_str());
 
     CallID current_call_id = getCurrentCallId();
 
@@ -274,21 +274,21 @@ ManagerImpl::outgoingCall (const std::string& account_id, const CallID& call_id,
     // in any cases we have to detach from current communication
     if (hasCurrentCall()) {
 
-        _debug ("    outgoingCall: Has current call (%s) put it onhold\n", current_call_id.c_str());
+        _debug ("    outgoingCall: Has current call (%s) put it onhold", current_call_id.c_str());
 
         // if this is not a conferenceand this and is not a conference participant
 
         if (!isConference (current_call_id) && !participToConference (current_call_id)) {
-            _debug ("    outgoingCall: Put the current call (%s) on hold\n", current_call_id.c_str());
+            _debug ("    outgoingCall: Put the current call (%s) on hold", current_call_id.c_str());
             onHoldCall (current_call_id);
         } else if (isConference (current_call_id) && !participToConference (call_id)) {
-            _debug ("    outgoingCall: detach main participant from conference\n");
+            _debug ("    outgoingCall: detach main participant from conference");
             detachParticipant (default_id, current_call_id);
         }
     }
 
     if (callConfig == Call::IPtoIP) {
-        _debug ("    outgoingCall: Start IP to IP call\n");
+        _debug ("    outgoingCall: Start IP to IP call");
         /* We need to retrieve the sip voiplink instance */
         siplink = SIPVoIPLink::instance ("");
 
@@ -303,17 +303,17 @@ ManagerImpl::outgoingCall (const std::string& account_id, const CallID& call_id,
     }
 
     if (!accountExists (account_id)) {
-        _debug ("! Manager Error: Outgoing Call: account doesn't exist\n");
+        _debug ("! Manager Error: Outgoing Call: account doesn't exist");
         return false;
     }
 
     if (getAccountFromCall (call_id) != AccountNULL) {
-        _debug ("! Manager Error: Outgoing Call: call id already exists\n");
+        _debug ("! Manager Error: Outgoing Call: call id already exists");
         return false;
     }
 
 
-    _debug ("- Manager Action: Adding Outgoing Call %s on account %s\n", call_id.data(), account_id.data());
+    _debug ("- Manager Action: Adding Outgoing Call %s on account %s", call_id.data(), account_id.data());
 
     associateCallToAccount (call_id, account_id);
 
@@ -322,7 +322,7 @@ ManagerImpl::outgoingCall (const std::string& account_id, const CallID& call_id,
         return true;
     } else {
         callFailure (call_id);
-        _debug ("! Manager Error: An error occur, the call was not created\n");
+        _debug ("! Manager Error: An error occur, the call was not created");
     }
 
     return false;
@@ -333,7 +333,7 @@ bool
 ManagerImpl::answerCall (const CallID& call_id)
 {
 
-    _debug ("ManagerImpl::answerCall(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::answerCall(%s)", call_id.c_str());
 
     stopTone (true);
 
@@ -343,7 +343,7 @@ ManagerImpl::answerCall (const CallID& call_id)
     AccountID account_id = getAccountFromCall (call_id);
 
     if (account_id == AccountNULL) {
-        _debug ("    answerCall: AccountId is null\n");
+        _debug ("    answerCall: AccountId is null");
     }
 
     Call* call = NULL;
@@ -351,23 +351,23 @@ ManagerImpl::answerCall (const CallID& call_id)
     call = getAccountLink (account_id)->getCall (call_id);
 
     if (call == NULL) {
-        _debug ("    answerCall: Call is null\n");
+        _debug ("    answerCall: Call is null");
     }
 
     // in any cases we have to detach from current communication
     if (hasCurrentCall()) {
 
-        _debug ("    answerCall: Currently conversing with %s\n", current_call_id.c_str());
+        _debug ("    answerCall: Currently conversing with %s", current_call_id.c_str());
         // if it is not a conference and is not a conference participant
 
         if (!isConference (current_call_id) && !participToConference (current_call_id)) {
-            _debug ("    answerCall: Put the current call (%s) on hold\n", current_call_id.c_str());
+            _debug ("    answerCall: Put the current call (%s) on hold", current_call_id.c_str());
             onHoldCall (current_call_id);
         }
 
         // if we are talking to a conference and we are answering an incoming call
         else if (isConference (current_call_id) && !participToConference (call_id)) {
-            _debug ("    answerCall: Detach main participant from conference\n");
+            _debug ("    answerCall: Detach main participant from conference");
             detachParticipant (default_id, current_call_id);
         }
 
@@ -409,7 +409,7 @@ ManagerImpl::answerCall (const CallID& call_id)
 bool
 ManagerImpl::hangupCall (const CallID& call_id)
 {
-    _debug ("ManagerImpl::hangupCall(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::hangupCall(%s)", call_id.c_str());
     PulseLayer *pulselayer;
     AccountID account_id;
     bool returnValue;
@@ -422,7 +422,7 @@ ManagerImpl::hangupCall (const CallID& call_id)
     // switchCall (call_id);
 
     /* Broadcast a signal over DBus */
-    _debug ("    hangupCall: Send DBUS call state change (HUNGUP) for id %s\n", call_id.c_str());
+    _debug ("    hangupCall: Send DBUS call state change (HUNGUP) for id %s", call_id.c_str());
 
     if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HUNGUP");
 
@@ -432,7 +432,7 @@ ManagerImpl::hangupCall (const CallID& call_id)
 
     // stop streams
     if (audiolayer && (nbCalls <= 1)) {
-        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls);
+        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls);
         audiolayer->stopStream();
     }
 
@@ -463,7 +463,7 @@ ManagerImpl::hangupCall (const CallID& call_id)
         account_id = getAccountFromCall (call_id);
 
         if (account_id == AccountNULL) {
-            _debug ("! Manager Hangup Call: Call doesn't exists\n");
+            _debug ("! Manager Hangup Call: Call doesn't exists");
             return false;
         }
 
@@ -483,7 +483,7 @@ ManagerImpl::hangupCall (const CallID& call_id)
 bool
 ManagerImpl::hangupConference (const ConfID& id)
 {
-    _debug ("ManagerImpl::hangupConference()\n");
+    _debug ("ManagerImpl::hangupConference()");
 
     Conference *conf;
     ConferenceMap::iterator iter_conf = _conferencemap.find (id);
@@ -500,7 +500,7 @@ ManagerImpl::hangupConference (const ConfID& id)
         ParticipantSet::iterator iter_participant = participants.begin();
 
         while (iter_participant != participants.end()) {
-            _debug ("ManagerImpl::hangupConference participant %s\n", (*iter_participant).c_str());
+            _debug ("ManagerImpl::hangupConference participant %s", (*iter_participant).c_str());
 
             hangupCall (*iter_participant);
 
@@ -536,7 +536,7 @@ ManagerImpl::cancelCall (const CallID& id)
         accountid = getAccountFromCall (id);
 
         if (accountid == AccountNULL) {
-            _debug ("! Manager Cancel Call: Call doesn't exists\n");
+            _debug ("! Manager Cancel Call: Call doesn't exists");
             return false;
         }
 
@@ -560,13 +560,13 @@ ManagerImpl::onHoldCall (const CallID& call_id)
     AccountID account_id;
     bool returnValue;
 
-    _debug ("ManagerImpl::onHoldCall(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::onHoldCall(%s)", call_id.c_str());
 
     stopTone (true);
 
     CallID current_call_id = getCurrentCallId();
 
-    _debug ("    onHoldCall: try to put call %s on hold\n", call_id.c_str());
+    _debug ("    onHoldCall: try to put call %s on hold", call_id.c_str());
 
     /* Direct IP to IP call */
 
@@ -579,7 +579,7 @@ ManagerImpl::onHoldCall (const CallID& call_id)
         account_id = getAccountFromCall (call_id);
 
         if (account_id == AccountNULL) {
-            _debug ("    onHoldCall: Account ID %s or callid %s doesn't exists\n", account_id.c_str(), call_id.c_str());
+            _debug ("    onHoldCall: Account ID %s or callid %s doesn't exists", account_id.c_str(), call_id.c_str());
             return false;
         }
 
@@ -611,7 +611,7 @@ ManagerImpl::offHoldCall (const CallID& call_id)
 
     is_rec = false;
 
-    _debug ("ManagerImpl::offHoldCall(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::offHoldCall(%s)", call_id.c_str());
 
     stopTone (false);
 
@@ -622,10 +622,10 @@ ManagerImpl::offHoldCall (const CallID& call_id)
     if (hasCurrentCall()) {
         // if this is not a conferenceand this and is not a conference participant
         if (!isConference (current_call_id) && !participToConference (current_call_id)) {
-            _debug ("    offHoldCall: put current call (%s) on hold\n", current_call_id.c_str());
+            _debug ("    offHoldCall: put current call (%s) on hold", current_call_id.c_str());
             onHoldCall (current_call_id);
         } else if (isConference (current_call_id) && !participToConference (call_id)) {
-            _debug ("    offHoldCall Put current conference (%s) on hold\n", current_call_id.c_str());
+            _debug ("    offHoldCall Put current conference (%s) on hold", current_call_id.c_str());
             detachParticipant (default_id, current_call_id);
         }
     }
@@ -644,11 +644,11 @@ ManagerImpl::offHoldCall (const CallID& call_id)
         account_id = getAccountFromCall (call_id);
 
         if (account_id == AccountNULL) {
-            _debug ("Manager OffHold Call: Call doesn't exists\n");
+            _debug ("Manager OffHold Call: Call doesn't exists");
             return false;
         }
 
-        _debug ("Setting OFFHOLD, Account %s, callid %s\n", account_id.c_str(), call_id.c_str());
+        _debug ("Setting OFFHOLD, Account %s, callid %s", account_id.c_str(), call_id.c_str());
 
         is_rec = getAccountLink (account_id)->getCall (call_id)->isRecording();
         returnValue = getAccountLink (account_id)->offhold (call_id);
@@ -680,7 +680,7 @@ ManagerImpl::offHoldCall (const CallID& call_id)
 
 
     // codecName = getCurrentCodecName (call_id);
-    // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str());
+    // _debug("ManagerImpl::hangupCall(): broadcast codec name %s ",codecName.c_str());
 
     // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id,codecName.c_str());
 
@@ -710,7 +710,7 @@ ManagerImpl::transferCall (const CallID& call_id, const std::string& to)
         accountid = getAccountFromCall (call_id);
 
         if (accountid == AccountNULL) {
-            _debug ("! Manager Transfer Call: Call doesn't exists\n");
+            _debug ("! Manager Transfer Call: Call doesn't exists");
             return false;
         }
 
@@ -771,7 +771,7 @@ ManagerImpl::refuseCall (const CallID& id)
     // AudioLayer* audiolayer = getAudioDriver();
 
     if (nbCalls <= 1) {
-        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls);
+        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls);
 
         AudioLayer* audiolayer = getAudioDriver();
         audiolayer->stopStream();
@@ -788,7 +788,7 @@ ManagerImpl::refuseCall (const CallID& id)
         accountid = getAccountFromCall (id);
 
         if (accountid == AccountNULL) {
-            _debug ("! Manager OffHold Call: Call doesn't exists\n");
+            _debug ("! Manager OffHold Call: Call doesn't exists");
             return false;
         }
 
@@ -817,7 +817,7 @@ ManagerImpl::refuseCall (const CallID& id)
 Conference*
 ManagerImpl::createConference (const CallID& id1, const CallID& id2)
 {
-    _debug ("ManagerImpl::createConference()\n");
+    _debug ("ManagerImpl::createConference()");
 
     Conference* conf = new Conference();
 
@@ -838,21 +838,21 @@ void
 ManagerImpl::removeConference (const ConfID& conference_id)
 {
 
-    _debug ("ManagerImpl::removeConference(%s)\n", conference_id.c_str());
+    _debug ("ManagerImpl::removeConference(%s)", conference_id.c_str());
 
     Conference* conf = NULL;
 
-    _debug ("    removeConference: _conferencemap.size: %i\n", (int) _conferencemap.size());
+    _debug ("    removeConference: _conferencemap.size: %i", (int) _conferencemap.size());
     ConferenceMap::iterator iter = _conferencemap.find (conference_id);
 
     if (iter != _conferencemap.end()) {
-        _debug ("    removeConference: Found conference id %s in conferencemap\n", conference_id.c_str());
+        _debug ("    removeConference: Found conference id %s in conferencemap", conference_id.c_str());
         conf = iter->second;
     }
 
     if (conf == NULL) {
 
-        _debug ("    removeConference: Error conference not found\n");
+        _debug ("    removeConference: Error conference not found");
         return;
     }
 
@@ -875,15 +875,15 @@ ManagerImpl::removeConference (const ConfID& conference_id)
     }
 
     // Then remove the conference from the conference map
-    _debug ("ManagerImpl:: remove conference %s\n", conference_id.c_str());
+    _debug ("ManagerImpl:: remove conference %s", conference_id.c_str());
 
     if (_conferencemap.erase (conference_id) == 1)
-        _debug ("ManagerImpl:: conference %s removed succesfully\n", conference_id.c_str());
+        _debug ("ManagerImpl:: conference %s removed succesfully", conference_id.c_str());
     else
-        _debug ("ManagerImpl:: error cannot remove conference id: %s\n", conference_id.c_str());
+        _debug ("ManagerImpl:: error cannot remove conference id: %s", conference_id.c_str());
 
     // broadcast a signal over dbus
-    _debug ("ManagerImpl::removeConference broadcast call removed on dbus: %s\n", conference_id.c_str());
+    _debug ("ManagerImpl::removeConference broadcast call removed on dbus: %s", conference_id.c_str());
 
     _dbus->getCallManager()->conferenceRemoved (conference_id);
 
@@ -911,7 +911,7 @@ ManagerImpl::getConferenceFromCallID (const CallID& call_id)
 void
 ManagerImpl::holdConference (const CallID& id)
 {
-    _debug ("ManagerImpl::holdConference()\n");
+    _debug ("ManagerImpl::holdConference()");
 
     Conference *conf;
     ConferenceMap::iterator iter_conf = _conferencemap.find (id);
@@ -927,7 +927,7 @@ ManagerImpl::holdConference (const CallID& id)
         ParticipantSet::iterator iter_participant = participants.begin();
 
         while (iter_participant != participants.end()) {
-            _debug ("    holdConference: participant %s\n", (*iter_participant).c_str());
+            _debug ("    holdConference: participant %s", (*iter_participant).c_str());
             currentAccountId = getAccountFromCall (*iter_participant);
             call = getAccountLink (currentAccountId)->getCall (*iter_participant);
 
@@ -954,7 +954,7 @@ void
 ManagerImpl::unHoldConference (const CallID& id)
 {
 
-    _debug ("ManagerImpl::unHoldConference()\n");
+    _debug ("ManagerImpl::unHoldConference()");
 
     Conference *conf;
     ConferenceMap::iterator iter_conf = _conferencemap.find (id);
@@ -970,7 +970,7 @@ ManagerImpl::unHoldConference (const CallID& id)
         ParticipantSet::iterator iter_participant = participants.begin();
 
         while (iter_participant != participants.end()) {
-            _debug ("    unholdConference: participant %s\n", (*iter_participant).c_str());
+            _debug ("    unholdConference: participant %s", (*iter_participant).c_str());
             currentAccountId = getAccountFromCall (*iter_participant);
             call = getAccountLink (currentAccountId)->getCall (*iter_participant);
 
@@ -1025,7 +1025,7 @@ ManagerImpl::participToConference (const CallID& call_id)
 void
 ManagerImpl::addParticipant (const CallID& call_id, const CallID& conference_id)
 {
-    _debug ("ManagerImpl::addParticipant(%s, %s)\n", call_id.c_str(), conference_id.c_str());
+    _debug ("ManagerImpl::addParticipant(%s, %s)", call_id.c_str(), conference_id.c_str());
 
     std::map<std::string, std::string> call_details = getCallDetails (call_id);
 
@@ -1051,7 +1051,7 @@ ManagerImpl::addParticipant (const CallID& call_id, const CallID& conference_id)
 
     addMainParticipant (conference_id);
 
-    _debug ("    addParticipant: enter main process\n");
+    _debug ("    addParticipant: enter main process");
 
     if (iter != _conferencemap.end()) {
 
@@ -1069,15 +1069,15 @@ ManagerImpl::addParticipant (const CallID& call_id, const CallID& conference_id)
 
         iter_details = call_details.find ("CALL_STATE");
 
-        _debug ("    addParticipant: call state: %s\n", iter_details->second.c_str());
+        _debug ("    addParticipant: call state: %s", iter_details->second.c_str());
 
         if (iter_details->second == "HOLD") {
-            _debug ("    OFFHOLD %s\n", call_id.c_str());
+            _debug ("    OFFHOLD %s", call_id.c_str());
 
             // offHoldCall create a new rtp session which use addStream to bind participant
             offHoldCall (call_id);
         } else if (iter_details->second == "INCOMING") {
-            _debug ("    ANSWER %s\n", call_id.c_str());
+            _debug ("    ANSWER %s", call_id.c_str());
             // answerCall create a new rtp session which use addStream to bind participant
             answerCall (call_id);
         } else if (iter_details->second == "CURRENT") {
@@ -1103,7 +1103,7 @@ ManagerImpl::addParticipant (const CallID& call_id, const CallID& conference_id)
 
         _audiodriver->getMainBuffer()->flush (default_id);
     } else {
-        _debug ("    addParticipant: Error, conference %s conference_id not found!\n", conference_id.c_str());
+        _debug ("    addParticipant: Error, conference %s conference_id not found!", conference_id.c_str());
     }
 
 }
@@ -1162,8 +1162,8 @@ ManagerImpl::addMainParticipant (const CallID& conference_id)
 void
 ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2)
 {
-    _debug ("ManagerImpl::joinParticipant(%s, %s)\n", call_id1.c_str(), call_id2.c_str());
-    // _debug("    Current call ID %s\n", getCurrentCallId().c_str());
+    _debug ("ManagerImpl::joinParticipant(%s, %s)", call_id1.c_str(), call_id2.c_str());
+    // _debug("    Current call ID %s", getCurrentCallId().c_str());
 
     std::map<std::string, std::string> call1_details = getCallDetails (call_id1);
     std::map<std::string, std::string> call2_details = getCallDetails (call_id2);
@@ -1174,7 +1174,7 @@ ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2)
     Call* call = NULL;
 
     CallID current_call_id = getCurrentCallId();
-    _debug ("    joinParticipant: current_call_id %s\n", current_call_id.c_str());
+    _debug ("    joinParticipant: current_call_id %s", current_call_id.c_str());
 
 
     // detach from the conference and switch to this conference
@@ -1186,7 +1186,7 @@ ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2)
             onHoldCall (current_call_id);
     }
 
-    _debug ("    joinParticipant: create a conference\n");
+    _debug ("    joinParticipant: create a conference");
 
     Conference *conf = createConference (call_id1, call_id2);
     switchCall (conf->getConfID());
@@ -1196,23 +1196,23 @@ ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2)
     call->setConfId (conf->getConfID());
 
     iter_details = call1_details.find ("CALL_STATE");
-    _debug ("    joinParticipant: call1 %s state: %s\n", call_id1.c_str(), iter_details->second.c_str());
+    _debug ("    joinParticipant: call1 %s state: %s", call_id1.c_str(), iter_details->second.c_str());
 
     if (iter_details->second == "HOLD") {
-        _debug ("    OFFHOLD %s\n", call_id1.c_str());
+        _debug ("    OFFHOLD %s", call_id1.c_str());
         offHoldCall (call_id1);
     } else if (iter_details->second == "INCOMING") {
-        _debug ("    ANSWER %s\n", call_id1.c_str());
+        _debug ("    ANSWER %s", call_id1.c_str());
         answerCall (call_id1);
     } else if (iter_details->second == "CURRENT") {
-        _debug ("    CURRENT %s\n", call_id1.c_str());
+        _debug ("    CURRENT %s", call_id1.c_str());
         _audiodriver->getMainBuffer()->unBindAll (call_id1);
         conf->bindParticipant (call_id1);
     } else if (iter_details->second == "INACTIVE") {
-        _debug ("    INACTIVE %s\n", call_id1.c_str());
+        _debug ("    INACTIVE %s", call_id1.c_str());
         answerCall (call_id1);
     } else {
-        _debug ("    CAll State not recognized\n");
+        _debug ("    CAll State not recognized");
     }
 
     currentAccountId = getAccountFromCall (call_id2);
@@ -1221,23 +1221,23 @@ ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2)
     call->setConfId (conf->getConfID());
 
     iter_details = call2_details.find ("CALL_STATE");
-    _debug ("    joinParticipant: call2 %s state: %s\n", call_id2.c_str(), iter_details->second.c_str());
+    _debug ("    joinParticipant: call2 %s state: %s", call_id2.c_str(), iter_details->second.c_str());
 
     if (iter_details->second == "HOLD") {
-        _debug ("    OFFHOLD %s\n", call_id2.c_str());
+        _debug ("    OFFHOLD %s", call_id2.c_str());
         offHoldCall (call_id2);
     } else if (iter_details->second == "INCOMING") {
-        _debug ("    ANSWER %s\n", call_id2.c_str());
+        _debug ("    ANSWER %s", call_id2.c_str());
         answerCall (call_id2);
     } else if (iter_details->second == "CURRENT") {
-        _debug ("    CURRENT %s\n", call_id2.c_str());
+        _debug ("    CURRENT %s", call_id2.c_str());
         _audiodriver->getMainBuffer()->unBindAll (call_id2);
         conf->bindParticipant (call_id2);
     } else if (iter_details->second == "INACTIVE") {
-        _debug ("    INACTIVE %s\n", call_id2.c_str());
+        _debug ("    INACTIVE %s", call_id2.c_str());
         answerCall (call_id2);
     } else {
-        _debug ("    CAll State not recognized\n");
+        _debug ("    CAll State not recognized");
     }
 
     // finally bind main participant to conference
@@ -1252,7 +1252,7 @@ ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2)
 void
 ManagerImpl::detachParticipant (const CallID& call_id, const CallID& current_id)
 {
-    _debug ("ManagerImpl::detachParticipant(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::detachParticipant(%s)", call_id.c_str());
 
     CallID current_call_id = current_id;
 
@@ -1274,7 +1274,7 @@ ManagerImpl::detachParticipant (const CallID& call_id, const CallID& current_id)
 
         if (conf != NULL) {
 
-            _debug ("    detachParticipant: detaching participant %s\n", call_id.c_str());
+            _debug ("    detachParticipant: detaching participant %s", call_id.c_str());
 
             std::map<std::string, std::string> call_details = getCallDetails (call_id);
             std::map<std::string, std::string>::iterator iter_details;
@@ -1284,7 +1284,7 @@ ManagerImpl::detachParticipant (const CallID& call_id, const CallID& current_id)
             if (iter_details->second == "RINGING") {
                 removeParticipant (call_id);
             } else {
-                _debug ("    ONHOLD %s\n", call_id.c_str());
+                _debug ("    ONHOLD %s", call_id.c_str());
                 onHoldCall (call_id);
 
                 removeParticipant (call_id);
@@ -1294,11 +1294,11 @@ ManagerImpl::detachParticipant (const CallID& call_id, const CallID& current_id)
         } else {
 
 
-            _debug ("    detachParticipant: call is not conferencing, cannot detach\n");
+            _debug ("    detachParticipant: call is not conferencing, cannot detach");
 
         }
     } else {
-        _debug ("    detachParticipant: unbind main participant from all\n");
+        _debug ("    detachParticipant: unbind main participant from all");
         _audiodriver->getMainBuffer()->unBindAll (default_id);
 
         if (isConference (current_call_id)) {
@@ -1321,7 +1321,7 @@ ManagerImpl::detachParticipant (const CallID& call_id, const CallID& current_id)
 void
 ManagerImpl::removeParticipant (const CallID& call_id)
 {
-    _debug ("ManagerImpl::removeParticipant(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::removeParticipant(%s)", call_id.c_str());
 
     // TODO: add conference_id as a second parameter
     Conference* conf;
@@ -1337,12 +1337,12 @@ ManagerImpl::removeParticipant (const CallID& call_id)
     ConferenceMap::iterator iter = conf_map.find (call->getConfId());
 
     if (iter == conf_map.end()) {
-        _debug ("    no conference created, cannot remove participant \n");
+        _debug ("    no conference created, cannot remove participant ");
     } else {
 
         conf = iter->second;
 
-        _debug ("    removeParticipant %s\n", call_id.c_str());
+        _debug ("    removeParticipant %s", call_id.c_str());
         conf->remove (call_id);
         call->setConfId ("");
 
@@ -1355,7 +1355,7 @@ void
 ManagerImpl::processRemainingParticipant (CallID current_call_id, Conference *conf)
 {
 
-    _debug ("ManagerImpl::processRemainingParticipant()\n");
+    _debug ("ManagerImpl::processRemainingParticipant()");
 
     if (conf->getNbParticipants() > 1) {
 
@@ -1410,7 +1410,7 @@ ManagerImpl::processRemainingParticipant (CallID current_call_id, Conference *co
 void
 ManagerImpl::joinConference (const CallID& conf_id1, const CallID& conf_id2)
 {
-    _debug ("ManagerImpl::joinConference(%s, %s)\n", conf_id1.c_str(), conf_id2.c_str());
+    _debug ("ManagerImpl::joinConference(%s, %s)", conf_id1.c_str(), conf_id2.c_str());
 
     ConferenceMap::iterator iter;
 
@@ -1445,7 +1445,7 @@ ManagerImpl::joinConference (const CallID& conf_id1, const CallID& conf_id2)
 void
 ManagerImpl::addStream (const CallID& call_id)
 {
-    _debug ("ManagerImpl::addStream %s\n", call_id.c_str());
+    _debug ("ManagerImpl::addStream %s", call_id.c_str());
 
     AccountID currentAccountId;
     Call* call = NULL;
@@ -1461,7 +1461,7 @@ ManagerImpl::addStream (const CallID& call_id)
         if (iter != _conferencemap.end()) {
             Conference* conf = iter->second;
 
-            _debug ("    addStream: bind call %s to conference %s\n", call_id.c_str(), conf->getConfID().c_str());
+            _debug ("    addStream: bind call %s to conference %s", call_id.c_str(), conf->getConfID().c_str());
 
             conf->bindParticipant (call_id);
 
@@ -1483,7 +1483,7 @@ ManagerImpl::addStream (const CallID& call_id)
 
     } else {
 
-        _debug ("    addStream: bind call %s to main\n", call_id.c_str());
+        _debug ("    addStream: bind call %s to main", call_id.c_str());
 
         // bind to main
         getAudioDriver()->getMainBuffer()->bindCallID (call_id);
@@ -1498,7 +1498,7 @@ ManagerImpl::addStream (const CallID& call_id)
 void
 ManagerImpl::removeStream (const CallID& call_id)
 {
-    _debug ("ManagerImpl::removeStream %s\n", call_id.c_str());
+    _debug ("ManagerImpl::removeStream %s", call_id.c_str());
 
     getAudioDriver()->getMainBuffer()->unBindAll (call_id);
 
@@ -1512,7 +1512,7 @@ ManagerImpl::removeStream (const CallID& call_id)
 bool
 ManagerImpl::saveConfig (void)
 {
-    _debug ("Saving Configuration to XDG directory %s ... \n", _path.c_str());
+    _debug ("Saving Configuration to XDG directory %s ... ", _path.c_str());
     setConfig (AUDIO, VOLUME_SPKR, getSpkrVolume());
     setConfig (AUDIO, VOLUME_MICRO, getMicVolume());
 
@@ -1603,14 +1603,14 @@ ManagerImpl::playDtmf (char code, bool isTalking)
     AudioLayer *audiolayer;
     SFLDataFormat *buf;
 
-    _debug ("ManagerImpl::playDtmf\n");
+    _debug ("ManagerImpl::playDtmf");
 
     stopTone (false);
 
     bool hasToPlayTone = getConfigBool (SIGNALISATION, PLAY_DTMF);
 
     if (!hasToPlayTone) {
-        _debug ("    playDtmf: Do not have to play a tone...\n");
+        _debug ("    playDtmf: Do not have to play a tone...");
         return false;
     }
 
@@ -1618,7 +1618,7 @@ ManagerImpl::playDtmf (char code, bool isTalking)
     pulselen = getConfigInt (SIGNALISATION, PULSE_LENGTH);
 
     if (!pulselen) {
-        _debug ("    playDtmf: Pulse length is not set...\n");
+        _debug ("    playDtmf: Pulse length is not set...");
         return false;
     }
 
@@ -1630,7 +1630,7 @@ ManagerImpl::playDtmf (char code, bool isTalking)
 
     // fast return, no sound, so no dtmf
     if (audiolayer==0 || _dtmfKey == 0) {
-        _debug ("    playDtmf: Error no audio layer...\n");
+        _debug ("    playDtmf: Error no audio layer...");
         return false;
     }
 
@@ -1640,9 +1640,9 @@ ManagerImpl::playDtmf (char code, bool isTalking)
     //                            ms/s
     size = (int) ( (pulselen * (float) audiolayer->getSampleRate()) / 1000);
 
-    _debug ("DTMF pulselen: %i\n", pulselen);
+    _debug ("DTMF pulselen: %i", pulselen);
 
-    _debug ("DTMF size: %i\n", size);
+    _debug ("DTMF size: %i", size);
 
     // this buffer is for mono
     // TODO <-- this should be global and hide if same size
@@ -1660,7 +1660,7 @@ ManagerImpl::playDtmf (char code, bool isTalking)
         audiolayer->startStream();
         audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat));
     } else {
-        _debug ("    playDtmf: Error cannot play dtmf\n");
+        _debug ("    playDtmf: Error cannot play dtmf");
     }
 
     ret = true;
@@ -1723,7 +1723,7 @@ ManagerImpl::incomingCall (Call* call, const AccountID& accountId)
 
     stopTone (false);
 
-    _debug ("Incoming call %s for account %s\n", call->getCallId().data(), accountId.c_str());
+    _debug ("Incoming call %s for account %s", call->getCallId().data(), accountId.c_str());
 
     associateCallToAccount (call->getCallId(), accountId);
 
@@ -1748,7 +1748,7 @@ ManagerImpl::incomingCall (Call* call, const AccountID& accountId)
 
     }
 
-    _debug ("ManagerImpl::incomingCall :: hasCurrentCall() %i \n", hasCurrentCall());
+    _debug ("ManagerImpl::incomingCall :: hasCurrentCall() %i ", hasCurrentCall());
 
     if (!hasCurrentCall()) {
 
@@ -1772,7 +1772,7 @@ ManagerImpl::incomingCall (Call* call, const AccountID& accountId)
 
     display_name = call->getDisplayName();
 
-    // _debug(    "incomingCall from: %s, number: %s, display_name: %s\n", from.c_str(), number.c_str(), display_name.c_str());
+    // _debug(    "incomingCall from: %s, number: %s, display_name: %s", from.c_str(), number.c_str(), display_name.c_str());
 
     if (from != "" && number != "") {
         from.append (" <");
@@ -1788,13 +1788,13 @@ ManagerImpl::incomingCall (Call* call, const AccountID& accountId)
     CallIDSet::iterator iter = _waitingCall.begin();
     while (iter != _waitingCall.end()) {
         CallID ident = *iter;
-        _debug("ManagerImpl::incomingCall :: CALL iteration: %s \n",ident.c_str());
+        _debug("ManagerImpl::incomingCall :: CALL iteration: %s ",ident.c_str());
         ++iter;
     }
     */
 
     /* Broadcast a signal over DBus */
-    _debug ("From: %s, Number: %s, DisplayName: %s\n", from.c_str(), number.c_str(), display_name.c_str());
+    _debug ("From: %s, Number: %s, DisplayName: %s", from.c_str(), number.c_str(), display_name.c_str());
 
     display = display_name;
 
@@ -1836,7 +1836,7 @@ ManagerImpl::peerAnsweredCall (const CallID& id)
 
     // std::string codecName = getCurrentCodecName (id);
 
-    // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str());
+    // _debug("ManagerImpl::hangupCall(): broadcast codec name %s ",codecName.c_str());
     // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str());
 
     // Required if there have been no sip reinvite, in this case we must reinit buffers since the
@@ -1864,7 +1864,7 @@ ManagerImpl::peerHungupCall (const CallID& call_id)
     AccountID account_id;
     bool returnValue;
 
-    _debug ("ManagerImpl::peerHungupCall(%s)\n", call_id.c_str());
+    _debug ("ManagerImpl::peerHungupCall(%s)", call_id.c_str());
 
     // store the current call id
     CallID current_call_id = getCurrentCallId();
@@ -1893,7 +1893,7 @@ ManagerImpl::peerHungupCall (const CallID& call_id)
     // stop streams
 
     if (nbCalls <= 1) {
-        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls);
+        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls);
 
         AudioLayer* audiolayer = getAudioDriver();
         audiolayer->stopStream();
@@ -1909,7 +1909,7 @@ ManagerImpl::peerHungupCall (const CallID& call_id)
         account_id = getAccountFromCall (call_id);
 
         if (account_id == AccountNULL) {
-            _debug ("peerHungupCall: Call doesn't exists\n");
+            _debug ("peerHungupCall: Call doesn't exists");
             return;
         }
 
@@ -1932,7 +1932,7 @@ ManagerImpl::peerHungupCall (const CallID& call_id)
 void
 ManagerImpl::callBusy (const CallID& id)
 {
-    _debug ("Call busy\n");
+    _debug ("Call busy");
 
     if (_dbus) _dbus->getCallManager()->callStateChanged (id, "BUSY");
 
@@ -1952,7 +1952,7 @@ ManagerImpl::callFailure (const CallID& id)
 {
     if (_dbus) _dbus->getCallManager()->callStateChanged (id, "FAILURE");
 
-    _debug ("CALL ID = %s\n" , id.c_str());
+    _debug ("CALL ID = %s" , id.c_str());
 
     if (isCurrentCall (id)) {
         playATone (Tone::TONE_BUSY);
@@ -1989,7 +1989,7 @@ bool ManagerImpl::playATone (Tone::TONEID toneId)
     AudioLayer *audiolayer;
     // unsigned int nbSamples;
 
-    _debug ("ManagerImpl::playATone\n");
+    _debug ("ManagerImpl::playATone");
 
     hasToPlayTone = getConfigBool (SIGNALISATION, PLAY_TONES);
 
@@ -2032,7 +2032,7 @@ void ManagerImpl::stopTone (bool stopAudio=true)
 {
     bool hasToPlayTone;
 
-    _debug ("ManagerImpl::stopTone\n");
+    _debug ("ManagerImpl::stopTone");
 
     hasToPlayTone = getConfigBool (SIGNALISATION, PLAY_TONES);
 
@@ -2088,7 +2088,7 @@ ManagerImpl::congestion ()
 void
 ManagerImpl::ringback ()
 {
-    _debug ("ManagerImpl::ringback\n");
+    _debug ("ManagerImpl::ringback");
 
     playATone (Tone::TONE_RINGTONE);
 }
@@ -2099,7 +2099,7 @@ ManagerImpl::ringback ()
 void
 ManagerImpl::ringtone()
 {
-    _debug ("ManagerImpl::ringtone\n");
+    _debug ("ManagerImpl::ringtone");
     std::string ringchoice;
     AudioLayer *audiolayer;
     AudioCodec *codecForTone;
@@ -2110,7 +2110,7 @@ ManagerImpl::ringtone()
 
     if (isRingtoneEnabled()) {
 
-        _debug ("  Tone is enabled\n");
+        _debug ("  Tone is enabled");
         //TODO Comment this because it makes the daemon crashes since the main thread
         //synchronizes the ringtone thread.
 
@@ -2161,7 +2161,7 @@ ManagerImpl::ringtone()
 AudioLoop*
 ManagerImpl::getTelephoneTone()
 {
-    // _debug("ManagerImpl::getTelephoneTone()\n");
+    // _debug("ManagerImpl::getTelephoneTone()");
     if (_telephoneTone != 0) {
         ost::MutexLock m (_toneMutex);
         return _telephoneTone->getCurrentTone();
@@ -2173,7 +2173,7 @@ ManagerImpl::getTelephoneTone()
 AudioLoop*
 ManagerImpl::getTelephoneFile()
 {
-    // _debug("ManagerImpl::getTelephoneFile()\n");
+    // _debug("ManagerImpl::getTelephoneFile()");
     ost::MutexLock m (_toneMutex);
 
     if (_audiofile.isStarted()) {
@@ -2191,7 +2191,7 @@ void ManagerImpl::notificationIncomingCall (void)
 
     audiolayer = getAudioDriver();
 
-    _debug ("ManagerImpl::notificationIncomingCall\n");
+    _debug ("ManagerImpl::notificationIncomingCall");
 
     if (audiolayer != 0) {
         samplerate = audiolayer->getSampleRate();
@@ -2221,7 +2221,7 @@ ManagerImpl::createSettingsPath (void)
 
     std::string xdg_config, xdg_env;
 
-    _debug ("XDG_CONFIG_HOME: %s\n", XDG_CONFIG_HOME);
+    _debug ("XDG_CONFIG_HOME: %s", XDG_CONFIG_HOME);
 
     xdg_config = std::string (HOMEDIR) + DIR_SEPARATOR_STR + ".config" + DIR_SEPARATOR_STR + PROGDIR;
 
@@ -2235,7 +2235,7 @@ ManagerImpl::createSettingsPath (void)
     if (mkdir (_path.data(), 0700) != 0) {
         // If directory	creation failed
         if (errno != EEXIST) {
-            _debug ("Cannot create directory: %s\n", strerror (errno));
+            _debug ("Cannot create directory: %s", strerror (errno));
             return -1;
         }
     }
@@ -2252,7 +2252,7 @@ ManagerImpl::createSettingsPath (void)
 void
 ManagerImpl::initConfigFile (bool load_user_value, std::string alternate)
 {
-    _debug ("ManagerImpl::InitConfigFile\n");
+    _debug ("ManagerImpl::InitConfigFile");
 
     // Default values, that will be overwritten by the call to
     // 'populateFromFile' below.
@@ -2414,11 +2414,11 @@ ManagerImpl::initAudioCodec (void)
 void
 ManagerImpl::setActiveCodecList (const std::vector<  std::string >& list)
 {
-    _debug ("Set active codecs list\n");
+    _debug ("Set active codecs list");
     _codecDescriptorMap.saveActiveCodecs (list);
     // setConfig
     std::string s = serialize (list);
-    _debug ("Setting codec with payload number %s to the active list\n", s.c_str());
+    _debug ("Setting codec with payload number %s to the active list", s.c_str());
     setConfig ("Audio", "ActiveCodecs", s);
 }
 
@@ -2463,7 +2463,7 @@ ManagerImpl::serialize (std::vector<std::string> v)
 std::vector <std::string>
 ManagerImpl::getActiveCodecList (void)
 {
-    _debug ("ManagerImpl::getActiveCodecList\n");
+    _debug ("ManagerImpl::getActiveCodecList");
     std::vector< std::string > v;
     CodecOrder active = _codecDescriptorMap.getActiveCodecs();
     unsigned int i=0;
@@ -2473,7 +2473,7 @@ ManagerImpl::getActiveCodecList (void)
         std::stringstream ss;
         ss << active[i];
         v.push_back ( (ss.str()).data());
-        _debug ("Codec with payload number %s is active\n", ss.str().data());
+        _debug ("Codec with payload number %s is active", ss.str().data());
         i++;
     }
 
@@ -2552,7 +2552,7 @@ std::vector<std::string>
 ManagerImpl::getInputAudioPluginList (void)
 {
     std::vector<std::string> v;
-    _debug ("Get input audio plugin list\n");
+    _debug ("Get input audio plugin list");
 
     v.push_back ("default");
     v.push_back ("surround40");
@@ -2568,7 +2568,7 @@ std::vector<std::string>
 ManagerImpl::getOutputAudioPluginList (void)
 {
     std::vector<std::string> v;
-    _debug ("Get output audio plugin list\n");
+    _debug ("Get output audio plugin list");
 
     v.push_back (PCM_DEFAULT);
     v.push_back (PCM_DMIX);
@@ -2585,7 +2585,7 @@ ManagerImpl::setInputAudioPlugin (const std::string& audioPlugin)
     int layer = _audiodriver -> getLayerType();
 
     if (CHECK_INTERFACE (layer , ALSA)) {
-        _debug ("Set input audio plugin\n");
+        _debug ("Set input audio plugin");
         _audiodriver -> setErrorMessage (-1);
         _audiodriver -> openDevice (_audiodriver -> getIndexIn(),
                                     _audiodriver -> getIndexOut(),
@@ -2609,7 +2609,7 @@ ManagerImpl::setOutputAudioPlugin (const std::string& audioPlugin)
 
     int res;
 
-    _debug ("Set output audio plugin\n");
+    _debug ("Set output audio plugin");
     _audiodriver -> setErrorMessage (-1);
     res = _audiodriver -> openDevice (_audiodriver -> getIndexIn(),
                                       _audiodriver -> getIndexOut(),
@@ -2631,7 +2631,7 @@ ManagerImpl::setOutputAudioPlugin (const std::string& audioPlugin)
 std::vector<std::string>
 ManagerImpl::getAudioOutputDeviceList (void)
 {
-    _debug ("Get audio output device list\n");
+    _debug ("Get audio output device list");
     AlsaLayer *layer;
     std::vector <std::string> devices;
 
@@ -2651,14 +2651,14 @@ ManagerImpl::setAudioOutputDevice (const int index)
 {
     AlsaLayer *alsalayer;
     std::string alsaplugin;
-    _debug ("Set audio output device: %i\n", index);
+    _debug ("Set audio output device: %i", index);
 
     _audiodriver -> setErrorMessage (-1);
 
     alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ());
     alsaplugin = alsalayer->getAudioPlugin ();
 
-    _debug ("  set output plugin: %s\n", alsaplugin.c_str());
+    _debug ("  set output plugin: %s", alsaplugin.c_str());
 
     _audiodriver->openDevice (_audiodriver->getIndexIn(), index, _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_PLAYBACK, alsaplugin);
 
@@ -2696,14 +2696,14 @@ ManagerImpl::setAudioInputDevice (const int index)
     AlsaLayer *alsalayer;
     std::string alsaplugin;
 
-    _debug ("Set audio input device %i\n", index);
+    _debug ("Set audio input device %i", index);
 
     _audiodriver -> setErrorMessage (-1);
 
     alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ());
     alsaplugin = alsalayer->getAudioPlugin ();
 
-    _debug ("  set input plugin: %s\n", alsaplugin.c_str());
+    _debug ("  set input plugin: %s", alsaplugin.c_str());
 
     _audiodriver->openDevice (index, _audiodriver->getIndexOut(), _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_CAPTURE, alsaplugin);
 
@@ -2720,7 +2720,7 @@ ManagerImpl::setAudioInputDevice (const int index)
 std::vector<std::string>
 ManagerImpl::getCurrentAudioDevicesIndex()
 {
-    _debug ("Get current audio devices index\n");
+    _debug ("Get current audio devices index");
     std::vector<std::string> v;
     std::stringstream ssi , sso;
     sso << _audiodriver->getIndexOut();
@@ -2767,7 +2767,7 @@ ManagerImpl::getRingtoneChoice (void)
         tone_path = tone_name ;
     }
 
-    _debug ("%s\n", tone_path.c_str());
+    _debug ("%s", tone_path.c_str());
 
     return tone_path;
 }
@@ -2788,7 +2788,7 @@ ManagerImpl::getRecordPath (void)
 void
 ManagerImpl::setRecordPath (const std::string& recPath)
 {
-    _debug ("ManagerImpl::setRecordPath(%s)! \n", recPath.c_str());
+    _debug ("ManagerImpl::setRecordPath(%s)! ", recPath.c_str());
     setConfig (AUDIO, RECORD_PATH, recPath);
 }
 
@@ -2847,7 +2847,7 @@ void
 ManagerImpl::setRecordingCall (const CallID& id)
 {
     /*
-    _debug ("ManagerImpl::setRecording()! \n");
+    _debug ("ManagerImpl::setRecording()! ");
     AccountID accountid = getAccountFromCall (id);
 
     getAccountLink (accountid)->setRecording (id);
@@ -2862,7 +2862,7 @@ bool
 ManagerImpl::isRecording (const CallID& id)
 {
     /*
-    _debug ("ManagerImpl::isRecording()! \n");
+    _debug ("ManagerImpl::isRecording()! ");
     AccountID accountid = getAccountFromCall (id);
 
     return getAccountLink (accountid)->isRecording (id);
@@ -2954,7 +2954,7 @@ void ManagerImpl::setAudioManager (const int32_t& api)
     int type;
     std::string alsaPlugin;
 
-    _debug ("Setting audio manager \n");
+    _debug ("Setting audio manager ");
 
     if (!_audiodriver)
         return;
@@ -2962,7 +2962,7 @@ void ManagerImpl::setAudioManager (const int32_t& api)
     type = _audiodriver->getLayerType();
 
     if (type == api) {
-        _debug ("Audio manager chosen already in use. No changes made. \n");
+        _debug ("Audio manager chosen already in use. No changes made. ");
         return;
     }
 
@@ -2989,7 +2989,7 @@ void
 ManagerImpl::notifyErrClient (const int32_t& errCode)
 {
     if (_dbus) {
-        _debug ("NOTIFY ERR NUMBER %i\n" , errCode);
+        _debug ("NOTIFY ERR NUMBER %i" , errCode);
         _dbus -> getConfigurationManager() -> errorAlert (errCode);
     }
 }
@@ -2999,7 +2999,7 @@ ManagerImpl::getAudioDeviceIndex (const std::string name)
 {
     AlsaLayer *alsalayer;
 
-    _debug ("Get audio device index\n");
+    _debug ("Get audio device index");
 
     alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver());
 
@@ -3014,7 +3014,7 @@ ManagerImpl::getCurrentAudioOutputPlugin (void)
 {
     AlsaLayer *alsalayer;
 
-    _debug ("Get alsa plugin\n");
+    _debug ("Get alsa plugin");
 
     alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver());
 
@@ -3055,16 +3055,16 @@ ManagerImpl::initAudioDriver (void)
             _audiodriver->setMainBuffer (&_mainBuffer);
         }
     } else
-        _debug ("Error - Audio API unknown\n");
+        _debug ("Error - Audio API unknown");
 
     if (_audiodriver == 0) {
-        _debug ("Init audio driver error\n");
+        _debug ("Init audio driver error");
         return false;
     } else {
         error = getAudioDriver()->getErrorMessage();
 
         if (error == -1) {
-            _debug ("Init audio driver: %i\n", error);
+            _debug ("Init audio driver: %i", error);
             return false;
         }
     }
@@ -3084,7 +3084,7 @@ ManagerImpl::selectAudioDriver (void)
     AlsaLayer *alsalayer;
 
     layer = _audiodriver->getLayerType();
-    _debug ("Audio layer type: %i\n" , layer);
+    _debug ("Audio layer type: %i" , layer);
 
     /* Retrieve the global devices info from the user config */
     alsaPlugin = getConfigString (AUDIO , ALSA_PLUGIN);
@@ -3104,13 +3104,13 @@ ManagerImpl::selectAudioDriver (void)
         alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ());
 
         if (!alsalayer -> soundCardIndexExist (numCardIn , SFL_PCM_CAPTURE)) {
-            _debug (" Card with index %i doesn't exist or cannot capture. Switch to 0.\n", numCardIn);
+            _debug (" Card with index %i doesn't exist or cannot capture. Switch to 0.", numCardIn);
             numCardIn = ALSA_DFT_CARD_ID ;
             setConfig (AUDIO , ALSA_CARD_ID_IN , ALSA_DFT_CARD_ID);
         }
 
         if (!alsalayer -> soundCardIndexExist (numCardOut , SFL_PCM_PLAYBACK)) {
-            _debug (" Card with index %i doesn't exist or cannot playback . Switch to 0.\n", numCardOut);
+            _debug (" Card with index %i doesn't exist or cannot playback . Switch to 0.", numCardOut);
             numCardOut = ALSA_DFT_CARD_ID ;
             setConfig (AUDIO , ALSA_CARD_ID_OUT , ALSA_DFT_CARD_ID);
         }
@@ -3132,7 +3132,7 @@ void ManagerImpl::switchAudioManager (void)
     int type, samplerate, framesize, numCardIn, numCardOut;
     std::string alsaPlugin;
 
-    _debug ("Switching audio manager \n");
+    _debug ("Switching audio manager ");
 
     if (!_audiodriver)
         return;
@@ -3149,7 +3149,7 @@ void ManagerImpl::switchAudioManager (void)
 
     numCardOut = getConfigInt (AUDIO , ALSA_CARD_ID_OUT);
 
-    _debug ("Deleting current layer... \n");
+    _debug ("Deleting current layer... ");
 
     // _audiodriver->closeLayer();
     delete _audiodriver;
@@ -3159,19 +3159,19 @@ void ManagerImpl::switchAudioManager (void)
     switch (type) {
 
         case ALSA:
-            _debug ("Creating Pulseaudio layer...\n");
+            _debug ("Creating Pulseaudio layer...");
             _audiodriver = new PulseLayer (this);
             _audiodriver->setMainBuffer (&_mainBuffer);
             break;
 
         case PULSEAUDIO:
-            _debug ("Creating ALSA layer...\n");
+            _debug ("Creating ALSA layer...");
             _audiodriver = new AlsaLayer (this);
             _audiodriver->setMainBuffer (&_mainBuffer);
             break;
 
         default:
-            _debug ("Error: audio layer unknown\n");
+            _debug ("Error: audio layer unknown");
             break;
     }
 
@@ -3182,9 +3182,9 @@ void ManagerImpl::switchAudioManager (void)
     if (_audiodriver -> getErrorMessage() != -1)
         notifyErrClient (_audiodriver -> getErrorMessage());
 
-    _debug ("Current device: %i \n", type);
+    _debug ("Current device: %i ", type);
 
-    _debug ("has current call: %i \n", hasCurrentCall());
+    _debug ("has current call: %i ", hasCurrentCall());
 
     if (hasCurrentCall())
         _audiodriver->startStream();
@@ -3192,7 +3192,7 @@ void ManagerImpl::switchAudioManager (void)
 
     // need to stop audio streams if there is currently no call
     // if ( (type != PULSEAUDIO) && (!hasCurrentCall())) {
-    // _debug("There is currently a call!!\n");
+    // _debug("There is currently a call!!");
     // _audiodriver->stopStream();
 
     // }
@@ -3237,7 +3237,7 @@ void ManagerImpl::setMicVolume (unsigned short mic_vol)
 
 void ManagerImpl::setSipAddress (const std::string& address)
 {
-  _debug ("Setting new ip to ip address %s\n", address.c_str());
+  _debug ("Setting new ip to ip address %s", address.c_str());
 
     std::string ip_address = std::string(address);
 
@@ -3246,7 +3246,7 @@ void ManagerImpl::setSipAddress (const std::string& address)
     std::string local_address = ip_address.substr(0,index);
     std::string local_port = ip_address.substr(index+1); 
 
-    _debug ("Setting new ip to ip address %s and port %s\n", local_address.c_str(), local_port.c_str());
+    _debug ("Setting new ip to ip address %s and port %s", local_address.c_str(), local_port.c_str());
 
     int prevPort = getConfigInt (IP2IP_PROFILE, LOCAL_PORT);
     std::string prevAddress  = getConfigString(IP2IP_PROFILE, LOCAL_ADDRESS);
@@ -3263,7 +3263,7 @@ int ManagerImpl::getSipAddress (void)
 {
     // return getConfigInt (PREFERENCES , CONFIG_SIP_PORT);
     /* The 'global' SIP port is set throug the IP profile */
-    _debug("-----------------------------------------getSipAddress %i\n", getConfigInt (IP2IP_PROFILE, LOCAL_PORT));
+    _debug("-----------------------------------------getSipAddress %i", getConfigInt (IP2IP_PROFILE, LOCAL_PORT));
 
     return getConfigInt (IP2IP_PROFILE, LOCAL_PORT);
 
@@ -3434,7 +3434,7 @@ ManagerImpl::getConfigString (const std::string& section, const std::string&
 bool
 ManagerImpl::setConfig (const std::string& section, const std::string& name, const std::string& value)
 {
-    _debug ("ManagerImpl::setConfig %s %s %s\n", section.c_str(), name.c_str(), value.c_str());
+    _debug ("ManagerImpl::setConfig %s %s %s", section.c_str(), name.c_str(), value.c_str());
     return _config.setConfigTreeItem (section, name, value);
 }
 
@@ -3449,7 +3449,7 @@ ManagerImpl::setConfig (const std::string& section, const std::string& name, int
 
 void ManagerImpl::setAccountsOrder (const std::string& order)
 {
-    _debug ("Setcreate accounts order : %s\n", order.c_str());
+    _debug ("Setcreate accounts order : %s", order.c_str());
     // Set the new config
     setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, order);
 }
@@ -3472,7 +3472,7 @@ ManagerImpl::getAccountList()
 
         while (iter != _accountMap.end()) {
             if (iter->second != NULL) {
-                //_debug("PUSHING BACK %s\n", iter->first.c_str());
+                //_debug("PUSHING BACK %s", iter->first.c_str());
                 v.push_back (iter->first.data());
             }
 
@@ -3507,7 +3507,7 @@ std::map< std::string, std::string > ManagerImpl::getAccountDetails (const Accou
     Account * account = _accountMap[accountID];
 
     if (account == NULL) {
-        _debug ("Cannot getAccountDetails on a non-existing accountID. Defaults will be used.\n");
+        _debug ("Cannot getAccountDetails on a non-existing accountID. Defaults will be used.");
     }
 
     a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, getConfigString (accountID, CONFIG_ACCOUNT_ALIAS)));
@@ -3633,7 +3633,7 @@ void ManagerImpl::setCredential (const std::string& accountID, const int32_t& in
 
     std::string section = "Credential" + std::string (":") + accountID + std::string (":") + credentialIndex;
 
-    _debug ("Setting credential in section %s\n", section.c_str());
+    _debug ("Setting credential in section %s", section.c_str());
 
     it = credentialInformation.find (USERNAME);
     std::string username;
@@ -3733,7 +3733,7 @@ void ManagerImpl::setAccountDetails (const std::string& accountID, const std::ma
         // it is already saved as a MD5 Hash.
         // TODO: This test is weak. Fix this.
         if ( (password.compare (getConfigString (accountID, PASSWORD)) != 0)) {
-            _debug ("Password sent and password from config are different. Re-hashing\n");
+            _debug ("Password sent and password from config are different. Re-hashing");
             std::string hash;
 
             if (authenticationName.empty()) {
@@ -3974,7 +3974,7 @@ void ManagerImpl::setAccountDetails (const std::string& accountID, const std::ma
             acc->unregisterVoIPLink();
         }
     } else {
-        _debug ("ManagerImpl::setAccountDetails: account is NULL\n");
+        _debug ("ManagerImpl::setAccountDetails: account is NULL");
     }
 
     // Update account details to the client side
@@ -3996,11 +3996,11 @@ ManagerImpl::sendRegister (const std::string& accountID , const int32_t& enable)
 
     if (acc->isEnabled()) {
         // Verify we aren't already registered, then register
-        _debug ("Send register for account %s\n" , accountID.c_str());
+        _debug ("Send register for account %s" , accountID.c_str());
         acc->registerVoIPLink();
     } else {
         // Verify we are already registered, then unregister
-        _debug ("Send unregister for account %s\n" , accountID.c_str());
+        _debug ("Send unregister for account %s" , accountID.c_str());
         acc->unregisterVoIPLink();
     }
 
@@ -4022,7 +4022,7 @@ ManagerImpl::addAccount (const std::map< std::string, std::string >& details)
     // Get the type
     accountType = (*details.find (CONFIG_ACCOUNT_TYPE)).second;
 
-    _debug ("%s\n", newAccountID.c_str());
+    _debug ("%s", newAccountID.c_str());
 
     /** @todo Verify the uniqueness, in case a program adds accounts, two in a row. */
 
@@ -4031,7 +4031,7 @@ ManagerImpl::addAccount (const std::map< std::string, std::string >& details)
     } else if (accountType == "IAX") {
         newAccount = AccountCreator::createAccount (AccountCreator::IAX_ACCOUNT, newAccountID);
     } else {
-        _debug ("Unknown %s param when calling addAccount(): %s\n", CONFIG_ACCOUNT_TYPE, accountType.c_str());
+        _debug ("Unknown %s param when calling addAccount(): %s", CONFIG_ACCOUNT_TYPE, accountType.c_str());
         return "";
     }
 
@@ -4096,7 +4096,7 @@ ManagerImpl::removeAccount (const AccountID& accountID)
 
     saveConfig();
 
-    _debug ("REMOVE ACCOUNT\n");
+    _debug ("REMOVE ACCOUNT");
 
     if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
 
@@ -4110,7 +4110,7 @@ ManagerImpl::associateCallToAccount (const CallID& callID, const AccountID& acco
         if (accountExists (accountID)) {    // account id exist in AccountMap
             ost::MutexLock m (_callAccountMapMutex);
             _callAccountMap[callID] = accountID;
-            _debug ("Associate Call %s with Account %s\n", callID.data(), accountID.data());
+            _debug ("Associate Call %s with Account %s", callID.data(), accountID.data());
             return true;
         } else {
             return false;
@@ -4212,11 +4212,11 @@ ManagerImpl::loadAccountMap()
         }
 
         else {
-            _debug ("Unknown %s param in config file (%s)\n", CONFIG_ACCOUNT_TYPE, accountType.c_str());
+            _debug ("Unknown %s param in config file (%s)", CONFIG_ACCOUNT_TYPE, accountType.c_str());
         }
 
         if (tmpAccount != NULL) {
-            _debug ("Loading account %s \n", iter->c_str());
+            _debug ("Loading account %s ", iter->c_str());
             _accountMap[iter->c_str() ] = tmpAccount;
             nbAccount++;
         }
@@ -4225,16 +4225,16 @@ ManagerImpl::loadAccountMap()
     }
 
     if (_directIpAccount == NULL) {
-        _debug ("Failed to create direct ip calls \"account\"\n");
+        _debug ("Failed to create direct ip calls \"account\"");
     } else {
         // Force the options to be loaded
         // No registration in the sense of
         // the REGISTER method is performed.
-        _debug ("Succeed to create direct ip calls \"account\"\n");
+        _debug ("Succeed to create direct ip calls \"account\"");
         _directIpAccount->registerVoIPLink();
     }
 
-    _debug ("nbAccount loaded %i \n",nbAccount);
+    _debug ("nbAccount loaded %i ",nbAccount);
 
     return nbAccount;
 }
@@ -4247,7 +4247,7 @@ ManagerImpl::unloadAccountMap()
 
     while (iter != _accountMap.end()) {
 
-        _debug ("-> Unloading account %s\n", iter->first.c_str());
+        _debug ("-> Unloading account %s", iter->first.c_str());
         delete iter->second;
         iter->second = 0;
 
@@ -4275,7 +4275,7 @@ ManagerImpl::getAccount (const AccountID& accountID)
     // In our definition,
     // this is the "direct ip calls account"
     if (accountID == AccountNULL) {
-		_debug ("Returns the direct IP account\n");
+		_debug ("Returns the direct IP account");
         return _directIpAccount;
     }
 
@@ -4293,16 +4293,16 @@ ManagerImpl::getAccountIdFromNameAndServer (const std::string& userName, const s
 {
     AccountMap::iterator iter;
     SIPAccount *account;
-    _debug ("getAccountIdFromNameAndServer : username = %s , server = %s\n", userName.c_str(), server.c_str());
+    _debug ("getAccountIdFromNameAndServer : username = %s , server = %s", userName.c_str(), server.c_str());
     // Try to find the account id from username and server name by full match
 
     for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) {
-        _debug ("for : account = %s\n", iter->first.c_str());
+        _debug ("for : account = %s", iter->first.c_str());
         account = dynamic_cast<SIPAccount *> (iter->second);
 
         if (account != NULL) {
             if (account->fullMatch (userName, server)) {
-                _debug ("Matching accountId in request is a fullmatch\n");
+                _debug ("Matching accountId in request is a fullmatch");
                 return iter->first;
             }
         }
@@ -4314,7 +4314,7 @@ ManagerImpl::getAccountIdFromNameAndServer (const std::string& userName, const s
 
         if (account != NULL) {
             if (account->hostnameMatch (server)) {
-                _debug ("Matching accountId in request with hostname\n");
+                _debug ("Matching accountId in request with hostname");
                 return iter->first;
             }
         }
@@ -4326,7 +4326,7 @@ ManagerImpl::getAccountIdFromNameAndServer (const std::string& userName, const s
 
         if (account != NULL) {
             if (account->userMatch (userName)) {
-                _debug ("Matching accountId in request with username\n");
+                _debug ("Matching accountId in request with username");
                 return iter->first;
             }
         }
@@ -4354,6 +4354,45 @@ void ManagerImpl::restartPJSIP (void)
     this->registerCurSIPAccounts (siplink);
 }
 
+int
+ManagerImpl::registerAccounts()
+{
+    int status;
+    bool flag = true;
+    AccountMap::iterator iter;
+
+    _debugInit ("Initiate VoIP Links Registration");
+    iter = _accountMap.begin();
+
+    /* Loop on the account map previously loaded */
+
+    while (iter != _accountMap.end()) {
+        if (iter->second) {
+
+            if (iter->second->isEnabled()) {
+
+		_debug("Register account %s", iter->first.c_str());
+		
+                status = iter->second->registerVoIPLink();
+
+                if (status != SUCCESS) {
+                    flag = false;
+                }
+            }
+        }
+
+        iter++;
+    }
+
+    // calls the client notification here in case of errors at startup...
+    if (_audiodriver -> getErrorMessage() != -1)
+        notifyErrClient (_audiodriver -> getErrorMessage());
+
+    ASSERT (flag, true);
+
+    return SUCCESS;
+}
+
 VoIPLink* ManagerImpl::getAccountLink (const AccountID& accountID)
 {
     if (accountID!=AccountNULL) {
@@ -4520,7 +4559,7 @@ void ManagerImpl::check_call_configuration (const CallID& id, const std::string
     Call::CallConfiguration config;
 
     if (to.find (SIP_SCHEME) == 0 || to.find (SIPS_SCHEME) == 0) {
-        _debug ("Sending Sip Call \n");
+        _debug ("Sending Sip Call ");
         config = Call::IPtoIP;
     } else {
         config = Call::Classic;
@@ -4537,7 +4576,7 @@ bool ManagerImpl::associateConfigToCall (const CallID& callID, Call::CallConfigu
 
     if (getConfigFromCall (callID) == CallConfigNULL) { // nothing with the same ID
         _callConfigMap[callID] = config;
-        _debug ("Associate Call %s with config %i\n", callID.data(), config);
+        _debug ("Associate Call %s with config %i", callID.data(), config);
         return true;
     } else {
         return false;
@@ -4583,7 +4622,7 @@ std::map< std::string, std::string > ManagerImpl::getCallDetails (const CallID&
 
     // So first we fetch the account
     accountid = getAccountFromCall (callID);
-    _debug ("%s\n",callID.c_str());
+    _debug ("%s",callID.c_str());
     // Then the VoIP link this account is linked with (IAX2 or SIP)
 
     if ( (account=getAccount (accountid)) != 0) {
@@ -4603,7 +4642,7 @@ std::map< std::string, std::string > ManagerImpl::getCallDetails (const CallID&
         call_details.insert (std::pair<std::string, std::string> ("CALL_STATE", call->getStateStr ()));
         call_details.insert (std::pair<std::string, std::string> ("CALL_TYPE", type.str ()));
     } else {
-        _debug ("Error: Managerimpl - getCallDetails ()\n");
+        _debug ("Error: Managerimpl - getCallDetails ()");
         call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", AccountNULL));
         call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", "Unknown"));
         call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", "Unknown"));
@@ -4668,7 +4707,7 @@ ManagerImpl::getConferenceDetails (const ConfID& confID)
 std::vector< std::string >
 ManagerImpl::getConferenceList (void)
 {
-    _debug ("ManagerImpl::getConferenceList\n");
+    _debug ("ManagerImpl::getConferenceList");
     std::vector< std::string > v;
 
     ConferenceMap::iterator iter = _conferencemap.begin();
@@ -4685,7 +4724,7 @@ ManagerImpl::getConferenceList (void)
 std::vector< std::string >
 ManagerImpl::getParticipantList (const std::string& confID)
 {
-    _debug ("ManagerImpl::getParticipantList\n");
+    _debug ("ManagerImpl::getParticipantList");
     std::vector< std::string > v;
 
     ConferenceMap::iterator iter_conf = _conferencemap.find (confID);
diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h
index 997656a03ede1e0a47cb12e7d02191c067f0ae8d..f241fabc4038b685a91a544985a288a4012a3ccb 100644
--- a/sflphone-common/src/managerimpl.h
+++ b/sflphone-common/src/managerimpl.h
@@ -1029,6 +1029,14 @@ class ManagerImpl {
      */
     bool isCurrentCall(const CallID& callId);
 
+
+    /**
+     * Send registration to all enabled accounts
+     * @return 0 on registration success
+     *          1 otherelse
+     */
+    int registerAccounts();
+
     /**
      * Restart PJSIP
      * @param void
diff --git a/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp b/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp
index 49ea4417cce81a6ee9e15193960b88b6804bba7f..f9b5c014ef5c7c4e5976946afb08ac2df028051c 100644
--- a/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp
+++ b/sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp
@@ -39,8 +39,8 @@ AudioDSP::~AudioDSP()
 
 float AudioDSP::getRMS (int data)
 {
-    // printf("AudioDSP::getRMS() : bufPointer_ %i \n ", bufPointer_);
-    printf ("AudioDSP::getRMS() : %i \n", data);
+    // printf("AudioDSP::getRMS() : bufPointer_ %i  ", bufPointer_);
+    printf ("AudioDSP::getRMS() : %i ", data);
     circBuffer_[bufPointer_++] = (float) data;
 
     if (bufPointer_ >= bufferLength_)
@@ -57,13 +57,13 @@ float AudioDSP::computeRMS()
 
 
     for (int i = 0; i < bufferLength_; i++) {
-        // printf("AudioDSP::computeRMS() : i_ %i \n ", i);
+        // printf("AudioDSP::computeRMS() : i_ %i  ", i);
         rms += (float) (circBuffer_[i]*circBuffer_[i]);
     }
 
     rms = sqrt (rms / (float) bufferLength_);
 
-    // printf("AudioDSP::computeRMS() : RMS VALUE: %f \n", rms);
+    // printf("AudioDSP::computeRMS() : RMS VALUE: %f ", rms);
     return rms;
 
 }
diff --git a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
index 9b265de0ee33c9f53f73026cb14c676f949948a4..4ab7c6c9708ac4a4d2143ee410ebec482dfce5f1 100644
--- a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
+++ b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
@@ -93,12 +93,12 @@ void AudioRecord::initFileName (std::string peerNumber)
 
     if (fileType_ == FILE_RAW) {
         if (strstr (fileName_, ".raw") == NULL) {
-            printf ("AudioRecord::openFile::concatenate .raw file extension: name : %s \n", fileName_);
+            printf ("AudioRecord::openFile::concatenate .raw file extension: name : %s ", fileName_);
             fName.append (".raw");
         }
     } else if (fileType_ == FILE_WAV) {
         if (strstr (fileName_, ".wav") == NULL) {
-            printf ("AudioRecord::openFile::concatenate .wav file extension: name : %s \n", fileName_);
+            printf ("AudioRecord::openFile::concatenate .wav file extension: name : %s ", fileName_);
             fName.append (".wav");
         }
     }
@@ -110,14 +110,14 @@ void AudioRecord::openFile()
 {
 
 
-    _debug ("AudioRecord::openFile()\n");
+    _debug ("AudioRecord::openFile()");
 
     bool result = false;
 
-    _debug ("AudioRecord::openFile()\n");
+    _debug ("AudioRecord::openFile()");
 
     if (isFileExist()) {
-        _debug ("AudioRecord::Filename does not exist, creating one \n");
+        _debug ("AudioRecord::Filename does not exist, creating one ");
         byteCounter_ = 0;
 
         if (fileType_ == FILE_RAW) {
@@ -126,7 +126,7 @@ void AudioRecord::openFile()
             result = setWavFile();
         }
     } else {
-        _debug ("AudioRecord::Filename already exist opening it \n");
+        _debug ("AudioRecord::Filename already exist opening it ");
 
         if (fileType_ == FILE_RAW) {
             result = openExistingRawFile();
@@ -156,10 +156,10 @@ bool AudioRecord::isOpenFile()
 {
 
     if (fp) {
-        _debug ("AudioRecord::isOpenFile(): file already openend\n");
+        _debug ("AudioRecord::isOpenFile(): file already openend");
         return true;
     } else {
-        _debug ("AudioRecord::isOpenFIle(): file not openend \n");
+        _debug ("AudioRecord::isOpenFIle(): file not openend ");
         return false;
     }
 }
@@ -167,7 +167,7 @@ bool AudioRecord::isOpenFile()
 
 bool AudioRecord::isFileExist()
 {
-    _debug ("AudioRecord::isFileExist(): try to open name : %s \n", fileName_);
+    _debug ("AudioRecord::isFileExist(): try to open name : %s ", fileName_);
 
     if (fopen (fileName_,"rb") ==0) {
         return true;
@@ -178,7 +178,7 @@ bool AudioRecord::isFileExist()
 
 bool AudioRecord::isRecording()
 {
-    _debug ("AudioRecording::isRecording() %i \n", recordingEnabled_);
+    _debug ("AudioRecording::isRecording() %i ", recordingEnabled_);
 
 
     if (recordingEnabled_)
@@ -190,17 +190,17 @@ bool AudioRecord::isRecording()
 
 bool AudioRecord::setRecording()
 {
-    _debug ("AudioRecord::setRecording() \n");
+    _debug ("AudioRecord::setRecording() ");
 
     if (isOpenFile()) {
-        _debug ("AudioRecord::setRecording()::file already opened \n");
+        _debug ("AudioRecord::setRecording()::file already opened ");
 
         if (!recordingEnabled_)
             recordingEnabled_ = true;
         else
             recordingEnabled_ = false;
     } else {
-        _debug ("AudioRecord::setRecording():Opening the wave file in call during call instantiation \n");
+        _debug ("AudioRecord::setRecording():Opening the wave file in call during call instantiation ");
         openFile();
 
         recordingEnabled_ = true; // once opend file, start recording
@@ -213,7 +213,7 @@ bool AudioRecord::setRecording()
 
 void AudioRecord::stopRecording()
 {
-    _debug ("AudioRecording::stopRecording() \n");
+    _debug ("AudioRecording::stopRecording() ");
 
     if (recordingEnabled_)
         recordingEnabled_ = false;
@@ -270,7 +270,7 @@ void AudioRecord::createFilename()
     // fileName_ = out.str();
     strncpy (fileName_, out.str().c_str(), 8192);
 
-    printf ("AudioRecord::createFilename::filename for this call %s \n",fileName_);
+    printf ("AudioRecord::createFilename::filename for this call %s ",fileName_);
 }
 
 bool AudioRecord::setRawFile()
@@ -279,16 +279,16 @@ bool AudioRecord::setRawFile()
     fp = fopen (savePath_.c_str(), "wb");
 
     if (!fp) {
-        _debug ("AudioRecord::setRawFile() : could not create RAW file!\n");
+        _debug ("AudioRecord::setRawFile() : could not create RAW file!");
         return false;
     }
 
     if (sndFormat_ != INT16) {   // TODO need to change INT16 to SINT16
         sndFormat_ = INT16;
-        _debug ("AudioRecord::setRawFile() : using 16-bit signed integer data format for file.\n");
+        _debug ("AudioRecord::setRawFile() : using 16-bit signed integer data format for file.");
     }
 
-    _debug ("AudioRecord:setRawFile() : created RAW file.\n");
+    _debug ("AudioRecord:setRawFile() : created RAW file.");
 
     return true;
 }
@@ -300,7 +300,7 @@ bool AudioRecord::setWavFile()
     fp = fopen (savePath_.c_str(), "wb");
 
     if (!fp) {
-        _debug ("AudioRecord::setWavFile() : could not create WAV file.\n");
+        _debug ("AudioRecord::setWavFile() : could not create WAV file.");
         return false;
     }
 
@@ -328,11 +328,11 @@ bool AudioRecord::setWavFile()
 
 
     if (fwrite (&hdr, 4, 11, fp) != 11) {
-        _debug ("AudioRecord::setWavFile() : could not write WAV header for file. \n");
+        _debug ("AudioRecord::setWavFile() : could not write WAV header for file. ");
         return false;
     }
 
-    _debug ("AudioRecord::setWavFile() : created WAV file. \n");
+    _debug ("AudioRecord::setWavFile() : created WAV file. ");
 
     return true;
 }
@@ -343,7 +343,7 @@ bool AudioRecord::openExistingRawFile()
     fp = fopen (fileName_, "ab+");
 
     if (!fp) {
-        _debug ("AudioRecord::openExistingRawFile() : could not create RAW file!\n");
+        _debug ("AudioRecord::openExistingRawFile() : could not create RAW file!");
         return false;
     }
 
@@ -353,42 +353,42 @@ bool AudioRecord::openExistingRawFile()
 
 bool AudioRecord::openExistingWavFile()
 {
-    _debug ("AudioRecord::openExistingWavFile() \n");
+    _debug ("AudioRecord::openExistingWavFile() ");
 
     fp = fopen (fileName_, "rb+");
 
     if (!fp) {
-        _debug ("AudioRecord::openExistingWavFile() : could not open WAV file rb+!\n");
+        _debug ("AudioRecord::openExistingWavFile() : could not open WAV file rb+!");
         return false;
     }
 
-    printf ("AudioRecord::openExistingWavFile()::Tried to open %s \n",fileName_);
+    printf ("AudioRecord::openExistingWavFile()::Tried to open %s ",fileName_);
 
     if (fseek (fp, 40, SEEK_SET) != 0) // jump to data length
-        _debug ("AudioRecord::OpenExistingWavFile: 1.Couldn't seek offset 40 in the file \n");
+        _debug ("AudioRecord::OpenExistingWavFile: 1.Couldn't seek offset 40 in the file ");
 
     if (fread (&byteCounter_, 4, 1, fp))
-        _debug ("AudioRecord::OpenExistingWavFile : bytecounter Read successfully \n");
+        _debug ("AudioRecord::OpenExistingWavFile : bytecounter Read successfully ");
 
     if (fseek (fp, 0 , SEEK_END) != 0)
-        _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file \n");
+        _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file ");
 
-    printf ("AudioRecord::OpenExistingWavFile : Byte counter after oppening : %d \n", (int) byteCounter_);
+    printf ("AudioRecord::OpenExistingWavFile : Byte counter after oppening : %d ", (int) byteCounter_);
 
     if (fclose (fp) != 0)
-        _debug ("AudioRecord::openExistingWavFile()::ERROR: can't close file r+ \n");
+        _debug ("AudioRecord::openExistingWavFile()::ERROR: can't close file r+ ");
 
 
 
     fp = fopen (fileName_, "ab+");
 
     if (!fp) {
-        _debug ("AudioRecord::openExistingWavFile() : could not createopen WAV file ab+!\n");
+        _debug ("AudioRecord::openExistingWavFile() : could not createopen WAV file ab+!");
         return false;
     }
 
     if (fseek (fp, 4 , SEEK_END) != 0)
-        _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file \n");
+        _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file ");
 
     return true;
 
@@ -398,7 +398,7 @@ bool AudioRecord::openExistingWavFile()
 void AudioRecord::closeWavFile()
 {
     if (fp == 0) {
-        _debug ("AudioRecord:: Can't closeWavFile, a file has not yet been opened!\n");
+        _debug ("AudioRecord:: Can't closeWavFile, a file has not yet been opened!");
         return;
     }
 
@@ -407,28 +407,28 @@ void AudioRecord::closeWavFile()
 
     fseek (fp, 40, SEEK_SET); // jump to data length
 
-    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 40\n");
+    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 40");
 
     fwrite (&bytes, sizeof (SINT32), 1, fp);
 
-    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't write bytes for data length \n");
+    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't write bytes for data length ");
 
-    printf ("AudioRecord::closeWavFile : data bytes: %i \n", (int) bytes);
+    printf ("AudioRecord::closeWavFile : data bytes: %i ", (int) bytes);
 
     bytes = byteCounter_ * channels_ + 44; // + 44 for the wave header
 
     fseek (fp, 4, SEEK_SET); // jump to file size
 
-    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4\n");
+    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4");
 
     fwrite (&bytes, 4, 1, fp);
 
-    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4\n");
+    if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4");
 
-    printf ("AudioRecord::closeWavFile : bytes : %i \n", (int) bytes);
+    printf ("AudioRecord::closeWavFile : bytes : %i ", (int) bytes);
 
     if (fclose (fp) != 0)
-        _debug ("AudioRecord::closeWavFile()::ERROR: can't close file\n");
+        _debug ("AudioRecord::closeWavFile()::ERROR: can't close file");
 
 
 }
@@ -470,7 +470,7 @@ void AudioRecord::recData (SFLDataFormat* buffer, int nSamples)
     if (recordingEnabled_) {
 
         if (fp == 0) {
-            _debug ("AudioRecord: Can't record data, a file has not yet been opened!\n");
+            _debug ("AudioRecord: Can't record data, a file has not yet been opened!");
             return;
         }
 
@@ -478,7 +478,7 @@ void AudioRecord::recData (SFLDataFormat* buffer, int nSamples)
 
         if (sndFormat_ == INT16) {   // TODO change INT16 to SINT16
             if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != (unsigned int) nSamples)
-                _debug ("AudioRecord: Could not record data! \n");
+                _debug ("AudioRecord: Could not record data! ");
             else {
                 fflush (fp);
                 byteCounter_ += (unsigned long) (nSamples*sizeof (SFLDataFormat));
@@ -496,7 +496,7 @@ void AudioRecord::recData (SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int
     if (recordingEnabled_) {
 
         if (fp == 0) {
-            _debug ("AudioRecord: Can't record data, a file has not yet been opened!\n");
+            _debug ("AudioRecord: Can't record data, a file has not yet been opened!");
             return;
         }
 
@@ -508,7 +508,7 @@ void AudioRecord::recData (SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int
 
 
                 if (fwrite (&mixBuffer_[k], 2, 1, fp) != 1)
-                    _debug ("AudioRecord: Could not record data!\n");
+                    _debug ("AudioRecord: Could not record data!");
                 else {
                     fflush (fp);
                 }
diff --git a/sflphone-common/src/plug-in/librarymanager.cpp b/sflphone-common/src/plug-in/librarymanager.cpp
index 0c8c1040bde8ac0497d3e7985355629662981faf..45567c18fc62d1cdc805839f7a0b93c3289472f3 100644
--- a/sflphone-common/src/plug-in/librarymanager.cpp
+++ b/sflphone-common/src/plug-in/librarymanager.cpp
@@ -36,14 +36,14 @@ LibraryManager::LibraryHandle LibraryManager::loadLibrary (const std::string &fi
     LibraryHandle pluginHandlePtr = NULL;
     const char *error;
 
-    _debug ("Loading dynamic library %s\n", filename.c_str());
+    _debug ("Loading dynamic library %s", filename.c_str());
 
     /* Load the library */
     pluginHandlePtr = dlopen (filename.c_str(), RTLD_LAZY);
 
     if (!pluginHandlePtr) {
         error = dlerror();
-        _debug ("Error while opening plug-in: %s\n", error);
+        _debug ("Error while opening plug-in: %s", error);
         return NULL;
     }
 
@@ -57,12 +57,12 @@ int LibraryManager::unloadLibrary ()
     if (_handlePtr == NULL)
         return 1;
 
-    _debug ("Unloading dynamic library ...\n");
+    _debug ("Unloading dynamic library ...");
 
     dlclose (_handlePtr);
 
     if (dlerror()) {
-        _debug ("Error unloading the library : %s\n...", dlerror());
+        _debug ("Error unloading the library : %s...", dlerror());
         return 1;
     }
 
@@ -96,7 +96,7 @@ LibraryManagerException::LibraryManagerException (const std::string &libraryName
 
 {
     if (_reason == loadingFailed)
-        _details = "Error when loading " + libraryName + "\n" + details;
+        _details = "Error when loading " + libraryName + "" + details;
     else
         _details = "Error when resolving symbol " + details + " in " + libraryName;
 }
diff --git a/sflphone-common/src/plug-in/pluginmanager.cpp b/sflphone-common/src/plug-in/pluginmanager.cpp
index 80197f6ccef529d2b0d19ef4a415d251923c3858..431f3eb8744bc2ea02b4ed9f37fa1908844abcd4 100644
--- a/sflphone-common/src/plug-in/pluginmanager.cpp
+++ b/sflphone-common/src/plug-in/pluginmanager.cpp
@@ -59,7 +59,7 @@ PluginManager::loadPlugins (const std::string &path)
 
     /* The directory in which plugins are dropped. Default: /usr/lib/sflphone/plugins/ */
     (path == "") ? pluginDir = std::string (PLUGINS_DIR).append ("/") :pluginDir = path;
-    _debug ("Loading plugins from %s...\n", pluginDir.c_str());
+    _debug ("Loading plugins from %s...", pluginDir.c_str());
 
     dir = opendir (pluginDir.c_str());
     /* Test if the directory exists or is readable */
@@ -79,13 +79,13 @@ PluginManager::loadPlugins (const std::string &path)
                 /* Instanciate the plugin object */
 
                 if (instanciatePlugin (library, &plugin) != 0) {
-                    _debug ("Error instanciating the plugin ...\n");
+                    _debug ("Error instanciating the plugin ...");
                     return 1;
                 }
 
                 /* Regitering the current plugin */
                 if (registerPlugin (plugin, library) != 0) {
-                    _debug ("Error registering the plugin ...\n");
+                    _debug ("Error registering the plugin ...");
                     return 1;
                 }
             }
@@ -115,14 +115,14 @@ PluginManager::unloadPlugins (void)
         info = iter->second;
 
         if (deletePlugin (info) != 0) {
-            _debug ("Error deleting the plugin ... \n");
+            _debug ("Error deleting the plugin ... ");
             return 1;
         }
 
         unloadDynamicLibrary (info->_libraryPtr);
 
         if (unregisterPlugin (info) != 0) {
-            _debug ("Error unregistering the plugin ... \n");
+            _debug ("Error unregistering the plugin ... ");
             return 1;
         }
 
@@ -161,7 +161,7 @@ PluginManager::loadDynamicLibrary (const std::string& filename)
 int
 PluginManager::unloadDynamicLibrary (LibraryManager *libraryPtr)
 {
-    _debug ("Unloading dynamic library ...\n");
+    _debug ("Unloading dynamic library ...");
     /* Close it */
     return libraryPtr->unloadLibrary ();
 }
diff --git a/sflphone-common/src/sip/sdp.cpp b/sflphone-common/src/sip/sdp.cpp
index 116d2df867c4b7622decbccbaf19de71f1d9ed0a..480958e22cb287e37f802e177ff71feb49627292 100644
--- a/sflphone-common/src/sip/sdp.cpp
+++ b/sflphone-common/src/sip/sdp.cpp
@@ -91,7 +91,7 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med)
     for (i=0; i<count; i++) {
         codec = media->get_media_codec_list() [i];
         tmp = this->convert_int_to_string (codec->getPayload ());
-        _debug ("%s\n", tmp.c_str());
+        _debug ("%s", tmp.c_str());
         pj_strdup2 (_pool, &med->desc.fmt[i], tmp.c_str());
 
         // Add a rtpmap field for each codec
@@ -127,7 +127,7 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med)
             throw;
         }
     } else {
-        _debug ("No hash specified\n");
+        _debug ("No hash specified");
     }
 
     *p_med = med;
@@ -137,7 +137,7 @@ int Sdp::create_local_offer ()
 {
     pj_status_t status;
 
-    _debug ("Create local offer\n");
+    _debug ("Create local offer");
     // Build local media capabilities
     set_local_media_capabilities ();
 
@@ -172,12 +172,12 @@ int Sdp::create_initial_offer()
     pj_status_t status;
     pjmedia_sdp_neg_state state;
 
-    _debug ("Create initial offer\n");
+    _debug ("Create initial offer");
     // Build the SDP session descriptor
     status = create_local_offer();
 
     if (status != PJ_SUCCESS) {
-        _debug ("    Error: Failled to create initial offer\n");
+        _debug ("    Error: Failled to create initial offer");
         return status;
     }
 
@@ -185,7 +185,7 @@ int Sdp::create_initial_offer()
     status = pjmedia_sdp_neg_create_w_local_offer (_pool, get_local_sdp_session(), &_negociator);
 
     if (status != PJ_SUCCESS) {
-        _debug ("    Error: Failled to create an initial SDP negociator\n");
+        _debug ("    Error: Failled to create an initial SDP negociator");
         return status;
     }
 
@@ -193,7 +193,7 @@ int Sdp::create_initial_offer()
 
     PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
 
-    _debug ("    Initial offer created succesfully\n");
+    _debug ("    Initial offer created succesfully");
 
     return PJ_SUCCESS;
 }
@@ -205,7 +205,7 @@ int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote)
 
     pj_status_t status;
 
-    _debug ("Receiving initial offer\n");
+    _debug ("Receiving initial offer");
 
     // Create the SDP negociator instance by calling
     // pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional )
@@ -246,12 +246,12 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata)
         }
 
         if (message->body == NULL) {
-            _debug ("Empty message body\n");
+            _debug ("Empty message body");
             return PJMEDIA_SDP_EINSDP;
         }
 
         if (pj_stricmp (&message->body->content_type.type, &str_application) || pj_stricmp (&message->body->content_type.subtype, &str_sdp)) {
-            _debug ("Incoming Message does not contain SDP\n");
+            _debug ("Incoming Message does not contain SDP");
             return PJMEDIA_SDP_EINSDP;
         }
 
@@ -263,17 +263,17 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata)
         }
 
         if (status != PJ_SUCCESS) {
-            _debug ("SDP cannot be validated\n");
+            _debug ("SDP cannot be validated");
             return PJMEDIA_SDP_EINSDP;
         }
 
         // This is an answer
-        _debug ("Got SDP answer %s\n", pjsip_rx_data_get_info (rdata));
+        _debug ("Got SDP answer %s", pjsip_rx_data_get_info (rdata));
 
         status = pjmedia_sdp_neg_set_remote_answer (inv->pool, inv->neg, remote_sdp);
 
         if (status != PJ_SUCCESS) {
-            _debug ("An error occured while processing remote answer %s\n", pjsip_rx_data_get_info (rdata));
+            _debug ("An error occured while processing remote answer %s", pjsip_rx_data_get_info (rdata));
             return PJMEDIA_SDP_EINSDP;
         }
 
@@ -282,9 +282,9 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata)
 
         status = pjmedia_sdp_neg_negotiate (inv->pool, inv->neg, 0);
 
-        _debug ("Negotiation returned with status %d PJ_SUCCESS being %d\n", status, PJ_SUCCESS);
+        _debug ("Negotiation returned with status %d PJ_SUCCESS being %d", status, PJ_SUCCESS);
     } else {
-        _debug ("No need to check sdp answer since we are UAS\n");
+        _debug ("No need to check sdp answer since we are UAS");
         return PJ_SUCCESS;
     }
 
@@ -442,9 +442,9 @@ void Sdp::set_negotiated_sdp (const pjmedia_sdp_session *sdp)
             // pj_strtoul(attribute->pt)
             pjmedia_sdp_attr_to_rtpmap (_pool, attribute, &rtpmap);
 
-            // _debug("================== set_negociated_offer ===================== %i\n", pj_strtoul(&rtpmap->pt));
-            // _debug("================== set_negociated_offer ===================== %s\n", current->desc.fmt[j].ptr);
-            // _debug("================== set_negociated_offer ===================== %i\n", atoi(current->desc.fmt[j].ptr));
+            // _debug("================== set_negociated_offer ===================== %i", pj_strtoul(&rtpmap->pt));
+            // _debug("================== set_negociated_offer ===================== %s", current->desc.fmt[j].ptr);
+            // _debug("================== set_negociated_offer ===================== %i", atoi(current->desc.fmt[j].ptr));
             iter = codecs_list.find ( (AudioCodecType) pj_strtoul (&rtpmap->pt));
 
             if (iter==codecs_list.end())
@@ -465,7 +465,7 @@ AudioCodec* Sdp::get_session_media (void)
     AudioCodec *codec = NULL;
     std::vector<sdpMedia*> media_list;
 
-    _debug ("Executing sdp line %d - get_session_media ()\n", __LINE__);
+    _debug ("Executing sdp line %d - get_session_media ()", __LINE__);
 
     media_list = get_session_media_list ();
     nb_media = media_list.size();
@@ -515,9 +515,7 @@ void Sdp::toString (void)
         sdp << _local_offer->media[0]->desc.fmt[i].ptr << " ";
     }
 
-    sdp << "\n";
-
-    _debug ("LOCAL SDP: \n%s\n", sdp.str().c_str());
+    _debug ("LOCAL SDP: \n%s", sdp.str().c_str());
 
 }
 
@@ -533,7 +531,7 @@ void Sdp::set_local_media_capabilities ()
     // Clean it first
     _local_media_cap.clear();
 
-    _debug ("Fetch local media capabilities. Local extern audio port: %i\n" , get_local_extern_audio_port());
+    _debug ("Fetch local media capabilities. Local extern audio port: %i" , get_local_extern_audio_port());
 
     /* Only one audio media used right now */
     audio = new sdpMedia (MIME_TYPE_AUDIO);
@@ -581,7 +579,7 @@ void Sdp::set_remote_ip_from_sdp (const pjmedia_sdp_session *r_sdp)
 {
 
     std::string remote_ip (r_sdp->conn->addr.ptr, r_sdp->conn->addr.slen);
-    _debug ("            Remote IP from fetching SDP: %s\n", remote_ip.c_str());
+    _debug ("            Remote IP from fetching SDP: %s", remote_ip.c_str());
     this->set_remote_ip (remote_ip);
 }
 
@@ -591,21 +589,21 @@ void Sdp::set_remote_audio_port_from_sdp (pjmedia_sdp_media *r_media)
     int remote_port;
 
     remote_port = r_media->desc.port;
-    _debug ("            Remote Audio Port from fetching SDP: %d\n", remote_port);
+    _debug ("            Remote Audio Port from fetching SDP: %d", remote_port);
     this->set_remote_audio_port (remote_port);
 }
 
 void Sdp::set_media_transport_info_from_remote_sdp (const pjmedia_sdp_session *remote_sdp)
 {
 
-    _debug ("Fetching media from sdp\n");
+    _debug ("Fetching media from sdp");
 
     pjmedia_sdp_media *r_media;
 
     this->get_remote_sdp_media_from_offer (remote_sdp, &r_media);
 
     if (r_media==NULL) {
-        _debug ("SDP Failure: no remote sdp media found in the remote offer\n");
+        _debug ("SDP Failure: no remote sdp media found in the remote offer");
         return;
     }
 
diff --git a/sflphone-common/src/sip/sipaccount.cpp b/sflphone-common/src/sip/sipaccount.cpp
index a28461dea4f53e0c60737f017b0a9abf47eca6c7..33445ad71ad9193b9a4deec3949e1a378781fa30 100644
--- a/sflphone-common/src/sip/sipaccount.cpp
+++ b/sflphone-common/src/sip/sipaccount.cpp
@@ -79,7 +79,7 @@ int SIPAccount::initCredential (void)
     pjsip_cred_info * cred_info = (pjsip_cred_info *) malloc (sizeof (pjsip_cred_info) * (credentialCount));
 
     if (cred_info == NULL) {
-        _debug ("Failed to set cred_info for account %s\n", _accountID.c_str());
+        _debug ("Failed to set cred_info for account %s", _accountID.c_str());
         return !SUCCESS;
     }
 
@@ -104,7 +104,7 @@ int SIPAccount::initCredential (void)
 // on an assertion.
     if (md5HashingEnabled && _password.length() == 32) {
         dataType = PJSIP_CRED_DATA_DIGEST;
-        _debug ("Setting digest \n");
+        _debug ("Setting digest ");
     } else {
         dataType = PJSIP_CRED_DATA_PLAIN_PASSWD;
     }
@@ -139,7 +139,7 @@ int SIPAccount::initCredential (void)
 
         if (md5HashingEnabled && _password.length() == 32) {
             dataType = PJSIP_CRED_DATA_DIGEST;
-            _debug ("Setting digest \n");
+            _debug ("Setting digest ");
         } else {
             dataType = PJSIP_CRED_DATA_PLAIN_PASSWD;
         }
@@ -148,7 +148,7 @@ int SIPAccount::initCredential (void)
 
         cred_info[i].scheme = pj_str ( (char*) "digest");
 
-        _debug ("Setting credential %d realm = %s passwd = %s username = %s data_type = %d\n", i, realm.c_str(), password.c_str(), username.c_str(), cred_info[i].data_type);
+        _debug ("Setting credential %d realm = %s passwd = %s username = %s data_type = %d", i, realm.c_str(), password.c_str(), username.c_str(), cred_info[i].data_type);
     }
 
     _credentialCount = credentialCount;
@@ -200,7 +200,7 @@ int SIPAccount::registerVoIPLink()
 
 int SIPAccount::unregisterVoIPLink()
 {
-    _debug ("Unregister account %s\n" , getAccountID().c_str());
+    _debug ("Unregister account %s" , getAccountID().c_str());
 
     if (_accountID == IP2IP_PROFILE) {
         return true;
@@ -341,7 +341,7 @@ void SIPAccount::loadConfig()
     bool tlsEnabled = Manager::instance().getConfigBool (_accountID, TLS_ENABLE);
 
     if (tlsEnabled) {
-        _debug ("---------------------------- TLS Enabled\n");
+        _debug ("---------------------------- TLS Enabled");
         initTlsConfiguration();
         _transportType = PJSIP_TRANSPORT_TLS;
     } else {
@@ -525,7 +525,7 @@ std::string SIPAccount::getContactHeader (const std::string& address, const std:
 
     _displayName = Manager::instance().getConfigString (_accountID, DISPLAY_NAME);
 
-    _debug ("Display Name: %s\n", _displayName.c_str());
+    _debug ("Display Name: %s", _displayName.c_str());
 
     int len = pj_ansi_snprintf (contact, PJSIP_MAX_URL_SIZE,
 
diff --git a/sflphone-common/src/sip/sipcall.cpp b/sflphone-common/src/sip/sipcall.cpp
index 60680c779a8cf3f0e0b8dbf505b17e7e06f5ba97..d1e22660c64e97650684a27048114b875de382e2 100644
--- a/sflphone-common/src/sip/sipcall.cpp
+++ b/sflphone-common/src/sip/sipcall.cpp
@@ -34,7 +34,7 @@ SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_pool_t *pool) : Call
         , _local_sdp (0)
 {
     _local_sdp = new Sdp (pool);
-    _debug ("SIPCALL::Constructor for this class is called \n");
+    _debug ("SIPCALL::Constructor for this class is called ");
 }
 
 SIPCall::~SIPCall()
@@ -43,7 +43,7 @@ SIPCall::~SIPCall()
     _audiortp = 0;
     delete _local_sdp;
     _local_sdp = 0;
-    _debug ("SIPCALL::Destructor for this class is called \n");
+    _debug ("SIPCALL::Destructor for this class is called ");
 }
 
 
diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp
index d4db910d82bbdbf03f709faea25351ecdb0dbdc3..d4862dd51a0ddafac1766907cd0913898533a297 100644
--- a/sflphone-common/src/sip/sipvoiplink.cpp
+++ b/sflphone-common/src/sip/sipvoiplink.cpp
@@ -246,7 +246,7 @@ SIPVoIPLink* SIPVoIPLink::instance (const AccountID& id)
 {
 
     if (!_instance) {
-		_debug ("Create new SIPVoIPLink instance\n");
+		_debug ("Create new SIPVoIPLink instance");
         _instance = new SIPVoIPLink (id);
     }
 
@@ -427,15 +427,15 @@ int SIPVoIPLink::sendRegister (AccountID id)
         while (result.status == 0x12345678) {
             pj_time_val timeout = { 1, 0 };
             pjsip_endpt_handle_events (_endpt, &timeout);
-            _debug ("status : %d\n", result.status);
+            _debug ("status : %d", result.status);
         }
 
         if (result.status != PJ_SUCCESS) {
             _debug ("Failed to resolve hostname only once."
                     " Default resolver will be used on"
-                    " hostname for all requests.\n");
+                    " hostname for all requests.");
         } else {
-            _debug ("%d servers where obtained from name resolution.\n", result.servers.count);
+            _debug ("%d servers where obtained from name resolution.", result.servers.count);
             char addr_buf[80];
 
             pj_sockaddr_print ( (pj_sockaddr_t*) &result.servers.entry[0].addr, addr_buf, sizeof (addr_buf), 3);
@@ -448,11 +448,11 @@ int SIPVoIPLink::sendRegister (AccountID id)
     if (account->isTlsEnabled()) {
         pj_status_t status;
 
-        _debug ("    sendRegister: createTlsTransport\n");
+        _debug ("    sendRegister: createTlsTransport");
         status = createTlsTransportRetryOnFailure (id);
 
         if (status != PJ_SUCCESS) {
-            _debug ("Failed to initialize TLS transport for account %s\n", id.c_str());
+            _debug ("Failed to initialize TLS transport for account %s", id.c_str());
         }
     }
 
@@ -461,11 +461,11 @@ int SIPVoIPLink::sendRegister (AccountID id)
         if (account->isStunEnabled ()) {
             pj_status_t status;
 
-            _debug ("    sendRegister: createAlternateUdpTransport\n");
+            _debug ("    sendRegister: createAlternateUdpTransport");
             status = createAlternateUdpTransport (id);
 
             if (status != PJ_SUCCESS) {
-                _debug ("Failed to initialize UDP transport with an extern published address for account %s\n", id.c_str());
+                _debug ("Failed to initialize UDP transport with an extern published address for account %s", id.c_str());
             }
         } else {
 
@@ -499,7 +499,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     status = pjsip_regc_create (_endpt, (void*) account, &regc_cb, &regc);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to create regc.\n");
+        _debug ("UserAgent: Unable to create regc.");
         _mutexSIP.leaveMutex();
         return false;
     }
@@ -531,7 +531,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
 
     contactUri = account->getContactHeader (address, portStr);
 
-    _debug ("sendRegister: fromUri: %s serverUri: %s contactUri: %s\n",
+    _debug ("sendRegister: fromUri: %s serverUri: %s contactUri: %s",
             fromUri.c_str(),
             srvUri.c_str(),
             contactUri.c_str());
@@ -552,7 +552,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     status = pjsip_regc_init (regc, &pjSrv, &pjFrom, &pjFrom, 1, &pjContact, expire_value);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to initialize account %d in sendRegister\n", status);
+        _debug ("UserAgent: Unable to initialize account %d in sendRegister", status);
         _mutexSIP.leaveMutex();
         return false;
     }
@@ -560,7 +560,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     pjsip_cred_info *cred = account->getCredInfo();
 
     int credential_count = account->getCredentialCount();
-    _debug ("setting %d credentials in sendRegister\n", credential_count);
+    _debug ("setting %d credentials in sendRegister", credential_count);
     pjsip_regc_set_credentials (regc, credential_count, cred);
 
     // Add User-Agent Header
@@ -577,7 +577,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     status = pjsip_regc_register (regc, PJ_TRUE, &tdata);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to register regc.\n");
+        _debug ("UserAgent: Unable to register regc.");
         _mutexSIP.leaveMutex();
         return false;
     }
@@ -588,7 +588,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     status = pjsip_regc_set_transport (regc, tp);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to set transport.\n");
+        _debug ("UserAgent: Unable to set transport.");
         _mutexSIP.leaveMutex ();
         return false;
     }
@@ -597,7 +597,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     status = pjsip_regc_send (regc, tdata);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to send regc request.\n");
+        _debug ("UserAgent: Unable to send regc request.");
         _mutexSIP.leaveMutex();
         return false;
     }
@@ -605,7 +605,7 @@ int SIPVoIPLink::sendRegister (AccountID id)
     _mutexSIP.leaveMutex();
 
     account->setRegistrationInfo (regc);
-    _debug ("ok\n");
+    _debug ("ok");
     return true;
 }
 
@@ -629,18 +629,18 @@ SIPVoIPLink::sendUnregister (AccountID id)
         status = pjsip_regc_unregister (regc, &tdata);
 
         if (status != PJ_SUCCESS) {
-            _debug ("UserAgent: Unable to unregister regc.\n");
+            _debug ("UserAgent: Unable to unregister regc.");
             return false;
         }
 
         status = pjsip_regc_send (regc, tdata);
 
         if (status != PJ_SUCCESS) {
-            _debug ("UserAgent: Unable to send regc request.\n");
+            _debug ("UserAgent: Unable to send regc request.");
             return false;
         }
     } else {
-        _debug ("UserAgent: regc is null!\n");
+        _debug ("UserAgent: regc is null!");
         return false;
     }
 
@@ -663,7 +663,7 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl)
         account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (Manager::instance().getAccountFromCall (id)));
 
         if (account == NULL) {
-            _debug ("Error retrieving the account to the make the call with\n");
+            _debug ("Error retrieving the account to the make the call with");
             call->setConnectionState (Call::Disconnected);
             call->setState (Call::Error);
             delete call;
@@ -680,15 +680,15 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl)
         setCallAudioLocal (call, localAddr);
 
         try {
-            _debug ("Creating new rtp session in newOutgoingCall\n");
+            _debug ("Creating new rtp session in newOutgoingCall");
             call->getAudioRtp()->initAudioRtpSession (call);
         } catch (...) {
-            _debug ("Failed to create rtp thread from newOutGoingCall\n");
+            _debug ("Failed to create rtp thread from newOutGoingCall");
         }
 
         call->initRecFileName();
 
-        _debug ("Try to make a call to: %s with call ID: %s\n", toUrl.data(), id.data());
+        _debug ("Try to make a call to: %s with call ID: %s", toUrl.data(), id.data());
         // Building the local SDP offer
         // localAddr = getLocalAddressAssociatedToAccount (account->getAccountID());
         call->getLocalSDP()->set_ip_address (localAddr);
@@ -722,12 +722,12 @@ SIPVoIPLink::answer (const CallID& id)
     Sdp *local_sdp;
     pjsip_inv_session *inv_session;
 
-    _debug ("SIPVoIPLink::answer: start answering \n");
+    _debug ("SIPVoIPLink::answer: start answering ");
 
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("! SIP Failure: SIPCall doesn't exists\n");
+        _debug ("! SIP Failure: SIPCall doesn't exists");
         return false;
     }
 
@@ -736,7 +736,7 @@ SIPVoIPLink::answer (const CallID& id)
     try {
         call->getAudioRtp()->initAudioRtpSession (call);
     } catch (...) {
-        _debug ("Failed to create rtp thread from answer\n");
+        _debug ("Failed to create rtp thread from answer");
     }
 
     inv_session = call->getInvSession();
@@ -745,7 +745,7 @@ SIPVoIPLink::answer (const CallID& id)
 
     if (status == PJ_SUCCESS) {
 
-        _debug ("SIPVoIPLink::answer:UserAgent: Negociation success! : call %s \n", call->getCallId().c_str());
+        _debug ("SIPVoIPLink::answer:UserAgent: Negociation success! : call %s ", call->getCallId().c_str());
         // Create and send a 200(OK) response
         status = pjsip_inv_answer (inv_session, PJSIP_SC_OK, NULL, NULL, &tdata);
         PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
@@ -766,7 +766,7 @@ SIPVoIPLink::answer (const CallID& id)
         PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
 
         // Terminate the call
-        _debug ("SIPVoIPLink::answer: fail terminate call %s \n",call->getCallId().c_str());
+        _debug ("SIPVoIPLink::answer: fail terminate call %s ",call->getCallId().c_str());
 
         if (call->getAudioRtp())
             call->getAudioRtp()->stop ();
@@ -789,7 +789,7 @@ SIPVoIPLink::hangup (const CallID& id)
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("! SIP Error: Call doesn't exist\n");
+        _debug ("! SIP Error: Call doesn't exist");
         return false;
     }
 
@@ -814,7 +814,7 @@ SIPVoIPLink::hangup (const CallID& id)
 
     // Release RTP thread
     if (Manager::instance().isCurrentCall (id)) {
-        _debug ("* SIP Info: Stopping AudioRTP for hangup\n");
+        _debug ("* SIP Info: Stopping AudioRTP for hangup");
         call->getAudioRtp()->stop();
     }
 
@@ -835,7 +835,7 @@ SIPVoIPLink::peerHungup (const CallID& id)
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("! SIP Error: Call doesn't exist\n");
+        _debug ("! SIP Error: Call doesn't exist");
         return false;
     }
 
@@ -857,7 +857,7 @@ SIPVoIPLink::peerHungup (const CallID& id)
 
     // Release RTP thread
     if (Manager::instance().isCurrentCall (id)) {
-        _debug ("* SIP Info: Stopping AudioRTP for hangup\n");
+        _debug ("* SIP Info: Stopping AudioRTP for hangup");
         call->getAudioRtp()->stop();
     }
 
@@ -874,11 +874,11 @@ SIPVoIPLink::cancel (const CallID& id)
     SIPCall* call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("! SIP Error: Call doesn't exist\n");
+        _debug ("! SIP Error: Call doesn't exist");
         return false;
     }
 
-    _debug ("- SIP Action: Cancel call %s [cid: %3d]\n", id.data(), call->getCid());
+    _debug ("- SIP Action: Cancel call %s [cid: %3d]", id.data(), call->getCid());
 
     terminateOneCall (id);
     removeCall (id);
@@ -896,7 +896,7 @@ SIPVoIPLink::onhold (const CallID& id)
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("! SIP Error: call doesn't exist\n");
+        _debug ("! SIP Error: call doesn't exist");
         return false;
     }
 
@@ -906,7 +906,7 @@ SIPVoIPLink::onhold (const CallID& id)
 
     call->setState (Call::Hold);
 
-    _debug ("* SIP Info: Stopping AudioRTP for onhold action\n");
+    _debug ("* SIP Info: Stopping AudioRTP for onhold action");
 
     call->getAudioRtp()->stop();
 
@@ -930,7 +930,7 @@ int SIPVoIPLink::inv_session_reinvite (SIPCall *call, std::string direction)
     local_sdp = call->getLocalSDP()->get_local_sdp_session();
 
     if (local_sdp == NULL) {
-        _debug ("! SIP Failure: unable to find local_sdp\n");
+        _debug ("! SIP Failure: unable to find local_sdp");
         return !PJ_SUCCESS;
     }
 
@@ -974,14 +974,14 @@ SIPVoIPLink::offhold (const CallID& id)
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("! SIP Error: Call doesn't exist\n");
+        _debug ("! SIP Error: Call doesn't exist");
         return false;
     }
 
     try {
         call->getAudioRtp()->initAudioRtpSession (call);
     } catch (...) {
-        _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)\n", __FILE__, __LINE__);
+        _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)", __FILE__, __LINE__);
     }
 
     /* Create re-INVITE with new offer */
@@ -1015,12 +1015,12 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to)
     account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (account_id));
 
     if (account == NULL) {
-        _debug ("SIPVoIPLink::transfer account is null. Returning.\n");
+        _debug ("SIPVoIPLink::transfer account is null. Returning.");
         return false;
     }
 
     if (call==0) {
-        _debug ("! SIP Failure: Call doesn't exist\n");
+        _debug ("! SIP Failure: Call doesn't exist");
         return false;
     }
 
@@ -1033,7 +1033,7 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to)
         pj_cstr (&pjDest, dest.c_str());
     }
 
-    _debug ("Transfering to %s\n", dest.c_str());
+    _debug ("Transfering to %s", dest.c_str());
 
     /* Create xfer client subscription. */
     pj_bzero (&xfer_cb, sizeof (xfer_cb));
@@ -1042,7 +1042,7 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to)
     status = pjsip_xfer_create_uac (call->getInvSession()->dlg, &xfer_cb, &sub);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to create xfer -- %d\n", status);
+        _debug ("UserAgent: Unable to create xfer -- %d", status);
         return false;
     }
 
@@ -1059,7 +1059,7 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to)
     status = pjsip_xfer_initiate (sub, &pjDest, &tdata);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to create REFER request -- %d\n", status);
+        _debug ("UserAgent: Unable to create REFER request -- %d", status);
         return false;
     }
 
@@ -1067,7 +1067,7 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to)
     status = pjsip_xfer_send_request (sub, tdata);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to send REFER request -- %d\n", status);
+        _debug ("UserAgent: Unable to send REFER request -- %d", status);
         return false;
     }
 
@@ -1091,13 +1091,13 @@ SIPVoIPLink::refuse (const CallID& id)
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("Call doesn't exist\n");
+        _debug ("Call doesn't exist");
         return false;
     }
 
     // can't refuse outgoing call or connected
     if (!call->isIncoming() || call->getConnectionState() == Call::Connected) {
-        _debug ("It's not an incoming call, or it's already answered\n");
+        _debug ("It's not an incoming call, or it's already answered");
         return false;
     }
 
@@ -1156,7 +1156,7 @@ SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code)
     call = getSIPCall (id);
 
     if (call==0) {
-        _debug ("Call doesn't exist\n");
+        _debug ("Call doesn't exist");
         return false;
     }
 
@@ -1164,7 +1164,7 @@ SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code)
 
     dtmf_body = new char[body_len];
 
-    snprintf (dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration);
+    snprintf (dtmf_body, body_len - 1, "Signal=%c\rDuration=%d\r", code, duration);
 
     pj_strdup2 (_pool, &methodName, "INFO");
     pjsip_method_init_np (&method, &methodName);
@@ -1173,7 +1173,7 @@ SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code)
     status = pjsip_dlg_create_request (call->getInvSession()->dlg, &method, -1, &tdata);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to create INFO request -- %d\n", status);
+        _debug ("UserAgent: Unable to create INFO request -- %d", status);
         return false;
     }
 
@@ -1188,7 +1188,7 @@ SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code)
     tdata->msg->body = pjsip_msg_body_create (tdata->pool, &ctype.type, &ctype.subtype, &content);
 
     if (tdata->msg->body == NULL) {
-        _debug ("UserAgent: Unable to create msg body!\n");
+        _debug ("UserAgent: Unable to create msg body!");
         pjsip_tx_data_dec_ref (tdata);
         return false;
     }
@@ -1197,7 +1197,7 @@ SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code)
     status = pjsip_dlg_send_request (call->getInvSession()->dlg, tdata, getModId(), NULL);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: Unable to send MESSAGE request -- %d\n", status);
+        _debug ("UserAgent: Unable to send MESSAGE request -- %d", status);
         return false;
     }
 
@@ -1209,7 +1209,7 @@ SIPVoIPLink::SIPOutgoingInvite (SIPCall* call)
 {
     // If no SIP proxy setting for direct call with only IP address
     if (!SIPStartCall (call, "")) {
-        _debug ("! SIP Failure: call not started\n");
+        _debug ("! SIP Failure: call not started");
         return false;
     }
 
@@ -1237,7 +1237,7 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED)
     account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id));
 
     if (account == NULL) {
-        _debug ("Account is null in SIPStartCall\n");
+        _debug ("Account is null in SIPStartCall");
         return false;
     }
 
@@ -1266,7 +1266,7 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED)
 
     contactUri = account->getContactHeader (address, portStr);
 
-    _debug ("SIPStartCall: fromUri: %s toUri: %s contactUri: %s\n",
+    _debug ("SIPStartCall: fromUri: %s toUri: %s contactUri: %s",
             fromUri.c_str(),
             toUri.c_str(),
             contactUri.c_str());
@@ -1291,7 +1291,7 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED)
                                    &dialog);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UAC creation failed\n");
+        _debug ("UAC creation failed");
         return false;
     }
 
@@ -1321,7 +1321,7 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED)
     status = pjsip_inv_send_msg (inv, tdata);
 
     if (status != PJ_SUCCESS) {
-        _debug ("    SIPStartCall: failed to send invite\n");
+        _debug ("    SIPStartCall: failed to send invite");
         return false;
     }
 
@@ -1332,7 +1332,7 @@ void
 SIPVoIPLink::SIPCallServerFailure (SIPCall *call)
 {
     if (call != 0) {
-        _debug ("Server error!\n");
+        _debug ("Server error!");
         CallID id = call->getCallId();
         Manager::instance().callFailure (id);
         terminateOneCall (id);
@@ -1354,16 +1354,16 @@ SIPVoIPLink::SIPCallClosed (SIPCall *call)
 
     if (Manager::instance().isCurrentCall (id)) {
         call->setAudioStart (false);
-        _debug ("* SIP Info: Stopping AudioRTP when closing\n");
+        _debug ("* SIP Info: Stopping AudioRTP when closing");
         call->getAudioRtp()->stop();
     }
 
-    _debug ("After close RTP\n");
+    _debug ("After close RTP");
 
     Manager::instance().peerHungupCall (id);
     terminateOneCall (id);
     removeCall (id);
-    _debug ("After remove call ID\n");
+    _debug ("After remove call ID");
 }
 
 void
@@ -1374,7 +1374,7 @@ SIPVoIPLink::SIPCallReleased (SIPCall *call)
     }
 
     // if we are here.. something when wrong before...
-    _debug ("SIP call release\n");
+    _debug ("SIP call release");
 
     CallID id = call->getCallId();
 
@@ -1390,20 +1390,20 @@ void
 SIPVoIPLink::SIPCallAnswered (SIPCall *call, pjsip_rx_data *rdata)
 {
 
-    _debug ("SIPCallAnswered\n");
+    _debug ("SIPCallAnswered");
 
     if (!call) {
-        _debug ("! SIP Failure: unknown call\n");
+        _debug ("! SIP Failure: unknown call");
         return;
     }
 
     if (call->getConnectionState() != Call::Connected) {
-        _debug ("Update call state , id = %s\n", call->getCallId().c_str());
+        _debug ("Update call state , id = %s", call->getCallId().c_str());
         call->setConnectionState (Call::Connected);
         call->setState (Call::Active);
         Manager::instance().peerAnsweredCall (call->getCallId());
     } else {
-        _debug ("* SIP Info: Answering call (on/off hold to send ACK)\n");
+        _debug ("* SIP Info: Answering call (on/off hold to send ACK)");
     }
 }
 
@@ -1441,23 +1441,23 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to)
         account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (accountId));
 
         if (account == NULL) {
-            _debug ("Account is null. Returning\n");
+            _debug ("Account is null. Returning");
             return !PJ_SUCCESS;
         }
         
 		// Set SDP parameters
 		localAddress = account->getLocalAddress ();
 		if (localAddress == "0.0.0.0"){
-			_debug ("Here is the local address: %s\n", localAddress.c_str ());
+			_debug ("Here is the local address: %s", localAddress.c_str ());
 			loadSIPLocalIP (&localAddress);	
 		}
 		setCallAudioLocal (call, localAddress);
 
-        _debug ("toUri received in new_ip_to_ip call %s\n", to.c_str());
+        _debug ("toUri received in new_ip_to_ip call %s", to.c_str());
 
         std::string toUri = account->getToUri (to);
         call->setPeerNumber (toUri);
-        _debug ("toUri in new_ip_to_ip call %s\n", toUri.c_str());
+        _debug ("toUri in new_ip_to_ip call %s", toUri.c_str());
         // Building the local SDP offer
         call->getLocalSDP()->set_ip_address (localAddress);
         call->getLocalSDP()->create_initial_offer();
@@ -1465,7 +1465,7 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to)
         try {
             call->getAudioRtp()->initAudioRtpSession (call);
         } catch (...) {
-            _debug ("! SIP Failure: Unable to create RTP Session  in SIPVoIPLink::new_ip_to_ip_call (%s:%d)\n", __FILE__, __LINE__);
+            _debug ("! SIP Failure: Unable to create RTP Session  in SIPVoIPLink::new_ip_to_ip_call (%s:%d)", __FILE__, __LINE__);
         }
 
         // Create URI
@@ -1489,7 +1489,7 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to)
 
         contactUri = account->getContactHeader (address, portStr);
 
-        _debug ("new_ip_to_ip_call: fromUri: %s toUri: %s contactUri: %s\n",
+        _debug ("new_ip_to_ip_call: fromUri: %s toUri: %s contactUri: %s",
                 fromUri.c_str(),
                 toUri.c_str(),
                 contactUri.c_str());
@@ -1525,7 +1525,7 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to)
         status = pjsip_dlg_set_transport (dialog, tp);
 
         if (status != PJ_SUCCESS) {
-            _debug ("Failed to set the transport for an IP call\n");
+            _debug ("Failed to set the transport for an IP call");
             return status;
         }
 
@@ -1575,7 +1575,7 @@ bool get_dns_server_addresses (std::vector<std::string> *servers)
     // Read configuration files
 
     if (res_init () != 0) {
-        _debug ("Resolver initialization failed\n");
+        _debug ("Resolver initialization failed");
         return false;
     }
 
@@ -1604,12 +1604,12 @@ pj_status_t SIPVoIPLink::enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_
     status = pjsip_endpt_create_resolver (endpt, &resv);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error creating the DNS resolver instance\n");
+        _debug ("Error creating the DNS resolver instance");
         return status;
     }
 
     if (!get_dns_server_addresses (&dns_servers)) {
-        _debug ("Error  while fetching DNS information\n");
+        _debug ("Error  while fetching DNS information");
         return -1;
     }
 
@@ -1626,7 +1626,7 @@ pj_status_t SIPVoIPLink::enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_
     status = pj_dns_resolver_set_ns (resv, scount, nameservers, NULL);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error updating the name servers for the DNS resolver\n");
+        _debug ("Error updating the name servers for the DNS resolver");
         return status;
     }
 
@@ -1634,7 +1634,7 @@ pj_status_t SIPVoIPLink::enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_
     status = pjsip_endpt_set_resolver (endpt, resv);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error setting the DNS resolver instance of the SIP resolver engine\n");
+        _debug ("Error setting the DNS resolver instance of the SIP resolver engine");
         return status;
     }
 
@@ -1680,7 +1680,7 @@ bool SIPVoIPLink::pjsip_init()
     _pool = pj_pool_create (&_cp.factory, "sflphone", 4000, 4000, NULL);
 
     if (!_pool) {
-        _debug ("UserAgent: Could not initialize memory pool\n");
+        _debug ("UserAgent: Could not initialize memory pool");
         return PJ_ENOMEM;
     }
 
@@ -1690,7 +1690,7 @@ bool SIPVoIPLink::pjsip_init()
     PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
 
     if (!loadSIPLocalIP (&addr)) {
-        _debug ("UserAgent: Unable to determine network capabilities\n");
+        _debug ("UserAgent: Unable to determine network capabilities");
         return false;
     }
 
@@ -1702,7 +1702,7 @@ bool SIPVoIPLink::pjsip_init()
     account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (AccountNULL));
 
     if (account == NULL) {
-        _debug ("Account is null in pjsip init\n");
+        _debug ("Account is null in pjsip init");
 		port = _regPort;
     } else {
         directIpCallsTlsEnabled = account->isTlsEnabled();
@@ -1717,19 +1717,19 @@ bool SIPVoIPLink::pjsip_init()
     // could not be created, then give it another try
     // on a random sip port
     if (errPjsip != PJ_SUCCESS) {
-        _debug ("UserAgent: Could not initialize SIP listener on port %d\n", port);
+        _debug ("UserAgent: Could not initialize SIP listener on port %d", port);
         port = RANDOM_SIP_PORT;
 
-        _debug ("UserAgent: Trying to initialize SIP listener on port %d\n", port);
+        _debug ("UserAgent: Trying to initialize SIP listener on port %d", port);
         errPjsip = createUDPServer();
 
         if (errPjsip != PJ_SUCCESS) {
-            _debug ("UserAgent: Fail to initialize SIP listener on port %d\n", port);
+            _debug ("UserAgent: Fail to initialize SIP listener on port %d", port);
             return errPjsip;
         }
     }
 
-    _debug ("pjsip_init -- listening on port %d\n", port);
+    _debug ("pjsip_init -- listening on port %d", port);
 
     // Create a TLS listener meant for Direct IP calls
     // if the user did enabled it.
@@ -1813,7 +1813,7 @@ bool SIPVoIPLink::pjsip_init()
 
     PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
 
-    _debug ("UserAgent: VOIP callbacks initialized\n");
+    _debug ("UserAgent: VOIP callbacks initialized");
 
     // Add endpoint capabilities (INFO, OPTIONS, etc) for this UA
     pj_str_t allowed[] = { { (char*) "INFO", 4}, { (char*) "REGISTER", 8}, { (char*) "OPTIONS", 7} };       //  //{"INVITE", 6}, {"ACK",3}, {"BYE",3}, {"CANCEL",6}
@@ -1826,7 +1826,7 @@ bool SIPVoIPLink::pjsip_init()
     // Register "application/sdp" in ACCEPT header
     pjsip_endpt_add_capability (_endpt, &_mod_ua, PJSIP_H_ACCEPT, NULL, 1, &accepted);
 
-    _debug ("UserAgent: pjsip version %s for %s initialized\n", pj_get_version(), PJ_OS_NAME);
+    _debug ("UserAgent: pjsip version %s for %s initialized", pj_get_version(), PJ_OS_NAME);
 
     // Create the secondary thread to poll sip events
     _evThread->start();
@@ -1849,7 +1849,7 @@ pj_status_t SIPVoIPLink::stunServerResolve (AccountID id)
     account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id));
 
     if (account == NULL) {
-        _debug ("stunServerResolve: Account is null. Returning\n");
+        _debug ("stunServerResolve: Account is null. Returning");
         return !PJ_SUCCESS;
     }
 
@@ -1916,7 +1916,7 @@ int SIPVoIPLink::createUDPServer (AccountID id)
     // Set information to the local address and port
 
     if (account == NULL) {
-        _debug ("Account is null in createUDPServer.\n");
+        _debug ("Account is null in createUDPServer.");
     } else {
         // We are trying to initialize a UDP transport available for all local accounts and direct IP calls
 		if (account->getLocalAddress () != "0.0.0.0"){
@@ -1951,17 +1951,17 @@ int SIPVoIPLink::createUDPServer (AccountID id)
 
     tpmgr = pjsip_endpt_get_tpmgr (_endpt);
 
-    _debug ("number of transport: %i\n", pjsip_tpmgr_get_transport_count (tpmgr));
+    _debug ("number of transport: %i", pjsip_tpmgr_get_transport_count (tpmgr));
 
     pjsip_tpmgr_dump_transports (tpmgr);
 
     if (status != PJ_SUCCESS) {
-        _debug ("UserAgent: (%d) Unable to start UDP transport on %s:%d\n", status, listeningAddress.data(), listeningPort);
+        _debug ("UserAgent: (%d) Unable to start UDP transport on %s:%d", status, listeningAddress.data(), listeningPort);
         // Try to acquire an existing one
         // pjsip_tpmgr_acquire_transport ()
         return status;
     } else {
-        _debug ("UserAgent: UDP server listening on port %d\n", listeningPort);
+        _debug ("UserAgent: UDP server listening on port %d", listeningPort);
 
         if (account == NULL)
             _localUDPTransport = transport;
@@ -1969,7 +1969,7 @@ int SIPVoIPLink::createUDPServer (AccountID id)
 			account->setAccountTransport (transport);
     }
 
-    _debug ("Transport initialized successfully on %s:%i\n", listeningAddress.c_str (), listeningPort);
+    _debug ("Transport initialized successfully on %s:%i", listeningAddress.c_str (), listeningPort);
 
     return PJ_SUCCESS;
 }
@@ -1980,7 +1980,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
     pjsip_transport_type_e transportType;
     pjsip_tpselector *tp_sel;
 
-    _debug ("SIPVoIPLink::findLocalAddressFromUri\n");
+    _debug ("SIPVoIPLink::findLocalAddressFromUri");
 
     // Find the transport that must be used with the given uri
     pj_str_t tmp;
@@ -1993,7 +1993,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
     std::string machineName (pjMachineName.ptr, pjMachineName.slen);
 
     if (genericUri == NULL) {
-        _debug ("genericUri is NULL in findLocalAddressFromUri\n");
+        _debug ("genericUri is NULL in findLocalAddressFromUri");
         return machineName;
     }
 
@@ -2002,7 +2002,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
     sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri (genericUri);
 
     if (sip_uri == NULL) {
-        _debug ("Invalid uri in findLocalAddressFromTransport\n");
+        _debug ("Invalid uri in findLocalAddressFromTransport");
         return machineName;
     }
 
@@ -2010,7 +2010,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
         transportType = PJSIP_TRANSPORT_TLS;
     } else {
         if (transport == NULL) {
-            _debug ("transport is NULL in findLocalAddressFromUri\n. Try the local UDP transport");
+            _debug ("transport is NULL in findLocalAddressFromUri. Try the local UDP transport");
             transport = _localUDPTransport;
         }
 
@@ -2024,7 +2024,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
     tpmgr = pjsip_endpt_get_tpmgr (_endpt);
 
     if (tpmgr == NULL) {
-        _debug ("Unexpected: Cannot get tpmgr from endpoint.\n");
+        _debug ("Unexpected: Cannot get tpmgr from endpoint.");
         return machineName;
     }
 
@@ -2035,7 +2035,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
     pj_status_t status;
 
     /* Init the transport selector */
-    //_debug ("Transport ID: %s\n", transport->obj_name);
+    //_debug ("Transport ID: %s", transport->obj_name);
     if (transportType == PJSIP_TRANSPORT_UDP) {
         status = init_transport_selector (transport, &tp_sel);
 
@@ -2047,11 +2047,11 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_
         status = pjsip_tpmgr_find_local_addr (tpmgr, _pool, transportType, NULL, &localAddress, &port);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Failed to find local address from transport\n");
+        _debug ("Failed to find local address from transport");
         return machineName;
     }
 
-	_debug ("Local address discovered from attached transport: %s\n", localAddress.ptr);
+	_debug ("Local address discovered from attached transport: %s", localAddress.ptr);
     return std::string (localAddress.ptr, localAddress.slen);
 }
 
@@ -2086,7 +2086,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport *
     genericUri = pjsip_parse_uri (_pool, tmp.ptr, tmp.slen, 0);
 
     if (genericUri == NULL) {
-        _debug ("genericUri is NULL in findLocalPortFromUri\n");
+        _debug ("genericUri is NULL in findLocalPortFromUri");
         return atoi (DEFAULT_SIP_PORT);
     }
 
@@ -2095,7 +2095,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport *
     sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri (genericUri);
 
     if (sip_uri == NULL) {
-        _debug ("Invalid uri in findLocalAddressFromTransport\n");
+        _debug ("Invalid uri in findLocalAddressFromTransport");
         return atoi (DEFAULT_SIP_PORT);
     }
 
@@ -2104,7 +2104,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport *
         port = atoi (DEFAULT_SIP_TLS_PORT);
     } else {
         if (transport == NULL) {
-            _debug ("transport is NULL in findLocalPortFromUri - Try the local UDP transport\n");
+            _debug ("transport is NULL in findLocalPortFromUri - Try the local UDP transport");
             transport = _localUDPTransport;
         }
 
@@ -2120,7 +2120,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport *
     tpmgr = pjsip_endpt_get_tpmgr (_endpt);
 
     if (tpmgr == NULL) {
-        _debug ("Unexpected: Cannot get tpmgr from endpoint.\n");
+        _debug ("Unexpected: Cannot get tpmgr from endpoint.");
         return port;
     }
 
@@ -2131,7 +2131,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport *
     pj_status_t status;
 
     if (transportType == PJSIP_TRANSPORT_UDP) {
-        _debug ("Transport ID: %s\n", transport->obj_name);
+        _debug ("Transport ID: %s", transport->obj_name);
 
         status = init_transport_selector (transport, &tp_sel);
 
@@ -2144,10 +2144,10 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport *
 
 
     if (status != PJ_SUCCESS) {
-        _debug ("Failed to find local address from transport\n");
+        _debug ("Failed to find local address from transport");
     }
 
-	_debug ("Local port discovered from attached transport: %i\n", port);
+	_debug ("Local port discovered from attached transport: %i", port);
     return port;
 }
 
@@ -2170,7 +2170,7 @@ pj_status_t SIPVoIPLink::createTlsTransportRetryOnFailure (AccountID id)
         account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id));
 
         if (account == NULL) {
-            _debug ("createTlsTransportRetryOnFailure: Account is null. Returning\n");
+            _debug ("createTlsTransportRetryOnFailure: Account is null. Returning");
             return !PJ_SUCCESS;
         }
 
@@ -2181,11 +2181,11 @@ pj_status_t SIPVoIPLink::createTlsTransportRetryOnFailure (AccountID id)
         success = createTlsTransport (id);
 
         if (success != PJ_SUCCESS) {
-            _debug ("createTlsTransportRetryOnFailure: failed to retry on random port %d\n", randomPort);
+            _debug ("createTlsTransportRetryOnFailure: failed to retry on random port %d", randomPort);
             return success;
         }
 
-        _debug ("createTlsTransportRetryOnFailure: TLS transport listening on port %d\n", randomPort);
+        _debug ("createTlsTransportRetryOnFailure: TLS transport listening on port %d", randomPort);
     }
 
     return PJ_SUCCESS;
@@ -2210,7 +2210,7 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id)
     account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id));
 
     if (account == NULL) {
-        _debug ("Account is null. Returning\n");
+        _debug ("Account is null. Returning");
         return !PJ_SUCCESS;
     }
 
@@ -2221,19 +2221,19 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id)
     status = stunServerResolve (id);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error resolving STUN server: %i\n", status);
+        _debug ("Error resolving STUN server: %i", status);
         return status;
     }
 
     // Init socket
     sock = PJ_INVALID_SOCKET;
 
-    _debug ("Initializing IPv4 socket on %s:%i\n", stunServer.ptr, stunPort);
+    _debug ("Initializing IPv4 socket on %s:%i", stunServer.ptr, stunPort);
 
     status = pj_sockaddr_in_init (&boundAddr, &stunServer, 0);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error when initializing IPv4 socket on %s:%i\n", stunServer.ptr, stunPort);
+        _debug ("Error when initializing IPv4 socket on %s:%i", stunServer.ptr, stunPort);
         return status;
     }
 
@@ -2241,7 +2241,7 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id)
     status = pj_sock_socket (pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Socket() error (%d)\n", status);
+        _debug ("Socket() error (%d)", status);
         return status;
     }
 
@@ -2274,11 +2274,11 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id)
     status = pjsip_udp_transport_attach2 (_endpt, PJSIP_TRANSPORT_UDP, sock, &a_name, 1, &transport);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error creating alternate SIP UDP listener (%d)\n", status);
+        _debug ("Error creating alternate SIP UDP listener (%d)", status);
 		return status;
     }
 
-	_debug ("UDP Transport successfully created on %s:%i\n", listeningAddress.c_str (), listeningPort);
+	_debug ("UDP Transport successfully created on %s:%i", listeningAddress.c_str (), listeningPort);
     account->setAccountTransport (transport);
 
     return PJ_SUCCESS;
@@ -2300,7 +2300,7 @@ pj_status_t SIPVoIPLink::createTlsTransport (AccountID id)
     account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id));
 
     if (account == NULL) {
-        _debug ("Account is null. Returning\n");
+        _debug ("Account is null. Returning");
         return !PJ_SUCCESS;
     }
 
@@ -2330,7 +2330,7 @@ pj_status_t SIPVoIPLink::createTlsTransport (AccountID id)
         success = pj_sockaddr_in_set_str_addr (&local_addr, &pjAddress);
 
         if (success != PJ_SUCCESS) {
-            _debug ("Failed to set local address in %d\n", __LINE__);
+            _debug ("Failed to set local address in %d", __LINE__);
         }
     }
 
@@ -2345,7 +2345,7 @@ pj_status_t SIPVoIPLink::createTlsTransport (AccountID id)
     pjsip_tls_setting * tls_setting = account->getTlsSetting();
 
     _debug ("TLS transport to be initialized with published address %.*s,"
-            " published port %d, local address %s, local port %d\n",
+            " published port %d, local address %s, local port %d",
             (int) a_name.host.slen, a_name.host.ptr,
             (int) a_name.port, localAddress.c_str(), (int) localTlsPort);
 
@@ -2354,7 +2354,7 @@ pj_status_t SIPVoIPLink::createTlsTransport (AccountID id)
     status = pjsip_tls_transport_start (_endpt, tls_setting, &local_addr, &a_name, 1, &tls);
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error creating SIP TLS listener (%d)\n", status);
+        _debug ("Error creating SIP TLS listener (%d)", status);
     }
 
     return PJ_SUCCESS;
@@ -2369,11 +2369,11 @@ bool SIPVoIPLink::loadSIPLocalIP (std::string *addr)
 
     if (pj_gethostip (pj_AF_INET(), &ip_addr) != PJ_SUCCESS) {
 		// Update the registration state if no network capabilities found
-        _debug ("UserAgent: Get host ip failed!\n");
+        _debug ("UserAgent: Get host ip failed!");
         returnValue = false;
     } else {
         localAddress = std::string (pj_inet_ntoa (ip_addr.ipv4.sin_addr));
-        _debug ("UserAgent: Checking network, setting local IP address to: %s\n", localAddress.data());
+        _debug ("UserAgent: Checking network, setting local IP address to: %s", localAddress.data());
     }
 
 	*addr = localAddress;
@@ -2410,7 +2410,7 @@ void SIPVoIPLink::busy_sleep (unsigned msec)
 bool SIPVoIPLink::pjsip_shutdown (void)
 {
     if (_endpt) {
-        _debug ("UserAgent: Shutting down...\n");
+        _debug ("UserAgent: Shutting down...");
         busy_sleep (1000);
     }
 
@@ -2465,7 +2465,7 @@ void set_voicemail_info (AccountID account, pjsip_msg_body *body)
     std::string delimiter = "/";
     std::string msg_body, voicemail_str;
 
-    _debug ("UserAgent: checking the voice message!\n");
+    _debug ("UserAgent: checking the voice message!");
     // The voicemail message is formated like that:
     // Voice-Message: 1/0  . 1 is the number we want to retrieve in this case
 
@@ -2499,19 +2499,19 @@ void SIPVoIPLink::handle_reinvite (SIPCall *call)
     call->getAudioRtp()->stop ();
     call->setAudioStart (false);
 
-    _debug ("Create new rtp session from handle_reinvite : %s:%i\n", call->getLocalIp().c_str(), call->getLocalAudioPort());
+    _debug ("Create new rtp session from handle_reinvite : %s:%i", call->getLocalIp().c_str(), call->getLocalAudioPort());
 
     try {
         call->getAudioRtp()->initAudioRtpSession (call);
     } catch (...) {
-        _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)\n", __FILE__, __LINE__);
+        _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)", __FILE__, __LINE__);
     }
 }
 
 // This callback is called when the invite session state has changed
 void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
 {
-    _debug ("call_on_state_changed to state %s\n", invitationStateMap[inv->state]);
+    _debug ("call_on_state_changed to state %s", invitationStateMap[inv->state]);
 
     pjsip_rx_data *rdata;
     pj_status_t status;
@@ -2524,8 +2524,8 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
         _debug ("Call is NULL in call_on_state_changed");
         return;
     } else {
-        // _debug("    call_on_state_changed: call id %s\n", call->getCallId().c_str());
-        // _debug("    call_on_state_changed: call state %s\n", invitationStateMap[call->getInvSession()->state]);
+        // _debug("    call_on_state_changed: call id %s", call->getCallId().c_str());
+        // _debug("    call_on_state_changed: call state %s", invitationStateMap[call->getInvSession()->state]);
     }
 
     //Retrieve the body message
@@ -2600,12 +2600,12 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
                                         NULL, &tdata);
 
             if (status != PJ_SUCCESS) {
-                _debug ("UserAgent: Unable to create NOTIFY -- %d\n", status);
+                _debug ("UserAgent: Unable to create NOTIFY -- %d", status);
             } else {
                 status = pjsip_xfer_send_request (call->getXferSub(), tdata);
 
                 if (status != PJ_SUCCESS) {
-                    _debug ("UserAgent: Unable to send NOTIFY -- %d\n", status);
+                    _debug ("UserAgent: Unable to send NOTIFY -- %d", status);
                 }
             }
         }
@@ -2642,7 +2642,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
         status = call->getLocalSDP()->check_sdp_answer (inv, rdata);
 
         if (status != PJ_SUCCESS) {
-            _debug ("Failed to check_incoming_sdp in call_on_state_changed\n");
+            _debug ("Failed to check_incoming_sdp in call_on_state_changed");
             return;
         }
     }
@@ -2654,7 +2654,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
 
     } else if (inv->state == PJSIP_INV_STATE_DISCONNECTED) {
 
-        _debug ("State: %s. Cause: %.*s\n", invitationStateMap[inv->state], (int) inv->cause_text.slen, inv->cause_text.ptr);
+        _debug ("State: %s. Cause: %.*s", invitationStateMap[inv->state], (int) inv->cause_text.slen, inv->cause_text.ptr);
 
         switch (inv->cause) {
                 /* The call terminates normally - BYE / CANCEL */
@@ -2696,7 +2696,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
                 break;
 
             default:
-                _debug ("sipvoiplink.cpp - line %d : Unhandled call state. This is probably a bug.\n", __LINE__);
+                _debug ("sipvoiplink.cpp - line %d : Unhandled call state. This is probably a bug.", __LINE__);
                 break;
         }
     }
@@ -2706,7 +2706,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
 // This callback is called after SDP offer/answer session has completed.
 void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
 {
-    _debug ("call_on_media_update\n");
+    _debug ("call_on_media_update");
 
     const pjmedia_sdp_session *local_sdp;
     const pjmedia_sdp_session *remote_sdp;
@@ -2717,19 +2717,19 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
     call = reinterpret_cast<SIPCall *> (inv->mod_data[getModId() ]);
 
     if (!call) {
-        _debug ("Call declined by peer, SDP negociation stopped\n");
+        _debug ("Call declined by peer, SDP negociation stopped");
         return;
     }
 
     link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL));
 
     if (link == NULL) {
-        _debug ("Failed to get sip link\n");
+        _debug ("Failed to get sip link");
         return;
     }
 
     if (status != PJ_SUCCESS) {
-        _debug ("Error while negotiating the offer\n");
+        _debug ("Error while negotiating the offer");
         link->hangup (call->getCallId());
         Manager::instance().callFailure (call->getCallId());
         return;
@@ -2759,7 +2759,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
         call->setAudioStart (true);
         call->getAudioRtp()->start();
     } catch (exception& rtpException) {
-        _debug ("%s\n", rtpException.what());
+        _debug ("%s", rtpException.what());
     }
 
 }
@@ -2770,7 +2770,7 @@ void call_on_forked (pjsip_inv_session *inv, pjsip_event *e)
 
 void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e)
 {
-    _debug ("call_on_tsx_changed to state %s\n", transactionStateMap[tsx->state]);
+    _debug ("call_on_tsx_changed to state %s", transactionStateMap[tsx->state]);
 
     if (tsx->role==PJSIP_ROLE_UAS && tsx->state==PJSIP_TSX_STATE_TRYING &&
             pjsip_method_cmp (&tsx->method, &pjsip_refer_method) ==0) {
@@ -2785,7 +2785,7 @@ void regc_cb (struct pjsip_regc_cbparam *param)
     account = static_cast<SIPAccount *> (param->token);
 
     if (account == NULL) {
-        _debug ("Account is NULL in regc_cb.\n");
+        _debug ("Account is NULL in regc_cb.");
         return;
     }
 
@@ -2804,7 +2804,7 @@ void regc_cb (struct pjsip_regc_cbparam *param)
             /* Sometimes, the status is OK, but we still failed.
              * So checking the code for real result
              */
-            _debug ("UserAgent: The error is: %d\n", param->code);
+            _debug ("UserAgent: The error is: %d", param->code);
 
             switch (param->code) {
 
@@ -2875,7 +2875,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
     std::string request;
 
     // Handle the incoming call invite in this function
-    _debug ("UserAgent: Callback on_rx_request is involved! \n");
+    _debug ("UserAgent: Callback on_rx_request is involved! ");
 
     /* First, let's got the username and server name from the invite.
      * We will use them to detect which account is the callee.
@@ -2886,7 +2886,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
     userName = std::string (sip_uri->user.ptr, sip_uri->user.slen);
     server = std::string (sip_uri->host.ptr, sip_uri->host.slen);
 
-    _debug ("mod_on_rx_request: %s@%s\n", userName.c_str(), server.c_str());
+    _debug ("mod_on_rx_request: %s@%s", userName.c_str(), server.c_str());
 
     // Get the account id of callee from username and server
     account_id = Manager::instance().getAccountIdFromNameAndServer (userName, server);
@@ -2894,7 +2894,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
     /* If we don't find any account to receive the call */
 
     if (account_id == AccountNULL) {
-        _debug ("UserAgent: Username %s doesn't match any account!\n",userName.c_str());
+        _debug ("UserAgent: Username %s doesn't match any account!",userName.c_str());
         //return false;
     }
 
@@ -2904,29 +2904,29 @@ mod_on_rx_request (pjsip_rx_data *rdata)
 
     /* If we can't find any voIP link to handle the incoming call */
     if (link == 0) {
-        _debug ("ERROR: can not retrieve the voiplink from the account ID...\n");
+        _debug ("ERROR: can not retrieve the voiplink from the account ID...");
         return false;
     }
 
 
     char* from_header = strstr (rdata->msg_info.msg_buf, "From: ");
 
-    // _debug("------------------------------ thefromheader: %s\n", from_header);
+    // _debug("------------------------------ thefromheader: %s", from_header);
 
     if (from_header) {
 
         std::string temp (from_header);
         int begin_displayName = temp.find ("\"") + 1;
         int end_displayName = temp.rfind ("\"");
-        // _debug("The display name start at %i, end at %i\n", begin_displayName, end_displayName);
+        // _debug("The display name start at %i, end at %i", begin_displayName, end_displayName);
         displayName = temp.substr (begin_displayName, end_displayName - begin_displayName);//display_name);
     } else {
         displayName = std::string ("");
     }
 
-    _debug ("UserAgent: The receiver is : %s@%s\n", userName.data(), server.data());
+    _debug ("UserAgent: The receiver is : %s@%s", userName.data(), server.data());
 
-    _debug ("UserAgent: The callee account id is %s\n", account_id.c_str());
+    _debug ("UserAgent: The callee account id is %s", account_id.c_str());
 
     /* Now, it is the time to find the information of the caller */
     uri = rdata->msg_info.from->uri;
@@ -3005,7 +3005,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
                                     Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND));
             }
         } else
-            throw length_error ("Url exceeds std::string max_size\n");
+            throw length_error ("Url exceeds std::string max_size");
 
     }
 
@@ -3070,7 +3070,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
         // Fail to notify UI
         delete call;
         call = NULL;
-        _debug ("UserAgent: Fail to notify UI!\n");
+        _debug ("UserAgent: Fail to notify UI!");
         return false;
     }
 
@@ -3146,7 +3146,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
         /* Invalid Request.
          * No Refer-To header!
          */
-        _debug ("UserAgent: Received REFER without Refer-To header!\n");
+        _debug ("UserAgent: Received REFER without Refer-To header!");
         pjsip_dlg_respond (inv->dlg, rdata, 400, NULL, NULL, NULL);
         return;
     }
@@ -3170,7 +3170,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
     /* Notify callback */
     code = PJSIP_SC_ACCEPTED;
 
-    _debug ("UserAgent: Call to %.*s is being transfered to %.*s\n",
+    _debug ("UserAgent: Call to %.*s is being transfered to %.*s",
             (int) inv->dlg->remote.info_str.slen,
             inv->dlg->remote.info_str.ptr,
             (int) refer_to->hvalue.slen,
@@ -3188,7 +3188,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
                                             &tdata);
 
         if (status != PJ_SUCCESS) {
-            _debug ("UserAgent: Unable to create 2xx response to REFER -- %d\n", status);
+            _debug ("UserAgent: Unable to create 2xx response to REFER -- %d", status);
             return;
         }
 
@@ -3205,7 +3205,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
                                           tdata);
 
         if (status != PJ_SUCCESS) {
-            _debug ("UserAgent: Unable to create 2xx response to REFER -- %d\n", status);
+            _debug ("UserAgent: Unable to create 2xx response to REFER -- %d", status);
             return;
         }
 
@@ -3228,7 +3228,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
         status = pjsip_xfer_create_uas (inv->dlg, &xfer_cb, rdata, &sub);
 
         if (status != PJ_SUCCESS) {
-            _debug ("UserAgent: Unable to create xfer uas -- %d\n", status);
+            _debug ("UserAgent: Unable to create xfer uas -- %d", status);
             pjsip_dlg_respond (inv->dlg, rdata, 500, NULL, NULL, NULL);
             return;
         }
@@ -3264,7 +3264,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
         status = pjsip_xfer_send_request (sub, tdata);
 
         if (status != PJ_SUCCESS) {
-            _debug ("UserAgent: Unable to send NOTIFY to REFER -- %d\n", status);
+            _debug ("UserAgent: Unable to send NOTIFY to REFER -- %d", status);
             return;
         }
     }
@@ -3282,7 +3282,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
     tmp = std::string (uri);
 
     if (existing_call == NULL) {
-        _debug ("UserAgent: Call doesn't exist!\n");
+        _debug ("UserAgent: Call doesn't exist!");
         return;
     }
 
@@ -3298,14 +3298,14 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
                                         500, NULL, &tdata);
 
             if (status != PJ_SUCCESS) {
-                _debug ("UserAgent: Unable to create NOTIFY to REFER -- %d\n", status);
+                _debug ("UserAgent: Unable to create NOTIFY to REFER -- %d", status);
                 return;
             }
 
             status = pjsip_xfer_send_request (sub, tdata);
 
             if (status != PJ_SUCCESS) {
-                _debug ("UserAgent: Unable to send NOTIFY to REFER -- %d\n", status);
+                _debug ("UserAgent: Unable to send NOTIFY to REFER -- %d", status);
                 return;
             }
         }
@@ -3321,7 +3321,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata)
         newCall = dynamic_cast<SIPCall *> (link->getCall (newCallId));
 
         if (!newCall) {
-            _debug ("UserAgent: can not find the call from sipvoiplink!\n");
+            _debug ("UserAgent: can not find the call from sipvoiplink!");
             return;
         }
     }
@@ -3354,7 +3354,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
 
     if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_ACCEPTED) {
 
-        _debug ("Transfer accepted! Waiting for notifications. \n");
+        _debug ("Transfer accepted! Waiting for notifications. ");
 
     }
 
@@ -3386,13 +3386,13 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
 
         if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_TERMINATED) {
             pjsip_evsub_set_mod_data (sub, _mod_ua.id, NULL);
-            _debug ("UserAgent: Xfer client subscription terminated\n");
+            _debug ("UserAgent: Xfer client subscription terminated");
 
         }
 
         if (!link || !event) {
             /* Application is not interested with call progress status */
-            _debug ("UserAgent: Either link or event is empty!\n");
+            _debug ("UserAgent: Either link or event is empty!");
             return;
         }
 
@@ -3413,10 +3413,10 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
 
             if (!body) {
                 // if (call->getCallConfiguration () == Call::IPtoIP) {
-                //   _debug("UserAgent: IptoIp NOTIFY without message body\n");
+                //   _debug("UserAgent: IptoIp NOTIFY without message body");
                 // }
                 // else{
-                _debug ("UserAgent: Warning! Received NOTIFY without message body\n");
+                _debug ("UserAgent: Warning! Received NOTIFY without message body");
                 return;
                 // }
             }
@@ -3426,7 +3426,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
             /* Check for appropriate content */
             if (pj_stricmp2 (&body->content_type.type, "message") != 0 ||
                     pj_stricmp2 (&body->content_type.subtype, "sipfrag") != 0) {
-                _debug ("UserAgent: Warning! Received NOTIFY with non message/sipfrag content\n");
+                _debug ("UserAgent: Warning! Received NOTIFY with non message/sipfrag content");
                 return;
             }
 
@@ -3435,12 +3435,12 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
                                                &status_line);
 
             if (status != PJ_SUCCESS) {
-                _debug ("UserAgent: Warning! Received NOTIFY with invalid message/sipfrag content\n");
+                _debug ("UserAgent: Warning! Received NOTIFY with invalid message/sipfrag content");
                 return;
             }
 
         } else {
-            _debug ("UserAgent: Set code to 500!\n");
+            _debug ("UserAgent: Set code to 500!");
             status_line.code = 500;
             status_line.reason = *pjsip_get_status_text (500);
         }
@@ -3449,7 +3449,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
         SIPCall *call = dynamic_cast<SIPCall *> (link->getCall (Manager::instance().getCurrentCallId()));
 
         if (!call) {
-            _debug ("UserAgent: Call doesn't exit!\n");
+            _debug ("UserAgent: Call doesn't exit!");
             return;
         }
 
@@ -3458,7 +3458,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
             request = event->body.rx_msg.rdata->msg_info.msg_buf;
 
             if ( (int) request.find (noresource) != -1) {
-                _debug ("UserAgent: NORESOURCE for transfer!\n");
+                _debug ("UserAgent: NORESOURCE for transfer!");
                 link->transferStep2 (call);
                 pjsip_evsub_terminate (sub, PJ_TRUE);
 
@@ -3467,7 +3467,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
             }
 
             if ( (int) request.find (ringing) != -1) {
-                _debug ("UserAgent: transfered call RINGING!\n");
+                _debug ("UserAgent: transfered call RINGING!");
                 link->transferStep2 (call);
                 pjsip_evsub_terminate (sub, PJ_TRUE);
 
@@ -3484,18 +3484,18 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event)
 
         if (status_line.code/100 == 2) {
 
-            _debug ("UserAgent: Try to stop rtp!\n");
+            _debug ("UserAgent: Try to stop rtp!");
             pjsip_tx_data *tdata;
 
             status = pjsip_inv_end_session (call->getInvSession(), PJSIP_SC_GONE, NULL, &tdata);
 
             if (status != PJ_SUCCESS) {
-                _debug ("UserAgent: Fail to create end session msg!\n");
+                _debug ("UserAgent: Fail to create end session msg!");
             } else {
                 status = pjsip_inv_send_msg (call->getInvSession(), tdata);
 
                 if (status != PJ_SUCCESS)
-                    _debug ("UserAgent: Fail to send end session msg!\n");
+                    _debug ("UserAgent: Fail to send end session msg!");
             }
 
             link->transferStep2 (call);
@@ -3535,7 +3535,7 @@ void xfer_svr_cb (pjsip_evsub *sub, pjsip_event *event)
 
         call->setXferSub (NULL);
 
-        _debug ("UserAgent: Xfer server subscription terminated\n");
+        _debug ("UserAgent: Xfer server subscription terminated");
     }
 }
 
@@ -3544,7 +3544,7 @@ void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer)
 
 
 #ifdef CAN_REINVITE
-    _debug ("%s (%d): on_rx_offer REINVITE\n", __FILE__, __LINE__);
+    _debug ("%s (%d): on_rx_offer REINVITE", __FILE__, __LINE__);
 
     SIPCall *call;
     pj_status_t status;
@@ -3643,10 +3643,10 @@ bool setCallAudioLocal (SIPCall* call, std::string localIP)
             callLocalExternAudioPort = account->getStunPort ();
         }
 
-        _debug ("            Setting local ip address: %s\n", localIP.c_str());
+        _debug ("            Setting local ip address: %s", localIP.c_str());
 
-        _debug ("            Setting local audio port to: %d\n", callLocalAudioPort);
-        _debug ("            Setting local audio port (external) to: %d\n", callLocalExternAudioPort);
+        _debug ("            Setting local audio port to: %d", callLocalAudioPort);
+        _debug ("            Setting local audio port (external) to: %d", callLocalExternAudioPort);
 
         // Set local audio port for SIPCall(id)
         call->setLocalIp (localIP);
@@ -3683,7 +3683,7 @@ std::string fetch_header_value (pjsip_msg *msg, std::string field)
 
     value = hdr->hvalue.ptr;
 
-    if ( (pos=value.find ("\n")) == std::string::npos) {
+    if ( (pos=value.find ("")) == std::string::npos) {
         return "";
     }
 
@@ -3706,7 +3706,7 @@ std::vector<std::string> SIPVoIPLink::getAllIpInterface (void)
         return ifaceList;
     }
 
-    _debug ("Detecting available interfaces...\n");
+    _debug ("Detecting available interfaces...");
 
     int i;
 
@@ -3714,7 +3714,7 @@ std::vector<std::string> SIPVoIPLink::getAllIpInterface (void)
         char tmpAddr[PJ_INET_ADDRSTRLEN];
         pj_sockaddr_print (&addrList[i], tmpAddr, sizeof (tmpAddr), 0);
         ifaceList.push_back (std::string (tmpAddr));
-        _debug ("Local interface %s\n", tmpAddr);
+        _debug ("Local interface %s", tmpAddr);
     }
 
     return ifaceList;
@@ -3761,12 +3761,12 @@ std::string getLocalAddressAssociatedToAccount (AccountID id)
         local_addr_ipv4 = _localUDPTransport->local_addr.ipv4;
     }
 
-    _debug ("slbvasjklbvaskbvaskvbaskvaskvbsdfk: %i\n", local_addr_ipv4.sin_addr.s_addr);
+    _debug ("slbvasjklbvaskbvaskvbaskvaskvbsdfk: %i", local_addr_ipv4.sin_addr.s_addr);
 
     tmp = pj_str (pj_inet_ntoa (local_addr_ipv4.sin_addr));
     localAddr = std::string (tmp.ptr);
 
-    _debug ("slbvasjklbvaskbvaskvbaskvaskvbsdfk: %s\n", localAddr.c_str());
+    _debug ("slbvasjklbvaskbvaskvbaskvaskvbsdfk: %s", localAddr.c_str());
 
     return localAddr;
 
diff --git a/sflphone-common/src/util/Pattern.cpp b/sflphone-common/src/util/Pattern.cpp
index 85cb60392bb6356e5e380e6396eb6b38bc8cee7c..95186c5d689692cc30c1cf78d00e06e5aa66ebdb 100644
--- a/sflphone-common/src/util/Pattern.cpp
+++ b/sflphone-common/src/util/Pattern.cpp
@@ -125,7 +125,7 @@ std::vector<std::string> Pattern::groups (void)
 
     while (stringList[i] != NULL) {
         matchedSubstrings.push_back (stringList[i]);
-        printf ("Substr: <start>%s<end>\n", stringList[i]);
+        printf ("Substr: <start>%s<end>", stringList[i]);
         i++;
     }
 
@@ -246,8 +246,8 @@ bool Pattern::matches (void) throw (match_error)
 
 bool Pattern::matches (const std::string& subject) throw (match_error)
 {
-    //printf("\n\n\nCurrent offset: %d, old offset: %d\n", _offset[1], _offset[0]);
-    //printf("Trying <start>%s<end>\n", subject.substr(_offset[1]).c_str());
+    //printf("Current offset: %d, old offset: %d", _offset[1], _offset[0]);
+    //printf("Trying <start>%s<end>", subject.substr(_offset[1]).c_str());
 
     // Try to find a match for this pattern
     int rc = pcre_exec (
@@ -264,7 +264,7 @@ bool Pattern::matches (const std::string& subject) throw (match_error)
 
     if (rc < 0) {
         _offset[0] = _offset[1] = 0;
-        //printf("Matching failed with %d\n", rc);
+        //printf("Matching failed with %d", rc);
         return false;
     }
 
@@ -275,7 +275,7 @@ bool Pattern::matches (const std::string& subject) throw (match_error)
         _offset[1] =  _ovector[1] + _offset[0];
     }
 
-    //printf("Matching succeeded with %d to %d\n", (int) start(), (int) end());
+    //printf("Matching succeeded with %d to %d", (int) start(), (int) end());
 
     // Matching succeded but not enough space.
     if (rc == 0) {
diff --git a/sflphone-common/test/audiolayerTest.cpp b/sflphone-common/test/audiolayerTest.cpp
index 1cdb792598329c7cbf492b68d5bc4cd4435a89c3..f655843af33c850ad84eecfd1755fe3f038f74fb 100644
--- a/sflphone-common/test/audiolayerTest.cpp
+++ b/sflphone-common/test/audiolayerTest.cpp
@@ -73,13 +73,13 @@ void AudioLayerTest::testAudioLayerConfig()
 void AudioLayerTest::testAudioLayerSwitch()
 {
 
-    _debug ("---------- AudioLayerTest::testAudioLayerSwitch ---------------------------\n");
+    _debug ("---------- AudioLayerTest::testAudioLayerSwitch ---------------------------");
 
 
     int previous_layer = Manager::instance().getAudioDriver()->getLayerType();
 
     for (int i = 0; i < 2; i++) {
-        _debug ("---------- AudioLayerTest::testAudioLayerSwitch - %i -------------\n",i);
+        _debug ("---------- AudioLayerTest::testAudioLayerSwitch - %i -------------",i);
         Manager::instance().switchAudioManager();
 
         if (previous_layer == ALSA) {
@@ -99,7 +99,7 @@ void AudioLayerTest::testAudioLayerSwitch()
 void AudioLayerTest::testPulseConnect()
 {
 
-    _debug ("---------- AudioLayerTest::testPulseConnect ---------------------------\n");
+    _debug ("---------- AudioLayerTest::testPulseConnect ---------------------------");
 
     ManagerImpl* manager;
     manager = &Manager::instance();
@@ -125,7 +125,7 @@ void AudioLayerTest::testPulseConnect()
     try {
         CPPUNIT_ASSERT (_pulselayer->openDevice (numCardIn, numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin) == true);
     } catch (...) {
-        _debug ("Exception occured wile opening device! \n");
+        _debug ("Exception occured wile opening device! ");
     }
 
     usleep (100000);
@@ -154,7 +154,7 @@ void AudioLayerTest::testPulseConnect()
     CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->disconnectStream() == true);
     CPPUNIT_ASSERT (_pulselayer->getRecordStream()->disconnectStream() == true);
 
-    // _debug("%i\n",_pulselayer->getPlaybackStream()->getStreamState());
+    // _debug("%i",_pulselayer->getPlaybackStream()->getStreamState());
 
     CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true);
     CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true);
@@ -176,7 +176,7 @@ void AudioLayerTest::testPulseConnect()
 void AudioLayerTest::testAlsaConnect()
 {
 
-    _debug ("---------- AudioLayerTest::testAlsaConnect ---------------------------\n");
+    _debug ("---------- AudioLayerTest::testAlsaConnect ---------------------------");
 
     int layer = Manager::instance().getAudioDriver()->getLayerType();
 
diff --git a/sflphone-common/test/audiorecorderTest.cpp b/sflphone-common/test/audiorecorderTest.cpp
index fc349f08c20745dc684918034cd920705d9dec91..d4dda35db6300499aeba05c5019a04ceec205349 100644
--- a/sflphone-common/test/audiorecorderTest.cpp
+++ b/sflphone-common/test/audiorecorderTest.cpp
@@ -40,7 +40,7 @@ void AudioRecorderTest::testRecordData()
       _ar->setSndSamplingRate(44100);
       _ar->openFile("theWavFile.wav",ft,sf);
 
-      cout << "file opened!\n";
+      cout << "file opened!";
 
       SFLDataFormat buf [2];
       for (SFLDataFormat i = -32768; i < 32767; i++ ){
diff --git a/sflphone-common/test/mainbufferTest.cpp b/sflphone-common/test/mainbufferTest.cpp
index 63c9fa2f4d7cffdbdb5a95bfc3f05aa1c8053c50..885f0582f082673bc5027fd190f731f5aa7caa79 100644
--- a/sflphone-common/test/mainbufferTest.cpp
+++ b/sflphone-common/test/mainbufferTest.cpp
@@ -53,7 +53,7 @@ void MainBufferTest::tearDown()
 
 void MainBufferTest::testRingBufferCreation()
 {
-    _debug ("MainBufferTest::testRingBufferCreation()\n");
+    _debug ("MainBufferTest::testRingBufferCreation()");
 
     CallID test_id = "1234";
     CallID null_id = "null id";
@@ -100,7 +100,7 @@ void MainBufferTest::testRingBufferCreation()
 
 void MainBufferTest::testRingBufferReadPointer()
 {
-    _debug ("MainBufferTest::testRingBufferReadPointer()\n");
+    _debug ("MainBufferTest::testRingBufferReadPointer()");
 
     CallID call_id = "call id";
     CallID read_id = "read id";
@@ -147,7 +147,7 @@ void MainBufferTest::testRingBufferReadPointer()
 
 void MainBufferTest::testCallIDSet()
 {
-    _debug ("MainBufferTest::testCallIDSet()\n");
+    _debug ("MainBufferTest::testCallIDSet()");
 
     CallID test_id = "set id";
     CallID false_id = "false set id";
@@ -231,7 +231,7 @@ void MainBufferTest::testCallIDSet()
 void MainBufferTest::testRingBufferInt()
 {
 
-    _debug ("MainBufferTest::testRingbufferInt()\n");
+    _debug ("MainBufferTest::testRingbufferInt()");
 
     // CallID test_id = "test_int";
 
@@ -348,7 +348,7 @@ void MainBufferTest::testRingBufferInt()
 void MainBufferTest::testRingBufferNonDefaultID()
 {
 
-    _debug ("MainBufferTest::testRingBufferNonDefaultID()\n");
+    _debug ("MainBufferTest::testRingBufferNonDefaultID()");
 
     CallID test_id = "test_int";
 
@@ -436,7 +436,7 @@ void MainBufferTest::testRingBufferNonDefaultID()
 void MainBufferTest::testRingBufferFloat()
 {
 
-    _debug ("MainBufferTest::testRingBufferFloat()\n");
+    _debug ("MainBufferTest::testRingBufferFloat()");
 
     float testfloat1 = 12.5;
     float testfloat2 = 13.4;
@@ -471,7 +471,7 @@ void MainBufferTest::testRingBufferFloat()
 void MainBufferTest::testTwoPointer()
 {
 
-    _debug ("MainBufferTest::testTwoPointer()\n");
+    _debug ("MainBufferTest::testTwoPointer()");
 
 
     RingBuffer* input_buffer = _mainbuffer.createRingBuffer (default_id);
@@ -490,7 +490,7 @@ void MainBufferTest::testTwoPointer()
 void MainBufferTest::testBindUnbindBuffer()
 {
 
-    _debug ("MainBufferTest::testBindUnbindBuffer()\n");
+    _debug ("MainBufferTest::testBindUnbindBuffer()");
 
     CallID test_id1 = "bind unbind 1";
     CallID test_id2 = "bind unbind 2";
@@ -554,7 +554,7 @@ void MainBufferTest::testBindUnbindBuffer()
     // unbind test_id1 with default_id
     _mainbuffer.unBindCallID (test_id1);
 
-    _debug ("%i\n", _mainbuffer._ringBufferMap.size());
+    _debug ("%i", _mainbuffer._ringBufferMap.size());
     CPPUNIT_ASSERT (_mainbuffer._ringBufferMap.size() == 0);
     CPPUNIT_ASSERT (_mainbuffer._callIDMap.size() == 0);
 
@@ -767,7 +767,7 @@ void MainBufferTest::testBindUnbindBuffer()
     CPPUNIT_ASSERT (iter_readpointer->second == 0);
 
 
-    _debug ("ok1\n");
+    _debug ("ok1");
 
     // unbind test_id1 with test_id2
     // calling it twice not supposed to break anything
@@ -890,7 +890,7 @@ void MainBufferTest::testBindUnbindBuffer()
 void MainBufferTest::testGetPutDataByID()
 {
 
-    _debug ("MainBufferTest::testGetPutData()\n");
+    _debug ("MainBufferTest::testGetPutData()");
 
     CallID test_id = "getData putData";
     CallID false_id = "false id";
@@ -946,7 +946,7 @@ void MainBufferTest::testGetPutDataByID()
 void MainBufferTest::testGetPutData()
 {
 
-    _debug ("MainBufferTest::testGetDataAndCallID()\n");
+    _debug ("MainBufferTest::testGetDataAndCallID()");
 
     CallID test_id = "incoming rtp session";
 
@@ -995,7 +995,7 @@ void MainBufferTest::testGetPutData()
 void MainBufferTest::testDiscardFlush()
 {
 
-    _debug ("MainBufferTest::testDiscardFlush()\n");
+    _debug ("MainBufferTest::testDiscardFlush()");
 
     CallID test_id = "flush discard";
     // _mainbuffer.createRingBuffer(test_id);
@@ -1038,7 +1038,7 @@ void MainBufferTest::testDiscardFlush()
 void MainBufferTest::testReadPointerInit()
 {
 
-    _debug ("MainBufferTest::testReadPointerInit()\n");
+    _debug ("MainBufferTest::testReadPointerInit()");
 
     CallID test_id = "test read pointer init";
     // RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(test_id);
@@ -1067,7 +1067,7 @@ void MainBufferTest::testReadPointerInit()
 void MainBufferTest::testRingBufferSeveralPointers()
 {
 
-    _debug ("MainBufferTest::testRingBufferSeveralPointers\n");
+    _debug ("MainBufferTest::testRingBufferSeveralPointers");
 
     CallID test_id = "test multiple read pointer";
     RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer (test_id);
@@ -1181,7 +1181,7 @@ void MainBufferTest::testRingBufferSeveralPointers()
 void MainBufferTest::testConference()
 {
 
-    _debug ("MainBufferTest::testConference()\n");
+    _debug ("MainBufferTest::testConference()");
 
     CallID test_id1 = "participant A";
     CallID test_id2 = "participant B";
@@ -1695,7 +1695,7 @@ void MainBufferTest::testConference()
     CPPUNIT_ASSERT (test_ring_buffer->AvailForGet (test_id1) == sizeof (int));
     CPPUNIT_ASSERT (test_ring_buffer->AvailForGet (test_id2) == sizeof (int));
     test_ring_buffer = _mainbuffer.getRingBuffer (test_id1);
-    _debug ("%i\n", test_ring_buffer->putLen());
+    _debug ("%i", test_ring_buffer->putLen());
     test_ring_buffer->debug();
     CPPUNIT_ASSERT (test_ring_buffer->putLen() == sizeof (int));
     CPPUNIT_ASSERT (test_ring_buffer->AvailForPut() == (int) (init_put_id1 - sizeof (int)));
diff --git a/sflphone-common/test/rtpTest.cpp b/sflphone-common/test/rtpTest.cpp
index 4a4d313314d20bdb6642bc7383deae0fd0f267a1..04219eaa7ea2b1382e2b782e8c964535dfcac6bc 100644
--- a/sflphone-common/test/rtpTest.cpp
+++ b/sflphone-common/test/rtpTest.cpp
@@ -41,7 +41,7 @@ using std::endl;
 void RtpTest::setUp()
 {
 
-    _debug ("------ Set up rtp test------\n");
+    _debug ("------ Set up rtp test------");
 
     Manager::instance().initConfigFile();
     Manager::instance().init();
@@ -69,7 +69,7 @@ bool RtpTest::pjsipInit()
     _pool = pj_pool_create (&_cp.factory, "rtpTest", 4000, 4000, NULL);
 
     if (!_pool) {
-        _debug ("----- RtpTest: Could not initialize pjsip memory pool ------\n");
+        _debug ("----- RtpTest: Could not initialize pjsip memory pool ------");
         return PJ_ENOMEM;
     }
 
@@ -83,16 +83,16 @@ void RtpTest::testRtpInitClose()
 
     audiortp = new AudioRtp();
 
-    _debug ("------ void RtpTest::testRtpInit() ------\n");
+    _debug ("------ void RtpTest::testRtpInit() ------");
 
     try {
 
-        _debug ("-------- Open Rtp Session ----------\n");
+        _debug ("-------- Open Rtp Session ----------");
         audiortp->createNewSession (sipcall);
 
     } catch (...) {
 
-        _debug ("!!! Exception occured while Oppenning Rtp !!!\n");
+        _debug ("!!! Exception occured while Oppenning Rtp !!!");
 
     }
 
@@ -103,18 +103,18 @@ void RtpTest::testRtpInitClose()
 
     // computeNbByteAudioLayer
 
-    _debug ("------ Finilize Rtp Initialization ------ \n");
+    _debug ("------ Finilize Rtp Initialization ------ ");
 
 
-    _debug ("------ RtpTest::testRtpClose() ------\n");
+    _debug ("------ RtpTest::testRtpClose() ------");
 
     try {
-        _debug ("------ Close Rtp Session -------\n");
+        _debug ("------ Close Rtp Session -------");
         CPPUNIT_ASSERT (audiortp->closeRtpSession());
 
     } catch (...) {
 
-        _debug ("!!! Exception occured while closing Rtp !!!\n");
+        _debug ("!!! Exception occured while closing Rtp !!!");
 
     }
 
@@ -129,7 +129,7 @@ void RtpTest::testRtpThread()
 
     audiortp = new AudioRtp();
 
-    _debug ("-------- Open Rtp Session ----------\n");
+    _debug ("-------- Open Rtp Session ----------");
 
     try {
 
@@ -137,11 +137,11 @@ void RtpTest::testRtpThread()
 
     } catch (...) {
 
-        _debug ("!!! Exception occured while Oppenning Rtp !!!\n");
+        _debug ("!!! Exception occured while Oppenning Rtp !!!");
 
     }
 
-    _debug ("------ void RtpTest::testRtpThread ------\n");
+    _debug ("------ void RtpTest::testRtpThread ------");
 
     CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (160,8000) == 20.0f);
     CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (320,16000) == 20.0f);
@@ -150,7 +150,7 @@ void RtpTest::testRtpThread()
     // 20 ms at 44.1 khz corespond to 882 samples (1764 byte)
     CPPUNIT_ASSERT (audiortp->_RTXThread->computeNbByteAudioLayer (20.f) == 1764);
 
-    _debug ("------ Close Rtp Session -------\n");
+    _debug ("------ Close Rtp Session -------");
 
     try {
 
@@ -158,7 +158,7 @@ void RtpTest::testRtpThread()
 
     } catch (...) {
 
-        _debug ("!!! Exception occured while closing Rtp !!!\n");
+        _debug ("!!! Exception occured while closing Rtp !!!");
 
     }
 
@@ -184,7 +184,7 @@ void RtpTest::testRtpResampling()
 
     audiortp = new AudioRtp();
 
-    _debug ("-------- Open Rtp Session ----------\n");
+    _debug ("-------- Open Rtp Session ----------");
 
     try {
 
@@ -192,28 +192,28 @@ void RtpTest::testRtpResampling()
 
     } catch (...) {
 
-        _debug ("!!! Exception occured while Oppenning Rtp !!!\n");
+        _debug ("!!! Exception occured while Oppenning Rtp !!!");
 
     }
 
-    _debug ("------ void RtpTest::testRtpResampling ------\n");
+    _debug ("------ void RtpTest::testRtpResampling ------");
 
     CPPUNIT_ASSERT (0 == 0);
     rsmpl_nbSample = audiortp->_RTXThread->reSampleData (data, rsmpl_data, 8000, nbSample, UP_SAMPLING);
-    _debug ("ORIGINAL DATA SET\n");
+    _debug ("ORIGINAL DATA SET");
 
     for (int i = 0; i < nbSample; i++)
         printf ("  %i=>%i  ", i, data[i]);
 
-    _debug ("RESAMPLED DATA SET\n");
+    _debug ("RESAMPLED DATA SET");
 
     for (int i = 0; i < rsmpl_nbSample; i++)
         printf ("  %i=>%i  ", i, rsmpl_data[i]);
 
-    printf ("\n");
+    printf ("");
 
 
-    _debug ("------ Close Rtp Session -------\n");
+    _debug ("------ Close Rtp Session -------");
 
     try {
 
@@ -221,7 +221,7 @@ void RtpTest::testRtpResampling()
 
     } catch (...) {
 
-        _debug ("!!! Exception occured while closing Rtp !!!\n");
+        _debug ("!!! Exception occured while closing Rtp !!!");
 
     }