From 1613e8c2180952a5f312071acc9076772a3e2556 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 9 Oct 2008 18:25:34 +0200 Subject: Fix response and hold response logig --- audio/headset.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'audio/headset.c') diff --git a/audio/headset.c b/audio/headset.c index 9c575fc0..44b1f801 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -793,14 +793,15 @@ static int response_and_hold(struct audio_device *device, const char *buf) if (strlen(buf) < 8) return -EINVAL; - if (buf[7] == '=') + if (buf[7] == '=') { telephony_response_and_hold_req(device, atoi(&buf[8]) < 0); - else if (ag.rh >= 0) - return headset_send(hs, "\r\n+BTRH:%d\r\n", ag.rh); - else - return headset_send(hs, "\r\nOK\r\n", ag.rh); + return 0; + } - return 0; + if (ag.rh >= 0) + headset_send(hs, "\r\n+BTRH:%d\r\n", ag.rh); + + return headset_send(hs, "\r\nOK\r\n", ag.rh); } int telephony_last_dialed_number_rsp(void *telephony_device, cme_error_t err) -- cgit