summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--audio/headset.c19
-rw-r--r--audio/telephony-dummy.c8
-rw-r--r--audio/telephony.h2
3 files changed, 29 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 },
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c
index efe6c4ff..0e9673b3 100644
--- a/audio/telephony-dummy.c
+++ b/audio/telephony-dummy.c
@@ -103,6 +103,14 @@ int telephony_answer_call(void)
return 0;
}
+int telephony_dial_number(const char *number)
+{
+ /* Notify outgoing call set-up successfully initiated */
+ telephony_update_indicator(dummy_indicators, "callsetup",
+ EV_CALLSETUP_OUTGOING);
+ return 0;
+}
+
/* D-Bus method handlers */
static DBusMessage *outgoing_call(DBusConnection *conn, DBusMessage *msg,
void *data)
diff --git a/audio/telephony.h b/audio/telephony.h
index bdadb259..8334a3e1 100644
--- a/audio/telephony.h
+++ b/audio/telephony.h
@@ -76,6 +76,8 @@ int telephony_terminate_call(void);
int telephony_answer_call(void);
+int telephony_dial_number(const char *number);
+
int telephony_ready(uint32_t features, const struct indicator *indicators,
int rh);