From f372439b1bd4b7fe009a04679901ca8d2f5f7af7 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandre.savard@savoirfairelinux.net>
Date: Mon, 19 Oct 2009 15:49:54 -0400
Subject: [PATCH] [#2308] Stop stream when refusing a call

---
 sflphone-common/src/managerimpl.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index 74b9f0d157..052b87fadf 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -779,6 +779,19 @@ ManagerImpl::refuseCall (const CallID& id)
 
     stopTone (true);
 
+
+    int nbCalls = getCallList().size();
+
+    // AudioLayer* audiolayer = getAudioDriver();
+    
+    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 (id) == Call::IPtoIP) {
@@ -809,6 +822,8 @@ ManagerImpl::refuseCall (const CallID& id)
         switchCall ("");
     }
 
+    
+
     return returnValue;
 }
 
-- 
GitLab