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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/binding/telephony-binding.c b/binding/telephony-binding.c
index c7feac6..c84af2c 100644
--- a/binding/telephony-binding.c
+++ b/binding/telephony-binding.c
@@ -64,6 +64,21 @@ static void dial(afb_req_t request)
}
}
+static void last_dial(afb_req_t request)
+{
+ if (voice_call) {
+ AFB_ERROR("dial: cannot dial with active call");
+ afb_req_fail(request, "active call", NULL);
+ } else {
+ if (!ofono_voicecallmanager_last_dial(vcm)) {
+ afb_req_success(request, NULL, NULL);
+ } else {
+ AFB_ERROR("dial: failed to dial number\n");
+ afb_req_fail(request, "failed dial", NULL);
+ }
+ }
+}
+
static void hangup(afb_req_t request)
{
if (voice_call) {
@@ -327,6 +342,10 @@ static const afb_verb_t verbs[]= {
.callback = dial,
},
{
+ .verb = "last_dial",
+ .callback = last_dial,
+ },
+ {
.verb = "hangup",
.callback = hangup,
},