diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index e8b7edaaa8e7e82a8c9f044ed25515578e4c7edb..0f9b601acd7ff133b7781f1bec4f8dcd98767de3 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\n", 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()); }