aboutsummaryrefslogtreecommitdiffstats
path: root/binding/telephony-binding.c
diff options
context:
space:
mode:
authorSaman Mahmoodi <mahmoudi.saman1@gmail.com>2021-04-06 15:53:37 +0430
committerSaman Mahmoudi <mahmoudi.saman1@gmail.com>2021-05-03 07:56:38 +0430
commit10dc6edf1131c8c2b8a028de2a0f3e95709bca6b (patch)
treea4bcc3b29e1fc818ffcc1ce3c626c81319c85a60 /binding/telephony-binding.c
parent8987ae42114a8b15522734e40d117fd061e7bf3b (diff)
get_calls verb return all active call properties. Bug-AGL: SPEC-3870 Signed-off-by: Saman Mahmoodi <mahmoudi.saman1@gmail.com> Change-Id: I7355b0ade66fdd84e55936cf63a4a2a62771a912
Diffstat (limited to 'binding/telephony-binding.c')
-rw-r--r--binding/telephony-binding.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/binding/telephony-binding.c b/binding/telephony-binding.c
index 9e47c76..e764601 100644
--- a/binding/telephony-binding.c
+++ b/binding/telephony-binding.c
@@ -232,6 +232,15 @@ static void swap_calls(afb_req_t request)
}
}
+static void get_calls(afb_req_t request)
+{
+ json_object *result = ofono_voicecallmanager_get_calls(vcm);
+ if (!result)
+ afb_req_fail(request, "failed", "Can not find any active voice calls");
+ else
+ afb_req_success(request, result, NULL);
+}
+
static void get_battery_level(afb_req_t request)
{
const gchar *device;
@@ -638,6 +647,10 @@ static const afb_verb_t verbs[]= {
.callback = release_and_answer,
},
{
+ .verb = "get_calls",
+ .callback = get_calls,
+ },
+ {
.verb = "get_battery_level",
.callback = get_battery_level,
},