From db9a70d60f9d9d2101ea46c5ce4ddc695aa115e3 Mon Sep 17 00:00:00 2001
From: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
Date: Wed, 5 Sep 2018 11:47:32 -0400
Subject: [PATCH] call: missing call to callFailure in timeout case

In the case where call timeout is reached, the daemon calls
hangup(486), terminating the call. However this hangup call is not
followed by any kind of callFailure() function call meaning that the
tone and media states in the manager will not be reinitialized. As a
consequence the daemon will continue to ring even if the call has
ended.

This patch addresses this issue.

Change-Id: I2573e444179d5c6329896580dca5dd0111e57c6f
Gitlab: #48
---
 src/call.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/call.cpp b/src/call.cpp
index 784067bb72..a7d5bfc93b 100644
--- a/src/call.cpp
+++ b/src/call.cpp
@@ -103,6 +103,7 @@ Call::Call(Account& account, const std::string& id, Call::CallType type,
                          RING_DBG("Call %s is still ringing after timeout, setting state to BUSY",
                              callShPtr->getCallId().c_str());
                          callShPtr->hangup(PJSIP_SC_BUSY_HERE);
+                         Manager::instance().callFailure(*callShPtr);
                     }
                 }
            }, std::chrono::seconds(timeout));
-- 
GitLab