aboutsummaryrefslogtreecommitdiffstats
path: root/binding/telephony-binding.c
diff options
context:
space:
mode:
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,
},