aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_80.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-29 04:18:11 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-29 04:33:42 +0800
commitb5fa05ff416fc7244f6a22b2b0d62890fdea3184 (patch)
tree08d652caa6658be2b02ba2ab8cb1da9c97ba36e1 /openbsc/src/gsm_04_80.c
parent83f94497ce7d8e787667fd182e5a863fd256b316 (diff)
gsm_04_80: Allow to specify the alert pattern for the notification
Allow to specify the level (not the category) of the notification this provides an easy way to test it on the phones. Conflicts: openbsc/src/vty_interface_layer3.c
Diffstat (limited to 'openbsc/src/gsm_04_80.c')
-rw-r--r--openbsc/src/gsm_04_80.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/openbsc/src/gsm_04_80.c b/openbsc/src/gsm_04_80.c
index 999d548a0..e881a8763 100644
--- a/openbsc/src/gsm_04_80.c
+++ b/openbsc/src/gsm_04_80.c
@@ -313,7 +313,7 @@ struct msgb *gsm0480_create_notifySS(const char *text)
return msg;
}
-struct msgb *gsm0480_create_unstructuredSS_Notify(const char *text)
+struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text)
{
struct msgb *msg;
uint8_t *seq_len_ptr, *ussd_len_ptr, *data;
@@ -342,7 +342,13 @@ struct msgb *gsm0480_create_unstructuredSS_Notify(const char *text)
ussd_len_ptr[0] = len;
/* USSD-String } */
- seq_len_ptr[0] = 3 + 2 + ussd_len_ptr[0];
+ /* alertingPattern { */
+ msgb_put_u8(msg, ASN1_OCTET_STRING_TAG);
+ msgb_put_u8(msg, 1);
+ msgb_put_u8(msg, alertPattern);
+ /* } alertingPattern */
+
+ seq_len_ptr[0] = 3 + 2 + ussd_len_ptr[0] + 3;
/* } SEQUENCE */
return msg;
@@ -460,12 +466,12 @@ int gsm0480_send_ussd_reject(const struct msgb *in_msg,
return gsm48_sendmsg(msg, NULL);
}
-int gsm0480_send_ussdNotify(struct gsm_lchan *lchan, const char *text)
+int gsm0480_send_ussdNotify(struct gsm_lchan *lchan, int level, const char *text)
{
struct gsm48_hdr *gh;
struct msgb *msg;
- msg = gsm0480_create_unstructuredSS_Notify(text);
+ msg = gsm0480_create_unstructuredSS_Notify(level, text);
if (!msg)
return -1;