Commit 7f6412f4 authored by Rafaël Carré's avatar Rafaël Carré

* #7037 : stop audio stream after all calls have been hanged up

parent 0a6a3d30
......@@ -338,22 +338,6 @@ void ManagerImpl::hangupCall (const std::string& callId)
{
_info ("Manager: Hangup call %s", callId.c_str());
// First stop audio layer if there is no call anymore
if (getCallList().empty()) {
audioLayerMutexLock();
if(_audiodriver == NULL) {
audioLayerMutexUnlock();
_error("Manager: Error: Audio layer was not instantiated");
return;
}
_debug ("Manager: stop audio stream, there is no call remaining");
_audiodriver->stopStream();
audioLayerMutexUnlock();
}
// store the current call id
std::string currentCallId(getCurrentCallId());
......@@ -2629,10 +2613,19 @@ std::string ManagerImpl::getAccountFromCall(const std::string& callID)
return (iter == _callAccountMap.end()) ? "" : iter->second;
}
bool ManagerImpl::removeCallAccount (const std::string& callID)
void ManagerImpl::removeCallAccount (const std::string& callID)
{
ost::MutexLock m (_callAccountMapMutex);
return _callAccountMap.erase (callID);
_callAccountMap.erase (callID);
// Stop audio layer if there is no call anymore
if (_callAccountMap.empty()) {
audioLayerMutexLock();
if(_audiodriver)
_audiodriver->stopStream();
audioLayerMutexUnlock();
}
}
bool ManagerImpl::isValidCall(const std::string& callID)
......
......@@ -1041,6 +1041,12 @@ class ManagerImpl
*/
bool isWaitingCall (const std::string& id);
/** Remove a CallID/std::string association
* Protected by mutex
* @param callID the CallID to remove
*/
void removeCallAccount (const std::string& callID);
/**
* Path of the ConfigFile
*/
......@@ -1100,13 +1106,6 @@ class ManagerImpl
*/
bool associateCallToAccount (const std::string& callID, const std::string& accountID);
/** Remove a CallID/std::string association
* Protected by mutex
* @param callID the CallID to remove
* @return bool True if association is removed
*/
bool removeCallAccount (const std::string& callID);
/**
* Test if call is a valid call, i.e. have been created and stored in
* call-account map
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment