From 25d51ba03bdedd34fd166d126cb2f768826e6cd5 Mon Sep 17 00:00:00 2001 From: Philippe Nunes Date: Thu, 6 Sep 2012 16:21:46 +0200 Subject: [PATCH] ussd: Recover idle state after a transaction error The "USSD terminated by network" notification is handled to recover the idle state in case of USSD transaction error. --- src/ussd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ussd.c b/src/ussd.c index 74888b2..bc8e0f6 100644 --- a/src/ussd.c +++ b/src/ussd.c @@ -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); -- 2.7.4