diff options
author | saman <mahmoudi.saman1@gmail.com> | 2020-12-16 14:21:03 +0330 |
---|---|---|
committer | saman <mahmoudi.saman1@gmail.com> | 2020-12-17 09:02:37 +0330 |
commit | 58aa4fbd91ca721994b6efe176ea94ccaee324ca (patch) | |
tree | 8145421452166d298f3c79f06fe0cd7bb93eed62 /binding/telephony-binding.c | |
parent | 56fec224dc4dd73a631ac2c15c1a240fd8e92e81 (diff) |
Adding new verb as send_toneskoi_10.91.0koi/10.91.010.91.0
When talking is in progress and someone is talking with the operator, for connecting to special part, the operator says that press 1 or somthings like that.
for supporting this property in device side and send that command through the bluetooth, we should use SendTones method on VoiceCallManager interface.
Bug-AGL: SPEC-3026
Signed-off-by: saman <mahmoudi.saman1@gmail.com>
Change-Id: I875816c1eaca6621d4be9ab5297321ff52571ec5
Diffstat (limited to 'binding/telephony-binding.c')
-rw-r--r-- | binding/telephony-binding.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/binding/telephony-binding.c b/binding/telephony-binding.c index dce0ef9..2f96338 100644 --- a/binding/telephony-binding.c +++ b/binding/telephony-binding.c @@ -79,6 +79,23 @@ static void last_dial(afb_req_t request) } } +static void send_tones(afb_req_t request) +{ + const char *value = afb_req_value(request, "value"); + + if (!voice_call) { + AFB_ERROR("send_tones: cannot send tone without active call"); + afb_req_fail(request, "there is no active call", NULL); + } else { + if (!ofono_voicecallmanager_send_tones(vcm, value)) { + afb_req_success(request, NULL, NULL); + } else { + AFB_ERROR("send_tones: failed to send tone\n"); + afb_req_fail(request, "failed send tone", NULL); + } + } +} + static void hangup(afb_req_t request) { if (voice_call) { @@ -364,6 +381,10 @@ static const afb_verb_t verbs[]= { .callback = last_dial, }, { + .verb = "send_tones", + .callback = send_tones, + }, + { .verb = "hangup", .callback = hangup, }, |