summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorJeevaka Badrappan <jeevaka.badrappan@linux.intel.com>2011-07-25 11:15:26 -0700
committerDenis Kenzior <denkenz@gmail.com>2011-07-25 21:43:04 -0500
commit14b003c7d98132bd3c1c9a7334efb1791ed4b3ee (patch)
treee1cd3f0a5df3121a3ceba4b5c4780e9d371a53a2 /src/voicecall.c
parent73b711551c11a83e4de6d4f28400c5286216a7cc (diff)
downloadofono-14b003c7d98132bd3c1c9a7334efb1791ed4b3ee.tar.bz2
voicecall: api for set/clear alpha and icon id
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index f4c2358b..14b5d228 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -42,6 +42,7 @@
#define MAX_VOICE_CALLS 16
#define VOICECALL_FLAG_SIM_ECC_READY 0x1
+#define VOICECALL_FLAG_STK_MODEM_CALLSETUP 0x2
#define SETTINGS_STORE "voicecall"
#define SETTINGS_GROUP "Settings"
@@ -2223,6 +2224,39 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
goto error;
}
+ if (vc->flags & VOICECALL_FLAG_STK_MODEM_CALLSETUP) {
+ struct dial_request *req = vc->dial_req;
+ const char *number = phone_number_to_string(&req->ph);
+
+ if (!strcmp(number, "112")) {
+ struct ofono_modem *modem =
+ __ofono_atom_get_modem(vc->atom);
+
+ __ofono_modem_inc_emergency_mode(modem);
+ }
+
+ if (v->call->clip_validity == CLIP_VALIDITY_NOT_AVAILABLE) {
+ v->call->phone_number.type = req->ph.type;
+ strncpy(v->call->phone_number.number, req->ph.number,
+ 20);
+ v->call->clip_validity = CLIP_VALIDITY_VALID;
+ }
+
+ v->message = req->message;
+ v->icon_id = req->icon_id;
+
+ req->message = NULL;
+ req->call = v;
+
+ /*
+ * TS 102 223 Section 6.4.13: The terminal shall not store
+ * in the UICC the call set-up details (called party number
+ * and associated parameters)
+ */
+ v->untracked = TRUE;
+ vc->flags &= ~VOICECALL_FLAG_STK_MODEM_CALLSETUP;
+ }
+
v->detect_time = time(NULL);
if (!voicecall_dbus_register(v)) {
@@ -3682,6 +3716,37 @@ void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id)
}
}
+void __ofono_voicecall_set_alpha_and_icon_id(struct ofono_voicecall *vc,
+ const char *addr, int addr_type,
+ const char *message,
+ unsigned char icon_id)
+{
+ struct dial_request *req;
+
+ req = g_new0(struct dial_request, 1);
+
+ req->message = g_strdup(message);
+ req->icon_id = icon_id;
+
+ req->ph.type = addr_type;
+ strncpy(req->ph.number, addr, 20);
+
+ vc->dial_req = req;
+
+ vc->flags |= VOICECALL_FLAG_STK_MODEM_CALLSETUP;
+}
+
+void __ofono_voicecall_clear_alpha_and_icon_id(struct ofono_voicecall *vc)
+{
+ g_free(vc->dial_req->message);
+ vc->dial_req->message = NULL;
+
+ g_free(vc->dial_req);
+ vc->dial_req = NULL;
+
+ vc->flags &= ~VOICECALL_FLAG_STK_MODEM_CALLSETUP;
+}
+
static void ssn_mt_forwarded_notify(struct ofono_voicecall *vc,
unsigned int id, int code,
const struct ofono_phone_number *ph)