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.)
This commit is contained in:
Denis Kenzior 2012-02-23 23:14:08 -06:00
parent fb43a32743
commit 876fb9e1b4
1 changed files with 6 additions and 0 deletions

View File

@ -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;