From 931db32a886f98b75b101eeff73cb9e3d592688d Mon Sep 17 00:00:00 2001
From: Ming Rui Zhang <mingrui.zhang@savoirfairelinux.com>
Date: Tue, 16 Jul 2019 17:05:35 -0400
Subject: [PATCH] lrc: add refuse function for peer to refuse the call

Change-Id: I261587c5c9e0ef9929241becc24ad57dbca0abd6
---
 src/api/newcallmodel.h | 5 +++++
 src/newcallmodel.cpp   | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/src/api/newcallmodel.h b/src/api/newcallmodel.h
index 65138c49..e9c8bd42 100644
--- a/src/api/newcallmodel.h
+++ b/src/api/newcallmodel.h
@@ -121,6 +121,11 @@ public:
      * @param callId
      */
     void hangUp(const std::string& callId) const;
+    /**
+     * Refuse a call
+     * @param callId
+     */
+    void refuse(const std::string& callId) const;
     /**
      * Toggle audio record on a call
      * @param callId
diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp
index cb9dc2b5..126d07f1 100644
--- a/src/newcallmodel.cpp
+++ b/src/newcallmodel.cpp
@@ -220,6 +220,13 @@ NewCallModel::hangUp(const std::string& callId) const
     }
 }
 
+void
+NewCallModel::refuse(const std::string& callId) const
+{
+    if (!hasCall(callId)) return;
+    CallManager::instance().refuse(callId.c_str());
+}
+
 void
 NewCallModel::toggleAudioRecord(const std::string& callId) const
 {
-- 
GitLab