diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index 274bd21820e1ee60229a0e78ef8af9e6de7e37c4..6f8304964d4f0af7c4670b3f5444394d57d104bd 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -1707,9 +1707,8 @@ ManagerImpl::playDtmf (char code, bool isTalking)
         // put the size in bytes...
         // so size * 1 channel (mono) * sizeof (bytes for the data)
 	// audiolayer->flushUrgent();
-
-        audiolayer->startStream();
-        audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat));
+	audiolayer->startStream();
+	audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat));
     }
     else {
 	_debug("    playDtmf: Error cannot play dtmf\n");
@@ -1920,22 +1919,22 @@ ManagerImpl::peerHungupCall (const CallID& call_id)
 	if (isCurrentCall(call_id)) 
 	{
 	    stopTone (true);
-
-	    int nbCalls = getCallList().size();
-
-	    // stop streams
-	    if (nbCalls <= 1)
-	    {
-		_debug("    hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls);
-		
-		AudioLayer* audiolayer = getAudioDriver();
-		audiolayer->stopStream();
-	    }
 	    
 	    switchCall ("");
 	}
     }
 
+    int nbCalls = getCallList().size();
+
+    // stop streams
+    if (nbCalls <= 1)
+    {
+	_debug("    hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls);
+	
+	AudioLayer* audiolayer = getAudioDriver();
+	audiolayer->stopStream();
+    }
+
     /* Direct IP to IP call */
     if (getConfigFromCall (call_id) == Call::IPtoIP) {
         SIPVoIPLink::instance (AccountNULL)->hangup (call_id);
@@ -2039,8 +2038,8 @@ bool ManagerImpl::playATone (Tone::TONEID toneId)
 
     
     if (audiolayer) {
-	audiolayer->startStream();
 	audiolayer->flushUrgent();
+	audiolayer->startStream();
     }
 
     if (_telephoneTone != 0) {