diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-10 17:52:50 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-10 17:52:50 +0300 |
commit | 499ab24d27df0ffb1164f4134e7394b2a2292b15 (patch) | |
tree | 8902e4ef22292b9eb832525e9751061157458c6a /audio/headset.c | |
parent | 3e34eab99bd769efc756cc8e3a452b00e48de387 (diff) |
Implement DTMF tone transmission (AT+VTS)
Diffstat (limited to 'audio/headset.c')
-rw-r--r-- | audio/headset.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c index 4683c356..b90c1a9c 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -840,6 +840,23 @@ ok: return headset_send(hs, "\r\nOK\r\n"); } +static int dtmf_tone(struct audio_device *device, const char *buf) +{ + struct headset *hs = device->headset; + + if (strlen(buf) < 8) { + error("Too short string for DTMF tone"); + return -EINVAL; + } + + if (telephony_transmit_dtmf_req(buf[7]) < 0) { + headset_send(hs, "\r\nERROR\r\n"); + return 0; + } + + return headset_send(hs, "\r\nOK\n\r"); +} + static struct event event_callbacks[] = { { "ATA", answer_call }, { "ATD", dial_number }, @@ -853,6 +870,7 @@ static struct event event_callbacks[] = { { "AT+CLIP", cli_notification }, { "AT+BTRH", response_and_hold }, { "AT+BLDN", last_dialed_number }, + { "AT+VTS", dtmf_tone }, { 0 } }; |