summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-02-09 22:34:02 -0600
committerDenis Kenzior <denkenz@gmail.com>2012-02-09 22:34:02 -0600
commit7e42c5bbb038fdeaf479c426040519c6a96b134c (patch)
tree06b56cba83fd44a15382f52941159016ed7b89a8
parente2fe4e494026be0b6cf3ea0f8b1c3c7b96efde65 (diff)
downloadofono-7e42c5bbb038fdeaf479c426040519c6a96b134c.tar.bz2
ifx: Modify XLEMA behavior
XLEMA reports emergency numbers that are hardcoded (e.g. 112 and 911) and that are already read from EFecc. The additional emergency numbers we are interested in should only come from the NVM or the network NITZ update.
-rw-r--r--drivers/ifxmodem/voicecall.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 5ede91c0..a2612134 100644
--- a/drivers/ifxmodem/voicecall.c
+++ b/drivers/ifxmodem/voicecall.c
@@ -811,6 +811,18 @@ static void xlema_notify(GAtResult *result, gpointer user_data)
if (!g_at_result_iter_next_string(&iter, &number))
return;
+ /* Skip category */
+ if (g_at_result_iter_skip_next(&iter) == FALSE)
+ goto done;
+
+ /* Skip presence */
+ if (g_at_result_iter_skip_next(&iter) == FALSE)
+ goto done;
+
+ /* If we succeed here, then the number is from NVM or NITZ */
+ if (g_at_result_iter_skip_next(&iter) == FALSE)
+ goto done;
+
if (vd->en_list == NULL)
vd->en_list = g_new0(char *, total_cnt + 1);
@@ -821,13 +833,16 @@ static void xlema_notify(GAtResult *result, gpointer user_data)
} else
vd->en_list[count] = g_strdup(number);
+done:
if (index != total_cnt)
return;
- ofono_voicecall_en_list_notify(vc, vd->en_list);
+ if (vd->en_list) {
+ ofono_voicecall_en_list_notify(vc, vd->en_list);
- g_strfreev(vd->en_list);
- vd->en_list = NULL;
+ g_strfreev(vd->en_list);
+ vd->en_list = NULL;
+ }
}
static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data)