ussd: Recover idle state after a transaction error
authorPhilippe Nunes <philippe.nunes@linux.intel.com>
Thu, 6 Sep 2012 14:21:46 +0000 (16:21 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 12 Sep 2012 03:33:43 +0000 (22:33 -0500)
The "USSD terminated by network" notification is handled to recover
the idle state in case of USSD transaction error.

src/ussd.c

index 74888b2..bc8e0f6 100644 (file)
@@ -414,6 +414,16 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
                return;
        }
 
+       if (status == OFONO_USSD_STATUS_TERMINATED) {
+               ussd_change_state(ussd, USSD_STATE_IDLE);
+
+               if (ussd->pending == NULL)
+                       return;
+
+               reply = __ofono_error_network_terminated(ussd->pending);
+               goto out;
+       }
+
        if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
                ussd_change_state(ussd, USSD_STATE_IDLE);