summaryrefslogtreecommitdiffstats
path: root/telephony-binding
diff options
context:
space:
mode:
Diffstat (limited to 'telephony-binding')
-rw-r--r--telephony-binding/gdbus/ofono_voicecall.c7
-rw-r--r--telephony-binding/gdbus/ofono_voicecall.h1
-rw-r--r--telephony-binding/telephony-binding.c16
3 files changed, 24 insertions, 0 deletions
diff --git a/telephony-binding/gdbus/ofono_voicecall.c b/telephony-binding/gdbus/ofono_voicecall.c
index b602c89..de6db2f 100644
--- a/telephony-binding/gdbus/ofono_voicecall.c
+++ b/telephony-binding/gdbus/ofono_voicecall.c
@@ -34,3 +34,10 @@ void ofono_voicecall_hangup(OrgOfonoVoiceCall *voice_call)
org_ofono_voice_call_call_hangup_sync(voice_call, NULL, &error);
}
+
+void ofono_voicecall_answer(OrgOfonoVoiceCall *voice_call)
+{
+ GError *error = NULL;
+
+ org_ofono_voice_call_call_answer_sync(voice_call, NULL, &error);
+}
diff --git a/telephony-binding/gdbus/ofono_voicecall.h b/telephony-binding/gdbus/ofono_voicecall.h
index 0e33dd5..6405d1b 100644
--- a/telephony-binding/gdbus/ofono_voicecall.h
+++ b/telephony-binding/gdbus/ofono_voicecall.h
@@ -20,4 +20,5 @@
OrgOfonoVoiceCall *ofono_voicecall_new(gchar *);
void ofono_voicecall_free(OrgOfonoVoiceCall *);
+void ofono_voicecall_answer(OrgOfonoVoiceCall *);
void ofono_voicecall_hangup(OrgOfonoVoiceCall *);
diff --git a/telephony-binding/telephony-binding.c b/telephony-binding/telephony-binding.c
index 134432c..00115d2 100644
--- a/telephony-binding/telephony-binding.c
+++ b/telephony-binding/telephony-binding.c
@@ -70,6 +70,16 @@ static void hangup(struct afb_req request)
}
}
+static void answer(struct afb_req request)
+{
+ if (incoming_call) {
+ DEBUG(interface, "Answer voice call\n");
+ voice_call = incoming_call;
+ ofono_voicecall_answer(voice_call);
+ } else {
+ ERROR(interface, "Answer: no incoming call");
+ }
+}
static void incoming_call_cb(OrgOfonoVoiceCallManager *manager, gchar *op, gchar *clip)
{
@@ -147,6 +157,12 @@ static const struct afb_verb_desc_v1 verbs[]= {
.callback = hangup,
.info = "Hangup phone"
},
+ {
+ .name = "answer",
+ .session = AFB_SESSION_NONE,
+ .callback = answer,
+ .info = "Answer phone"
+ },
{NULL}
};