diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-06-25 11:42:38 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-06-25 11:45:29 -0500 |
commit | 4357f33d2593695f78ae365f5c1ae5e70157b277 (patch) | |
tree | c18bd7efc0faa42c297609f53cbe4fe4eb6ace17 /drivers/atmodem | |
parent | 8f737d86998d9890225873b60b7724583cd0ca27 (diff) | |
download | ofono-4357f33d2593695f78ae365f5c1ae5e70157b277.tar.bz2 |
Number and Number Type are optional in CLCC
According to 27.007, the number and number type are optional. We must
take care not to do anything unexpected in this case.
Diffstat (limited to 'drivers/atmodem')
-rw-r--r-- | drivers/atmodem/voicecall.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c index ef569594..3a2291b5 100644 --- a/drivers/atmodem/voicecall.c +++ b/drivers/atmodem/voicecall.c @@ -184,13 +184,14 @@ static GSList *parse_clcc(GAtResult *result) { GAtResultIter iter; GSList *l = NULL; - int id, dir, status, type, number_type; + int id, dir, status, type; struct ofono_call *call; g_at_result_iter_init(&iter, result); while (g_at_result_iter_next(&iter, "+CLCC:")) { - const char *str; + const char *str = ""; + int number_type = 129; if (!g_at_result_iter_next_number(&iter, &id)) continue; @@ -207,11 +208,8 @@ static GSList *parse_clcc(GAtResult *result) if (!g_at_result_iter_skip_next(&iter)) continue; - if (!g_at_result_iter_next_string(&iter, &str)) - continue; - - if (!g_at_result_iter_next_number(&iter, &number_type)) - continue; + if (g_at_result_iter_next_string(&iter, &str)) + g_at_result_iter_next_number(&iter, &number_type); call = g_try_new0(struct ofono_call, 1); |