aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-29 04:16:35 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-29 04:29:11 +0800
commit6d2d523e77ef46f2a19095cfa5c726e3681f739c (patch)
tree7018f50076b0dc3c264cbab640702430f721f9af
parentdbd957c8725f8bc48109c6d2b12bc66c2a1d79aa (diff)
gsm_04_80: Add untested code for USSD notification...
One should be able to send a USSD Notification to a given subscriber if we has an active link... Conflicts: openbsc/src/vty_interface_layer3.c
-rw-r--r--openbsc/include/openbsc/gsm_04_80.h2
-rw-r--r--openbsc/src/gsm_04_80.c22
2 files changed, 24 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h
index 7c58c56ef..63262ea18 100644
--- a/openbsc/include/openbsc/gsm_04_80.h
+++ b/openbsc/include/openbsc/gsm_04_80.h
@@ -25,4 +25,6 @@ struct msgb *gsm0480_create_unstructuredSS_Notify(const char *text);
int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id);
int gsm0480_wrap_facility(struct msgb *msg);
+int gsm0480_send_ussdNotify(struct gsm_lchan *lchan, const char *text);
+
#endif
diff --git a/openbsc/src/gsm_04_80.c b/openbsc/src/gsm_04_80.c
index ebae31f87..4273ad6eb 100644
--- a/openbsc/src/gsm_04_80.c
+++ b/openbsc/src/gsm_04_80.c
@@ -453,3 +453,25 @@ 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)
+{
+ struct gsm48_hdr *gh;
+ struct msgb *msg;
+
+ msg = gsm0480_create_unstructuredSS_Notify(text);
+ if (!msg)
+ return -1;
+
+ gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0);
+ gsm0480_wrap_facility(msg);
+
+ msg->lchan = lchan;
+
+ /* And finally pre-pend the L3 header */
+ gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh));
+ gh->proto_discr = GSM48_PDISC_NC_SS;
+ gh->msg_type = GSM0480_MTYPE_REGISTER;
+
+ return gsm48_sendmsg(msg, NULL);
+}