summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-04-04 16:34:56 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-04-04 23:36:49 -0500
commita002db962a7191da88ed8a48d9b25b21906ae373 (patch)
tree4dc59db70417048d1780cc7365261fcbd888f8ea /src/voicecall.c
parent348149ec5a01d7353411fa7cfd7533587829f9b0 (diff)
downloadofono-a002db962a7191da88ed8a48d9b25b21906ae373.tar.bz2
voicecall: Detect emergency calls initiated by STK
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index b9c5505c..469b939d 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2467,14 +2467,20 @@ ofono_bool_t __ofono_voicecall_is_busy(struct ofono_voicecall *vc,
static void dial_request_cb(const struct ofono_error *error, void *data)
{
struct ofono_voicecall *vc = data;
+ const char *number = phone_number_to_string(&vc->dial_req->ph);
gboolean need_to_emit;
struct voicecall *v;
- v = dial_handle_result(vc, error,
- phone_number_to_string(&vc->dial_req->ph),
- &need_to_emit);
+ v = dial_handle_result(vc, error, number, &need_to_emit);
if (v == NULL) {
+ if (is_emergency_number(vc, number) == TRUE) {
+ struct ofono_modem *modem =
+ __ofono_atom_get_modem(vc->atom);
+
+ __ofono_modem_dec_emergency_mode(modem);
+ }
+
dial_request_finish(vc);
return;
}
@@ -2501,6 +2507,14 @@ static void dial_request_cb(const struct ofono_error *error, void *data)
static void dial_request(struct ofono_voicecall *vc)
{
+ const char *number = phone_number_to_string(&vc->dial_req->ph);
+
+ if (is_emergency_number(vc, number) == TRUE) {
+ struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
+
+ __ofono_modem_inc_emergency_mode(modem);
+ }
+
vc->driver->dial(vc, &vc->dial_req->ph, OFONO_CLIR_OPTION_DEFAULT,
dial_request_cb, vc);
}