diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index 31d8d3041c73d27e31a74f4309b7dab92921669a..001f6d4ac3719a8a608baca6f7d9093875bb3bf4 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -291,6 +291,10 @@ bool ManagerImpl::answerCall(const std::string& call_id) // If sflphone is ringing stopTone(); + // set playback mode to VOICE + AudioLayer al = getAudioDriver(); + if(al) al->setPlaybackMode(AudioLayer::VOICE); + // store the current call id std::string current_call_id(getCurrentCallId()); @@ -354,6 +358,10 @@ void ManagerImpl::hangupCall(const std::string& callId) stopTone(); + // set playback mode to NONE + AudioLayer al = getAudioDriver(); + if(al) al->setPlaybackMode(AudioLayer::NONE); + /* Broadcast a signal over DBus */ DEBUG("Send DBUS call state change (HUNGUP) for id %s", callId.c_str()); dbus_.getCallManager()->callStateChanged(callId, "HUNGUP"); @@ -1520,9 +1528,14 @@ void ManagerImpl::peerAnsweredCall(const std::string& id) DEBUG("Peer answered call %s", id.c_str()); // The if statement is usefull only if we sent two calls at the same time. - if (isCurrentCall(id)) + if (isCurrentCall(id)) { stopTone(); + // set playback mode to VOICE + AudioLayer al = getAudioDriver(); + if(al) al->setPlaybackMode(AudioLayer::VOICE); + } + // Connect audio streams addStream(id); @@ -1559,6 +1572,10 @@ void ManagerImpl::peerHungupCall(const std::string& call_id) } else if (isCurrentCall(call_id)) { stopTone(); unsetCurrentCall(); + + // set playback mode to NONE + AudioLayer al = getAudioDriver(); + if(al) al->setPlaybackMode(AudioLayer::NONE); } /* Direct IP to IP call */