2010-07-14 15:20:39

by Radoslaw Jablonski

[permalink] [raw]
Subject: [PATCH] Additional handling incoming call indication for HS

Some headsets expect incoming call indication before they can send ATA
command. In current implementation of telephony we do not send outband
notyfication about incoming call when call previously was in WAITING
state. And without that kind of notyfication BH-108 and BackBeat 903
headset cannot send ATA command - user is unable to answer to that call
from headset.

Added handling for that case in func handle_call_status(). When phone now
is in CSD_CALL_STATUS_MT_ALERTING and previously was in
CSD_CALL_STATUS_WAITING that means we need to send incoming call
notyfication (it was not sent earlier because new call was waiting for end
of active call). This will send RING commands to headset if it is needed.
---
audio/telephony-maemo6.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 046620c..6e5166b 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -976,7 +976,7 @@ static void handle_create_requested(DBusMessage *msg)
static void handle_call_status(DBusMessage *msg, const char *call_path)
{
struct csd_call *call;
- dbus_uint32_t status, cause_type, cause;
+ dbus_uint32_t status, cause_type, cause, prev_status;
int callheld = telephony_get_indicator(maemo_indicators, "callheld");

if (!dbus_message_get_args(msg, NULL,
@@ -1000,10 +1000,11 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
return;
}

+ prev_status = call->status;
DBG("Call %s changed from %s to %s", call_path,
- call_status_str[call->status], call_status_str[status]);
+ call_status_str[prev_status], call_status_str[status]);

- if (call->status == (int) status) {
+ if (prev_status == status) {
DBG("Ignoring CSD Call state change to existing state");
return;
}
@@ -1043,6 +1044,14 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
EV_CALLSETUP_ALERTING);
break;
case CSD_CALL_STATUS_MT_ALERTING:
+ /* Some headsets expect incoming call notification before they
+ * can send ATA command. When call changed status from waiting
+ * to alerting we need to send missing notification. Otherwise
+ * headsets like Nokia BH-108 or BackBeat 903 are unable to
+ * answer incoming call that was previously waiting. */
+ if (prev_status == CSD_CALL_STATUS_WAITING)
+ telephony_incoming_call_ind(call->number, number_type(
+ call->number));
break;
case CSD_CALL_STATUS_WAITING:
break;
--
1.7.0.4



2010-07-14 17:08:22

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Additional handling incoming call indication for HS

Hi,

On Wed, Jul 14, 2010, Radoslaw Jablonski wrote:
> Some headsets expect incoming call indication before they can send ATA
> command. In current implementation of telephony we do not send outband
> notyfication about incoming call when call previously was in WAITING
> state. And without that kind of notyfication BH-108 and BackBeat 903
> headset cannot send ATA command - user is unable to answer to that call
> from headset.
>
> Added handling for that case in func handle_call_status(). When phone now
> is in CSD_CALL_STATUS_MT_ALERTING and previously was in
> CSD_CALL_STATUS_WAITING that means we need to send incoming call
> notyfication (it was not sent earlier because new call was waiting for end
> of active call). This will send RING commands to headset if it is needed.
> ---
> audio/telephony-maemo6.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)

Thanks. The patch is now pushed upstream.

Johan

2010-07-14 14:33:24

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Additional handling incoming call indication for HS

Hi,

On Wed, Jul 14, 2010, Radoslaw Jablonski wrote:
> Some headsets expect incoming call indication before they can send ATA
> command. In current implementation of telephony we do not send outband
> notyfication about incoming call when call previously was in WAITING state.
> And without that kind of notyfication BH-108 and BackBeat 903 headset cannot
> send ATA command - user is unable to answer to that call from headset.
>
> Added handling for that case in func handle_call_status(). When phone now is
> in CSD_CALL_STATUS_MT_ALERTING and previously was in CSD_CALL_STATUS_WAITING
> that means we need to send incoming call notyfication (it was not sent earlier
> because new call was waiting for end of active call). This will send RING
> commands to headset if it is needed.
> ---
> audio/telephony-maemo6.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)

Thanks for the patch. There are a few issues that'll need to be fixed
before pushing it upstream. The most serious one is this:

audio/telephony-maemo6.c: In function ‘handle_call_status’:
audio/telephony-maemo6.c:1007: error: comparison between signed and
unsigned integer expressions

Please always check compilation with ./bootstrap-configure since that'll
cause any warnings to show up as errors.

Another issue is the commit message width. Please keep it at a maximum
of 74 characters so that it's nicely viewable using git log on a
80-character wide terminal.

And then the following (minor) whitespace issue:

> + if(prev_status == CSD_CALL_STATUS_WAITING)

There should be a space between the if and the parenthesis. Otherwise
the patch was fine. So please fix these issues and resubmit. Thanks.

Johan