diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-08 11:52:14 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-08 11:52:14 +0200 |
commit | 24535ebd27daa3a1809e688418db962d64e9125a (patch) | |
tree | 200fb4f95c9c1831e5792fd03358fd88a2b8f76d /audio | |
parent | 58cd734fdc101b83c4da6b23195b292100f5285f (diff) |
Properly extract the phone number from the ATD string
Voice call ATD requests have a semicolon at the end of the string while data
call requests don't. So detect this and don't copy the semicolon to the
currently active number (possible sent back to the headset in subsequent
operations).
Diffstat (limited to 'audio')
-rw-r--r-- | audio/telephony-dummy.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c index df9cdf08..3c87ce2a 100644 --- a/audio/telephony-dummy.c +++ b/audio/telephony-dummy.c @@ -29,6 +29,7 @@ #include <stdlib.h> #include <stdio.h> #include <stdint.h> +#include <string.h> #include <glib.h> #include <dbus/dbus.h> #include <gdbus.h> @@ -132,8 +133,21 @@ void telephony_answer_call_req(void *telephony_device) void telephony_dial_number_req(void *telephony_device, const char *number) { + char last; + + last = number[strlen(number) - 1]; + g_free(active_call_number); - active_call_number = g_strdup(number); + + if (last == ';') { + active_call_number = g_strndup(number, strlen(number) -1); + debug("telephony-dummy: voice call dial request to %s", + active_call_number); + } else { + active_call_number = g_strdup(number); + debug("telephony-dummy: data call dial request to %s", + active_call_number); + } telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE); |