There needs to be a way to distinguish between no alphaid and "empty
data object" because on some occasions they have different meanings. In
the Call Control envelope, no Alpha Identifier means the terminal can
inform the user about the call being modified by SIM while empty data
object means no hint should be given.
---
src/stkutil.c | 4 +++-
unit/test-stkutil.c | 18 +++++++++++++-----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 003d96e..7bbd1c9 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -296,8 +296,10 @@ static gboolean parse_dataobj_alpha_id(struct comprehension_tlv_iter
*iter,
char *utf8;
len = comprehension_tlv_iter_get_length(iter);
- if (len == 0)
+ if (len == 0) {
+ *alpha_id = g_try_malloc0(1);
return TRUE;
+ }
data = comprehension_tlv_iter_get_data(iter);
utf8 = sim_string_to_utf8(data, len);
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 7505938..06d40a3 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -4920,7 +4920,8 @@ static struct setup_menu_test setup_menu_data_112 = {
static struct setup_menu_test setup_menu_data_113 = {
.pdu = setup_menu_113,
.pdu_len = sizeof(setup_menu_113),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = "",
};
static struct setup_menu_test setup_menu_data_121 = {
@@ -5388,7 +5389,8 @@ static struct setup_menu_test setup_menu_data_712 = {
static struct setup_menu_test setup_menu_data_713 = {
.pdu = setup_menu_713,
.pdu_len = sizeof(setup_menu_713),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = ""
};
static struct setup_menu_test setup_menu_data_811 = {
@@ -5418,7 +5420,8 @@ static struct setup_menu_test setup_menu_data_812 = {
static struct setup_menu_test setup_menu_data_813 = {
.pdu = setup_menu_813,
.pdu_len = sizeof(setup_menu_813),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = ""
};
static struct setup_menu_test setup_menu_data_911 = {
@@ -5448,7 +5451,8 @@ static struct setup_menu_test setup_menu_data_912 = {
static struct setup_menu_test setup_menu_data_913 = {
.pdu = setup_menu_913,
.pdu_len = sizeof(setup_menu_913),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = "",
};
/* Defined in TS 102.384 Section 27.22.4.7 */
@@ -7827,6 +7831,7 @@ static struct send_sms_test send_sms_data_171 = {
.pdu = send_sms_171,
.pdu_len = sizeof(send_sms_171),
.qualifier = 0x00,
+ .alpha_id = "",
.address = {
.ton_npi = 0x91,
.number = "112233445566778"
@@ -12108,6 +12113,7 @@ static struct run_at_command_test run_at_command_data_121 = {
.pdu = run_at_command_121,
.pdu_len = sizeof(run_at_command_121),
.qualifier = 0x00,
+ .alpha_id = "",
.at_command = "AT+CGMI"
};
@@ -12805,6 +12811,7 @@ static struct send_dtmf_test send_dtmf_data_131 = {
.pdu = send_dtmf_131,
.pdu_len = sizeof(send_dtmf_131),
.qualifier = 0x00,
+ .alpha_id = "",
.dtmf = "1cccccccccc2"
};
@@ -13523,7 +13530,8 @@ static struct launch_browser_test launch_browser_data_121 = {
.pdu = launch_browser_121,
.pdu_len = sizeof(launch_browser_121),
.qualifier = 0x00,
- .url = "http://xxx.yyy.zzz"
+ .url = "http://xxx.yyy.zzz",
+ .alpha_id = "",
};
static struct launch_browser_test launch_browser_data_131 = {
--
1.7.1.86.g0e460.dirty