diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index 7e960cb76dfd2eff06bbf9bc5e7f65fee367e0e6..75b3fb021aa8471119097b4dfb9ede054a8b0238 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -413,7 +413,6 @@ ManagerImpl::hangupCall (const CallID& call_id)
     PulseLayer *pulselayer;
     AccountID account_id;
     bool returnValue;
-    AudioLayer *audiolayer;
 
     // store the current call id
     CallID current_call_id = getCurrentCallId();
@@ -425,17 +424,6 @@ ManagerImpl::hangupCall (const CallID& call_id)
 
     if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HUNGUP");
 
-    int nbCalls = getCallList().size();
-
-    audiolayer = getAudioDriver();
-
-    // stop streams
-    if (audiolayer && (nbCalls <= 1)) {
-        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls);
-        audiolayer->stopStream();
-    }
-
-
     if (participToConference (call_id)) {
 
         Conference *conf = getConferenceFromCallID (call_id);
@@ -472,6 +460,16 @@ ManagerImpl::hangupCall (const CallID& call_id)
         removeCallAccount (call_id);
     }
 
+    int nbCalls = getCallList().size();
+
+    AudioLayer *audiolayer = getAudioDriver();
+
+    // stop streams
+    if (audiolayer && (nbCalls <= 1)) {
+        _debug ("    hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls);
+        audiolayer->stopStream();
+    }
+
     if (_audiodriver->getLayerType() == PULSEAUDIO) {
         pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver());
     }