diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-05 15:12:21 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-05 15:12:21 +0300 |
commit | 32fc3fa8a5b2d0da00910390e7fef03b568a6b61 (patch) | |
tree | 0fa541214fbbc1f9cc1bca36db8cea9ed07505e9 /audio/headset.c | |
parent | 2f744156467aac007834f602f211a2b4e882f144 (diff) |
Implement support for placing calls (ATD)
Diffstat (limited to 'audio/headset.c')
-rw-r--r-- | audio/headset.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c index f4afa090..15b9a66d 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -702,6 +702,24 @@ static int last_dialed_number(struct audio_device *device, const char *buf) return headset_send(hs, "\r\nOK\n\r"); } +static int dial_number(struct audio_device *device, const char *buf) +{ + struct headset *hs = device->headset; + + ag.ev_buf_active = TRUE; + + if (telephony_dial_number(&buf[3]) < 0) { + headset_send(hs, "\r\nERROR\r\n"); + return 0; + } + + flush_events(); + ag.ev_buf_active = FALSE; + + return headset_send(hs, "\r\nOK\n\r"); +} + + static int signal_gain_setting(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; @@ -749,6 +767,7 @@ ok: static struct event event_callbacks[] = { { "ATA", answer_call }, + { "ATD", dial_number }, { "AT+VG", signal_gain_setting }, { "AT+BRSF", supported_features }, { "AT+CIND", report_indicators }, |