summaryrefslogtreecommitdiffstats
path: root/audio/headset.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-08 12:15:09 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-08 12:15:09 +0200
commit2db2d39af8cba3883756d21a0634722f37bdfef0 (patch)
treed0e93c56e1e2ff22b735f6c6424dc6d4ece85ace /audio/headset.c
parentfdd1cc6f1deb3d4410d7f6583b6364b58179a7a0 (diff)
Reject non-voice calls in headset.c
Basicly reverts the previous commit since data calls just don't make sense with HFP. Check for proper voice call dial string and pass the number without the terminating semicolon to the telephony driver.
Diffstat (limited to 'audio/headset.c')
-rw-r--r--audio/headset.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 31955490..a4fe84fe 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -785,7 +785,20 @@ int telephony_dial_number_rsp(void *telephony_device, cme_error_t err)
static int dial_number(struct audio_device *device, const char *buf)
{
- telephony_dial_number_req(device, &buf[3]);
+ char number[BUF_SIZE];
+ size_t buf_len;
+
+ buf_len = strlen(buf);
+
+ if (buf[buf_len - 1] != ';') {
+ debug("Rejecting non-voice call dial request");
+ return -EINVAL;
+ }
+
+ memset(number, 0, sizeof(number));
+ strncpy(number, &buf[3], buf_len - 4);
+
+ telephony_dial_number_req(device, number);
return 0;
}