All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv4] voicecall: fix dial result handling
@ 2010-11-26 15:14 Pekka.Pessi
  2010-12-03 19:23 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Pekka.Pessi @ 2010-11-26 15:14 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]

From: Pekka Pessi <Pekka.Pessi@nokia.com>

The existing call will be automatically put on hold if there is an
existing active call when dialing. On some modems the dial request
returns only after the dialed call is active and the existing call has
been put on hold.

However, on isimodem driver the dial request returns immediately before
the existing call has changed its status. With isimodem driver the
dial_handle_result() selected the existing call from the list when it
should have created a new one.

The dial result handling now guards againt returning a previously dialed
active call as result.
---
 src/voicecall.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 52baec3..d03ac2e 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -68,6 +68,7 @@ struct voicecall {
 	char *message;
 	uint8_t icon_id;
 	gboolean untracked;
+	gboolean dial_result_handled;
 };
 
 struct dial_request {
@@ -1096,9 +1097,18 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc,
 		v = l->data;
 
 		if (v->call->status == CALL_STATUS_DIALING ||
-				v->call->status == CALL_STATUS_ALERTING ||
-				v->call->status == CALL_STATUS_ACTIVE)
-			return v;
+				v->call->status == CALL_STATUS_ALERTING)
+			goto handled;
+
+		/*
+		 * Dial request may return before existing active call
+		 * is put on hold or after dialed call has got active
+		 */
+		if (v->call->status == CALL_STATUS_ACTIVE &&
+				v->call->direction ==
+				CALL_DIRECTION_MOBILE_ORIGINATED &&
+				!v->dial_result_handled)
+			goto handled;
 	}
 
 	call = synthesize_outgoing_call(vc, number);
@@ -1119,6 +1129,9 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc,
 
 	*need_to_emit = TRUE;
 
+handled:
+	v->dial_result_handled = TRUE;
+
 	return v;
 }
 
-- 
1.7.1


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

* Re: [PATCHv4] voicecall: fix dial result handling
  2010-11-26 15:14 [PATCHv4] voicecall: fix dial result handling Pekka.Pessi
@ 2010-12-03 19:23 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-12-03 19:23 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

Hi Pekka,

On 11/26/2010 09:14 AM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> The existing call will be automatically put on hold if there is an
> existing active call when dialing. On some modems the dial request
> returns only after the dialed call is active and the existing call has
> been put on hold.
> 
> However, on isimodem driver the dial request returns immediately before
> the existing call has changed its status. With isimodem driver the
> dial_handle_result() selected the existing call from the list when it
> should have created a new one.
> 
> The dial result handling now guards againt returning a previously dialed
> active call as result.
> ---
>  src/voicecall.c |   19 ++++++++++++++++---
>  1 files changed, 16 insertions(+), 3 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2010-12-03 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26 15:14 [PATCHv4] voicecall: fix dial result handling Pekka.Pessi
2010-12-03 19:23 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.