All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] isimodem: Improper handling of missed call
@ 2011-05-18 10:47 Arun Ravindran
  2011-05-19 12:19 ` Aki Niemi
  0 siblings, 1 reply; 7+ messages in thread
From: Arun Ravindran @ 2011-05-18 10:47 UTC (permalink / raw)
  To: ofono

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

---
 drivers/isimodem/voicecall.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 333f9b8..6979105 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -50,6 +50,7 @@ struct isi_call {
 	uint8_t id;
 	uint8_t call_id;
 	uint8_t status;
+	uint8_t prev_status;
 	uint8_t mode;
 	uint8_t mode_info;
 	uint8_t cause_type;
@@ -314,7 +315,7 @@ static void isi_call_status_sb_proc(struct isi_voicecall *ivc,
 
 	if (!g_isi_sb_iter_get_byte(sb, &status, 2))
 		return;
-
+	call->prev_status = call->status;
 	call->status = status;
 }
 
@@ -401,10 +402,16 @@ static int isi_call_status_to_clcc(const struct isi_call *call)
 		return 5;
 
 	case CALL_STATUS_MO_RELEASE:
-	case CALL_STATUS_MT_RELEASE:
-	case CALL_STATUS_TERMINATED:
 		return 6;
 
+	case CALL_STATUS_MT_RELEASE:
+		if ((call->prev_status == CALL_STATUS_MT_ALERTING) ||
+				(call->prev_status == CALL_STATUS_COMING) ||
+				(call->prev_status == CALL_STATUS_WAITING))
+			return 4;
+		else
+			return 6;
+	
 	case CALL_STATUS_ACTIVE:
 	case CALL_STATUS_HOLD_INITIATED:
 		return 0;
@@ -548,9 +555,14 @@ static void isi_call_notify(struct ofono_voicecall *ovc, struct isi_call *call)
 
 	case CALL_STATUS_MO_RELEASE:
 	case CALL_STATUS_MT_RELEASE:
+		isi_call_set_disconect_reason(call):
+		break;
+
 	case CALL_STATUS_TERMINATED:
 		isi_call_set_disconnect_reason(call);
-		break;
+		DBG("State( CALL_STATUS_TERMINATED ) need not be reported to Core");
+		return;
+
 	case CALL_STATUS_ANSWERED:
 		DBG("State need not be reported to Core");
 		return;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] isimodem: Improper handling of missed call
@ 2011-05-23 15:20 Arun Ravindran
  2011-05-30 12:03 ` Aki Niemi
  0 siblings, 1 reply; 7+ messages in thread
From: Arun Ravindran @ 2011-05-23 15:20 UTC (permalink / raw)
  To: ofono

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

---
 drivers/isimodem/voicecall.c |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 333f9b8..c599e39 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -50,6 +50,7 @@ struct isi_call {
 	uint8_t id;
 	uint8_t call_id;
 	uint8_t status;
+	uint8_t prev_status;
 	uint8_t mode;
 	uint8_t mode_info;
 	uint8_t cause_type;
@@ -314,7 +315,7 @@ static void isi_call_status_sb_proc(struct isi_voicecall *ivc,
 
 	if (!g_isi_sb_iter_get_byte(sb, &status, 2))
 		return;
-
+	call->prev_status = call->status;
 	call->status = status;
 }
 
@@ -401,10 +402,16 @@ static int isi_call_status_to_clcc(const struct isi_call *call)
 		return 5;
 
 	case CALL_STATUS_MO_RELEASE:
-	case CALL_STATUS_MT_RELEASE:
-	case CALL_STATUS_TERMINATED:
 		return 6;
 
+	case CALL_STATUS_MT_RELEASE:
+		if ((call->prev_status == CALL_STATUS_MT_ALERTING) ||
+				(call->prev_status == CALL_STATUS_COMING) ||
+				(call->prev_status == CALL_STATUS_WAITING))
+			return 4;
+		else
+			return 6;
+
 	case CALL_STATUS_ACTIVE:
 	case CALL_STATUS_HOLD_INITIATED:
 		return 0;
@@ -548,9 +555,26 @@ static void isi_call_notify(struct ofono_voicecall *ovc, struct isi_call *call)
 
 	case CALL_STATUS_MO_RELEASE:
 	case CALL_STATUS_MT_RELEASE:
-	case CALL_STATUS_TERMINATED:
+		/*
+		* Core requires the call status to be either incoming
+		* or waiting to identify the disconnected call as missed.
+		* The MT RELEASE is not mapped to any state in +CLCC, but
+		* we need the disconnect reason.
+		*/
 		isi_call_set_disconnect_reason(call);
 		break;
+	case CALL_STATUS_TERMINATED:
+		DBG("State( CALL_STATUS_TERMINATED ) need not be reported to Core");
+		/* 
+		* The call terminated is not reported to core as
+		* these intermediate states are not processed in 
+		* the core. We report the call status when it becomes 
+		* idle and TERMINATED is not mapped to +CLCC. The disconnect 
+		* reason is set, so that the call termination cause 
+		* in case of error is available to the core.
+		*/
+		isi_call_set_disconnect_reason(call);
+		return;
 	case CALL_STATUS_ANSWERED:
 		DBG("State need not be reported to Core");
 		return;
-- 
1.7.1


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

end of thread, other threads:[~2011-07-20 13:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-18 10:47 [PATCH] isimodem: Improper handling of missed call Arun Ravindran
2011-05-19 12:19 ` Aki Niemi
  -- strict thread matches above, loose matches on Subject: below --
2011-05-23 15:20 Arun Ravindran
2011-05-30 12:03 ` Aki Niemi
2011-05-30 19:35   ` Arun Ravindran
2011-06-14  8:30     ` Aki Niemi
2011-07-20 13:14       ` Paccou, Nicolas

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.