aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_80.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-27 18:27:46 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-27 18:27:46 +0800
commite731e1d6dd4a8371ca2d9f8142b9afaeedd012a4 (patch)
tree2dfbd474fa714a5aa2088c065b7fe344f7a4c64d /openbsc/src/gsm_04_80.c
parent44d0f197873a9d79b89c524612f20d2e63ab28c9 (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.
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 4173aded6..a7c8bd7bc 100644
--- a/openbsc/src/gsm_04_80.c
+++ b/openbsc/src/gsm_04_80.c
@@ -314,7 +314,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;
@@ -343,7 +343,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;
@@ -456,12 +462,12 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
return gsm0808_submit_dtap(conn, msg, 0);
}
-int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, const char *text)
+int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, 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;