From 25d51ba03bdedd34fd166d126cb2f768826e6cd5 Mon Sep 17 00:00:00 2001 From: Philippe Nunes Date: Thu, 6 Sep 2012 16:21:46 +0200 Subject: 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(+) (limited to 'src/ussd.c') diff --git a/src/ussd.c b/src/ussd.c index 74888b2e..bc8e0f60 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); -- cgit v1.2.3