From 10dc6edf1131c8c2b8a028de2a0f3e95709bca6b Mon Sep 17 00:00:00 2001 From: Saman Mahmoodi Date: Tue, 6 Apr 2021 15:53:37 +0430 Subject: Add new verb as get_calls get_calls verb return all active call properties. Bug-AGL: SPEC-3870 Signed-off-by: Saman Mahmoodi Change-Id: I7355b0ade66fdd84e55936cf63a4a2a62771a912 --- binding/telephony-binding.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'binding/telephony-binding.c') 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; @@ -637,6 +646,10 @@ static const afb_verb_t verbs[]= { .verb = "release_and_answer", .callback = release_and_answer, }, + { + .verb = "get_calls", + .callback = get_calls, + }, { .verb = "get_battery_level", .callback = get_battery_level, -- cgit 1.2.3-korg