diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-20 12:09:38 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-12-08 16:10:56 +0200 |
commit | 52e501b1e99f31b6675a9d96c6b3b28f62af3dcf (patch) | |
tree | 633fda98ba9af925eb8d4ef6f754cd56fa5e0e60 | |
parent | 2672738072914639a649253927452821af80dc51 (diff) |
Basic support for last dialed number
-rw-r--r-- | audio/telephony-maemo.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c index 36b34778..d1016ac3 100644 --- a/audio/telephony-maemo.c +++ b/audio/telephony-maemo.c @@ -88,6 +88,8 @@ static gboolean events_enabled = FALSE; */ static int response_and_hold = -1; +static char *last_dialed_number = NULL; + static struct indicator maemo_indicators[] = { { "battchg", "0-5", 5 }, @@ -193,25 +195,13 @@ void telephony_response_and_hold_req(void *telephony_device, int rh) void telephony_last_dialed_number_req(void *telephony_device) { - DBusMessage *msg; - const char *number = "urn:service:ldn"; - debug("telephony-maemo: last dialed number request"); - msg = dbus_message_new_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH, - CSD_CALL_INTERFACE, "Create"); - if (!msg) { - error("Unable to allocate new D-Bus message"); - telephony_dial_number_rsp(telephony_device, - CME_ERROR_AG_FAILURE); - return; - } - - dbus_message_append_args(msg, DBUS_TYPE_STRING, &number); - - g_dbus_send_message(connection, msg); - - telephony_last_dialed_number_rsp(telephony_device, CME_ERROR_NONE); + if (last_dialed_number) + telephony_dial_number_req(telephony_device, NULL); + else + telephony_last_dialed_number_rsp(telephony_device, + CME_ERROR_NOT_ALLOWED); } void telephony_terminate_call_req(void *telephony_device) @@ -275,7 +265,13 @@ void telephony_dial_number_req(void *telephony_device, const char *number) { DBusMessage *msg; - debug("telephony-maemo: dial request to %s", number); + if (number) { + g_free(last_dialed_number); + last_dialed_number = g_strdup(number); + debug("telephony-maemo: dial request to %s", number); + } else + number = last_dialed_number; + msg = dbus_message_new_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH, CSD_CALL_INTERFACE, "Create"); |