aboutsummaryrefslogtreecommitdiffstats
path: root/binding/telephony-binding.c
diff options
context:
space:
mode:
authorsaman <mahmoudi.saman1@gmail.com>2020-10-12 08:56:02 +0330
committersaman <mahmoudi.saman1@gmail.com>2020-10-12 09:02:04 +0330
commit5762ff51fce596eadbd57522a6ab2978147cd830 (patch)
tree79b5c9cc02691cfcf0cc3ab91dd7dd201c620161 /binding/telephony-binding.c
parent17ce975cbe0b32326ee761718e91effad2b5169f (diff)
Adding last call verb for calling last phone number
Initiates a new outgoing call for last phone number that was saved into phone Change-Id: Iafd9259680f9bd83845220dc912d09cd4ecf53d6 Signed-off-by: saman <mahmoudi.saman1@gmail.com>
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,
},