Skip to contentSkip to conversation

isimodem: Improper handling of missed call

PATCH In review Arun Ravindran 2 participants 2 messages May 18, 2011 – May 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isimodem: Improper handling of missed call

---
 drivers/isimodem/voicecall.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
drivers/isimodem/voicecall.c +16 -4
index 333f9b8..6979105 100644
@@ -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;
Signature · 1 line
1.7.1
#1 lore raw

Hi Arun,

2011/5/18 Arun Ravindran <[email protected]>:

Quoted 8 lines

+       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;
+

Extra whitespace here.

Quoted 11 lines

       case CALL_STATUS_ACTIVE:
       case CALL_STATUS_HOLD_INITIATED:
               return 0;

(quoted diff) +0 -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:

Quoted 8 lines

               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;

If the intention is not to report this up, then why set the disconnect reason with isi_call_set_disconnect_reason()? Why not just fold these two case statements together?

Cheers,
Aki