All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix: Poll CLCC to replace the code in call_held=1
@ 2009-11-19  3:21 Zhenhua Zhang
  2009-11-19  6:39 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Zhenhua Zhang @ 2009-11-19  3:21 UTC (permalink / raw)
  To: ofono

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

When using CHLD=2x in multiparty call, call_held is 1 and we
should not swap all active->held. So we cannot save this pull
in private chat.
---
 drivers/hfpmodem/voicecall.c |   50
+++++------------------------------------
 1 files changed, 6 insertions(+), 44 deletions(-)

diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index 3591b74..52cdfd7 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -60,7 +60,6 @@ struct voicecall_data {
 	int cind_val[HFP_INDICATOR_LAST];
 	unsigned int id_list;
 	unsigned int local_release;
-	ofono_bool_t ignore_callheld_1;
 };
 
 struct release_id_req {
@@ -322,8 +321,6 @@ static void atd_cb(gboolean ok, GAtResult *result,
gpointer user_data)
 
 		call->status = CALL_STATUS_HELD;
 		ofono_voicecall_notify(vc, call);
-
-		vd->ignore_callheld_1 = TRUE;
 	}
 
 	call = create_call(vd, 0, 0, CALL_STATUS_DIALING, NULL, type,
validity);
@@ -839,15 +836,6 @@ static void ciev_callheld_notify(struct
ofono_voicecall *vc,
 	struct ofono_call *call;
 	unsigned int callheld = vd->cind_val[HFP_INDICATOR_CALLHELD];
 
-	/* When ATD is sent when another call is active, we will receive
-	 * callheld=1, then callsetup=2.  We have already placed active
-	 * calls on hold in atd_cb, so ignore the callheld in this case
-	 */
-	if (vd->ignore_callheld_1 == TRUE && value == 1) {
-		vd->ignore_callheld_1 = FALSE;
-		goto out;
-	}
-
 	switch (value) {
 	case 0:
 		/* We have to poll here, we have no idea whether the call was
@@ -859,38 +847,13 @@ static void ciev_callheld_notify(struct
ofono_voicecall *vc,
 		break;
 
 	case 1:
-	{
-		GSList *waiting;
-
-		waiting = g_slist_find_custom(vd->calls,
-					GINT_TO_POINTER(CALL_STATUS_WAITING),
-					at_util_call_compare_by_status);
-
-		for (l = vd->calls; l; l = l->next) {
-			call = l->data;
-
-			if (waiting) {
-				if (call->status == CALL_STATUS_WAITING) {
-					call->status = CALL_STATUS_ACTIVE;
-					ofono_voicecall_notify(vc, call);
-				} else if (call->status == CALL_STATUS_ACTIVE) {
-					call->status = CALL_STATUS_HELD;
-					ofono_voicecall_notify(vc, call);
-				}
-			} else {
-				if (call->status == CALL_STATUS_ACTIVE) {
-					call->status = CALL_STATUS_HELD;
-					ofono_voicecall_notify(vc, call);
-				} else if (call->status == CALL_STATUS_HELD) {
-					call->status = CALL_STATUS_ACTIVE;
-					ofono_voicecall_notify(vc, call);
-				}
-			}
-		}
-
+		/* We have to poll here, we have no idea whether the call was
+		 * accepted by CHLD=1 or swapped by CHLD=2 or one call was
+		 * chosed for private chat by CHLD=2x
+		 */
+		g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
+				clcc_poll_cb, vc, NULL);
 		break;
-	}
-
 	case 2:
 		if (callheld == 0) {
 			for (l = vd->calls; l; l = l->next) {
@@ -907,7 +870,6 @@ static void ciev_callheld_notify(struct
ofono_voicecall *vc,
 			release_with_status(vc, CALL_STATUS_ACTIVE);
 	}
 
-out:
 	vd->cind_val[HFP_INDICATOR_CALLHELD] = value;
 }
 
-- 
1.6.2.5




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

* Re: [PATCH] Fix: Poll CLCC to replace the code in call_held=1
  2009-11-19  3:21 [PATCH] Fix: Poll CLCC to replace the code in call_held=1 Zhenhua Zhang
@ 2009-11-19  6:39 ` Marcel Holtmann
  2009-11-20  1:52   ` Zhang, Zhenhua
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2009-11-19  6:39 UTC (permalink / raw)
  To: ofono

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

Hi Zhenhua,

> When using CHLD=2x in multiparty call, call_held is 1 and we
> should not swap all active->held. So we cannot save this pull
> in private chat.
> ---
>  drivers/hfpmodem/voicecall.c |   50
> +++++------------------------------------
>  1 files changed, 6 insertions(+), 44 deletions(-)

patch is corrupted. Please send again or better even use git send-email
for sending it.

Regards

Marcel



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

* RE: [PATCH] Fix: Poll CLCC to replace the code in call_held=1
  2009-11-19  6:39 ` Marcel Holtmann
@ 2009-11-20  1:52   ` Zhang, Zhenhua
  2009-11-20  8:38     ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Zhenhua @ 2009-11-20  1:52 UTC (permalink / raw)
  To: ofono

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

Hi Marcel,

Marcel Holtmann wrote:
> Hi Zhenhua,
> 
>> When using CHLD=2x in multiparty call, call_held is 1 and we should
>> not swap all active->held. So we cannot save this pull in private
>> chat. ---
>>  drivers/hfpmodem/voicecall.c |   50
>> +++++------------------------------------
>>  1 files changed, 6 insertions(+), 44 deletions(-)
> 
> patch is corrupted. Please send again or better even use git
> send-email for sending it. 

Thanks Marcel. Patch has been attached. The evolution wrapped the line
that over 80 characters so the patch is corrupted. I will try to use git 
send-email next time.

> Regards
> 
> Marcel
> 
> 
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono


Regards,
Zhenhua


[-- Attachment #2: 0001-Fix-Poll-CLCC-to-replace-the-code-in-call_held-1.patch --]
[-- Type: application/octet-stream, Size: 3190 bytes --]

From 6d2709a89cb6a4dccf0bc759a38e09511390b78c Mon Sep 17 00:00:00 2001
From: Zhenhua Zhang <zhenhua.zhang@intel.com>
Date: Wed, 18 Nov 2009 14:55:15 +0800
Subject: [PATCH] Fix: Poll CLCC to replace the code in call_held=1

When using CHLD=2x in multiparty call, call_held is 1 and we
should not swap all active->held. So we cannot save this pull
in private chat.
---
 drivers/hfpmodem/voicecall.c |   50 +++++------------------------------------
 1 files changed, 6 insertions(+), 44 deletions(-)

diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index 3591b74..52cdfd7 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -60,7 +60,6 @@ struct voicecall_data {
 	int cind_val[HFP_INDICATOR_LAST];
 	unsigned int id_list;
 	unsigned int local_release;
-	ofono_bool_t ignore_callheld_1;
 };
 
 struct release_id_req {
@@ -322,8 +321,6 @@ static void atd_cb(gboolean ok, GAtResult *result, gpointer user_data)
 
 		call->status = CALL_STATUS_HELD;
 		ofono_voicecall_notify(vc, call);
-
-		vd->ignore_callheld_1 = TRUE;
 	}
 
 	call = create_call(vd, 0, 0, CALL_STATUS_DIALING, NULL, type, validity);
@@ -839,15 +836,6 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc,
 	struct ofono_call *call;
 	unsigned int callheld = vd->cind_val[HFP_INDICATOR_CALLHELD];
 
-	/* When ATD is sent when another call is active, we will receive
-	 * callheld=1, then callsetup=2.  We have already placed active
-	 * calls on hold in atd_cb, so ignore the callheld in this case
-	 */
-	if (vd->ignore_callheld_1 == TRUE && value == 1) {
-		vd->ignore_callheld_1 = FALSE;
-		goto out;
-	}
-
 	switch (value) {
 	case 0:
 		/* We have to poll here, we have no idea whether the call was
@@ -859,38 +847,13 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc,
 		break;
 
 	case 1:
-	{
-		GSList *waiting;
-
-		waiting = g_slist_find_custom(vd->calls,
-					GINT_TO_POINTER(CALL_STATUS_WAITING),
-					at_util_call_compare_by_status);
-
-		for (l = vd->calls; l; l = l->next) {
-			call = l->data;
-
-			if (waiting) {
-				if (call->status == CALL_STATUS_WAITING) {
-					call->status = CALL_STATUS_ACTIVE;
-					ofono_voicecall_notify(vc, call);
-				} else if (call->status == CALL_STATUS_ACTIVE) {
-					call->status = CALL_STATUS_HELD;
-					ofono_voicecall_notify(vc, call);
-				}
-			} else {
-				if (call->status == CALL_STATUS_ACTIVE) {
-					call->status = CALL_STATUS_HELD;
-					ofono_voicecall_notify(vc, call);
-				} else if (call->status == CALL_STATUS_HELD) {
-					call->status = CALL_STATUS_ACTIVE;
-					ofono_voicecall_notify(vc, call);
-				}
-			}
-		}
-
+		/* We have to poll here, we have no idea whether the call was
+		 * accepted by CHLD=1 or swapped by CHLD=2 or one call was
+		 * chosed for private chat by CHLD=2x
+		 */
+		g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
+				clcc_poll_cb, vc, NULL);
 		break;
-	}
-
 	case 2:
 		if (callheld == 0) {
 			for (l = vd->calls; l; l = l->next) {
@@ -907,7 +870,6 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc,
 			release_with_status(vc, CALL_STATUS_ACTIVE);
 	}
 
-out:
 	vd->cind_val[HFP_INDICATOR_CALLHELD] = value;
 }
 
-- 
1.6.2.5


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

* RE: [PATCH] Fix: Poll CLCC to replace the code in call_held=1
  2009-11-20  1:52   ` Zhang, Zhenhua
@ 2009-11-20  8:38     ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2009-11-20  8:38 UTC (permalink / raw)
  To: ofono

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

Hi Zhenhua,

> >> When using CHLD=2x in multiparty call, call_held is 1 and we should
> >> not swap all active->held. So we cannot save this pull in private
> >> chat. ---
> >>  drivers/hfpmodem/voicecall.c |   50
> >> +++++------------------------------------
> >>  1 files changed, 6 insertions(+), 44 deletions(-)
> > 
> > patch is corrupted. Please send again or better even use git
> > send-email for sending it. 
> 
> Thanks Marcel. Patch has been attached. The evolution wrapped the line
> that over 80 characters so the patch is corrupted. I will try to use git 
> send-email next time.

patch has been applied. Thanks.

Regards

Marcel



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

end of thread, other threads:[~2009-11-20  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-19  3:21 [PATCH] Fix: Poll CLCC to replace the code in call_held=1 Zhenhua Zhang
2009-11-19  6:39 ` Marcel Holtmann
2009-11-20  1:52   ` Zhang, Zhenhua
2009-11-20  8:38     ` Marcel Holtmann

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.