From 4abc4e4cce2d8e70cd0d871cbd7b8e4ee149423c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 16 Oct 2008 18:14:53 +0300 Subject: Implement telephony_dial_number_req Currently the methor reply isn't taken into account but we solely on the state signals instead. --- audio/telephony-maemo.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c index 891e83dc..1289d6b9 100644 --- a/audio/telephony-maemo.c +++ b/audio/telephony-maemo.c @@ -235,21 +235,24 @@ void telephony_answer_call_req(void *telephony_device) void telephony_dial_number_req(void *telephony_device, const char *number) { - g_free(active_call_number); - active_call_number = g_strdup(number); + DBusMessage *msg; - debug("telephony-maemo: dial request to %s", active_call_number); + debug("telephony-maemo: dial request to %s", number); - telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE); + 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_terminate_call_rsp(telephony_device, + CME_ERROR_AG_FAILURE); + return; + } - /* Notify outgoing call set-up successfully initiated */ - telephony_update_indicator(maemo_indicators, "callsetup", - EV_CALLSETUP_OUTGOING); - telephony_update_indicator(maemo_indicators, "callsetup", - EV_CALLSETUP_ALERTING); + dbus_message_append_args(msg, DBUS_TYPE_STRING, &number); - active_call_status = CALL_STATUS_ALERTING; - active_call_dir = CALL_DIR_OUTGOING; + g_dbus_send_message(connection, msg); + + telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE); } void telephony_transmit_dtmf_req(void *telephony_device, char tone) -- cgit