linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Additional handling incoming call indication for HS
@ 2010-07-14 14:12 Radoslaw Jablonski
  2010-07-14 14:33 ` Hedberg Johan (Nokia-D/Helsinki)
  0 siblings, 1 reply; 4+ messages in thread
From: Radoslaw Jablonski @ 2010-07-14 14:12 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Radoslaw Jablonski

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..6255c28 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 == (int) 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Additional handling incoming call indication for HS
  2010-07-14 14:12 [PATCH] Additional handling incoming call indication for HS Radoslaw Jablonski
@ 2010-07-14 14:33 ` Hedberg Johan (Nokia-D/Helsinki)
  0 siblings, 0 replies; 4+ messages in thread
From: Hedberg Johan (Nokia-D/Helsinki) @ 2010-07-14 14:33 UTC (permalink / raw)
  To: Radoslaw Jablonski; +Cc: linux-bluetooth

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Additional handling incoming call indication for HS
@ 2010-07-14 15:20 Radoslaw Jablonski
  2010-07-14 17:08 ` Hedberg Johan (Nokia-D/Helsinki)
  0 siblings, 1 reply; 4+ messages in thread
From: Radoslaw Jablonski @ 2010-07-14 15:20 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Radoslaw Jablonski

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Additional handling incoming call indication for HS
  2010-07-14 15:20 Radoslaw Jablonski
@ 2010-07-14 17:08 ` Hedberg Johan (Nokia-D/Helsinki)
  0 siblings, 0 replies; 4+ messages in thread
From: Hedberg Johan (Nokia-D/Helsinki) @ 2010-07-14 17:08 UTC (permalink / raw)
  To: Radoslaw Jablonski; +Cc: linux-bluetooth

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-14 17:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 14:12 [PATCH] Additional handling incoming call indication for HS Radoslaw Jablonski
2010-07-14 14:33 ` Hedberg Johan (Nokia-D/Helsinki)
  -- strict thread matches above, loose matches on Subject: below --
2010-07-14 15:20 Radoslaw Jablonski
2010-07-14 17:08 ` Hedberg Johan (Nokia-D/Helsinki)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).