From 964688716ea786c628ee04d5fde22d3cec21e51f Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Wed, 5 Oct 2016 16:43:04 -0400
Subject: [PATCH] stop tone and remove audio of failed call

If an incoming call fails due to some error (eg: 503), its ring
tone is never stopped. This stops the ring tone and audio streams
of the call on failure. Otherwise they keep playing and cannot be
stopped by the user without killing the daemon.

Change-Id: I8e3948812fab5d024a9571a99122b452dc4ca092
Tuleap: #1012
(cherry picked from commit 664a6ebf136f2dc5bab6d9c131218fced2373518)
---
 src/manager.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/manager.cpp b/src/manager.cpp
index d1124f942e..e3d0da2d10 100644
--- a/src/manager.cpp
+++ b/src/manager.cpp
@@ -1808,6 +1808,9 @@ Manager::callFailure(Call& call)
 
     checkAudio();
     removeWaitingCall(call_id);
+    if (not incomingCallsWaiting())
+        stopTone();
+    removeAudio(call);
 }
 
 //THREAD=VoIP
-- 
GitLab