isimodem: fix issue with user busy release
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>
Fri, 21 Jan 2011 08:24:30 +0000 (10:24 +0200)
committerAki Niemi <aki.niemi@nokia.com>
Fri, 21 Jan 2011 13:18:40 +0000 (15:18 +0200)
when the user rejects the incoming call, hangup_active
will get called on the driver side whereas when the user
rejects the waiting call, set_udub will get called on the
driver side.

drivers/isimodem/voicecall.c

index e5842aa..9aa9454 100644 (file)
@@ -973,6 +973,7 @@ static void isi_hangup_current(struct ofono_voicecall *ovc,
         */
        struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
        int id = 0;
+       uint8_t cause = CALL_CAUSE_RELEASE_BY_USER;
 
        for (id = 1; id <= 7; id++) {
                if (ivc->calls[id].call_id & CALL_ID_WAITING)
@@ -983,19 +984,23 @@ static void isi_hangup_current(struct ofono_voicecall *ovc,
                switch (ivc->calls[id].status) {
                case CALL_STATUS_CREATE:
                case CALL_STATUS_COMING:
-               case CALL_STATUS_PROCEEDING:
                case CALL_STATUS_MO_ALERTING:
-               case CALL_STATUS_MT_ALERTING:
                case CALL_STATUS_ANSWERED:
                        goto release_by_id;
+               case CALL_STATUS_MT_ALERTING:
+                       cause = CALL_CAUSE_BUSY_USER_REQUEST;
+                       goto release_by_id;
+               case CALL_STATUS_PROCEEDING:
+                       if (ivc->calls[id].mode_info & CALL_MODE_ORIGINATOR)
+                               cause = CALL_CAUSE_BUSY_USER_REQUEST;
+                       goto release_by_id;
                }
        }
 
        id = CALL_ID_ACTIVE;
 
 release_by_id:
-       isi_call_release_req(ovc, id, CALL_CAUSE_TYPE_CLIENT,
-                               CALL_CAUSE_RELEASE_BY_USER, cb, data);
+       isi_call_release_req(ovc, id, CALL_CAUSE_TYPE_CLIENT, cause, cb, data);
 }
 
 static void isi_release_all_held(struct ofono_voicecall *ovc,