From 876fb9e1b469ee15332a4e74ceb130bd75a6cc6c Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 23 Feb 2012 23:14:08 -0600 Subject: [PATCH] atutil: Ignore invalid CLCC results Some phones report CLCC calls with out-of-range info. E.g. call index being 0 (it is 1 based according to 27.007) and call states being reported as '6' (valid call states are 0-5.) --- drivers/atmodem/atutil.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index b82ed20c..0c6aab46 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -131,12 +131,18 @@ GSList *at_util_parse_clcc(GAtResult *result) if (!g_at_result_iter_next_number(&iter, &id)) continue; + if (id == 0) + continue; + if (!g_at_result_iter_next_number(&iter, &dir)) continue; if (!g_at_result_iter_next_number(&iter, &status)) continue; + if (status > 5) + continue; + if (!g_at_result_iter_next_number(&iter, &type)) continue;