summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>2011-04-06 07:26:42 -0700
committerDenis Kenzior <denkenz@gmail.com>2011-04-07 22:18:05 -0500
commit4a835716773e93634a59f24c5dbb744800a4b968 (patch)
treeb017348212014ecf3564d84d62f4454deb31f1b7 /src/voicecall.c
parentf6444d3963f24dc46af7fc09c91c23b6d1b9b787 (diff)
downloadofono-4a835716773e93634a59f24c5dbb744800a4b968.tar.bz2
voicecall: network emergency number list support
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index b0f15fd0..19ef4797 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -49,6 +49,7 @@ struct ofono_voicecall {
GHashTable *en_list; /* emergency number list */
GSList *sim_en_list; /* Emergency numbers being read from SIM */
ofono_bool_t sim_en_list_ready;
+ char **nw_en_list; /* Emergency numbers from modem/network */
DBusMessage *pending;
struct ofono_sim *sim;
struct ofono_sim_context *sim_context;
@@ -2093,6 +2094,10 @@ static void set_new_ecc(struct ofono_voicecall *vc)
vc->en_list = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, NULL);
+ /* Emergency numbers from modem/network */
+ if (vc->nw_en_list)
+ add_to_en_list(vc, vc->nw_en_list);
+
/* Emergency numbers read from SIM */
if (vc->sim_en_list_ready == TRUE && vc->sim_en_list) {
for (l = vc->sim_en_list; l; l = l->next)
@@ -2175,6 +2180,15 @@ check:
set_new_ecc(vc);
}
+void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
+ char **nw_en_list)
+{
+ g_strfreev(vc->nw_en_list);
+
+ vc->nw_en_list = g_strdupv(nw_en_list);
+ set_new_ecc(vc);
+}
+
int ofono_voicecall_driver_register(const struct ofono_voicecall_driver *d)
{
DBG("driver: %p, name: %s", d, d->name);
@@ -2220,6 +2234,11 @@ static void voicecall_unregister(struct ofono_atom *atom)
vc->sim_en_list = NULL;
}
+ if (vc->nw_en_list) {
+ g_strfreev(vc->nw_en_list);
+ vc->nw_en_list = NULL;
+ }
+
g_hash_table_destroy(vc->en_list);
vc->en_list = NULL;