aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-10 12:50:31 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-11-12 15:48:47 +0100
commit624e2bbb684531c02f549b381f7849b53a64172d (patch)
treeb4681f78bfdbe835f7f79320670cff0ba222f20e /openbsc/src/libbsc
parentb8061adb9253611d09b63fd7f2d4229e893cc910 (diff)
move to libxsc: factor out gen of USSD notify and release complete
Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() functions, since there will be distinct subscriber connection structs. The current functions live in libmsc, so add the same in libbsc in new file gsm_04_80_utils.c. To avoid too much code dup, move the message generation part of gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() to new functions gsm0480_gen_ussdNotify() and gsm0480_gen_releaseComplete(), placed in libxsc. Change-Id: I33a84e3c28576ced91d2ea24103123431f551173
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r--openbsc/src/libbsc/Makefile.am2
-rw-r--r--openbsc/src/libbsc/gsm_04_80_utils.c40
2 files changed, 41 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am
index 8c5381777..18828f940 100644
--- a/openbsc/src/libbsc/Makefile.am
+++ b/openbsc/src/libbsc/Makefile.am
@@ -41,6 +41,7 @@ libbsc_a_SOURCES = \
bsc_api.c \
bsc_msc.c bsc_vty.c \
gsm_04_08_utils.c \
+ gsm_04_80_utils.c \
bsc_init.c \
bts_init.c \
bsc_rf_ctrl.c \
@@ -51,4 +52,3 @@ libbsc_a_SOURCES = \
bsc_dyn_ts.c \
bts_ipaccess_nanobts_omlattr.c \
$(NULL)
-
diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/openbsc/src/libbsc/gsm_04_80_utils.c
new file mode 100644
index 000000000..c96259d66
--- /dev/null
+++ b/openbsc/src/libbsc/gsm_04_80_utils.c
@@ -0,0 +1,40 @@
+/* OpenBSC utility functions for 3GPP TS 04.80 */
+
+/* (C) 2016 by sysmocom s.m.f.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <openbsc/gsm_04_80.h>
+#include <openbsc/bsc_api.h>
+
+int bsc_gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int
+ level, const char *text)
+{
+ struct msgb *msg = gsm0480_gen_ussdNotify(level, text);
+ if (!msg)
+ return -1;
+ return gsm0808_submit_dtap(conn, msg, 0, 0);
+}
+
+int bsc_gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
+{
+ struct msgb *msg = gsm0480_gen_releaseComplete();
+ if (!msg)
+ return -1;
+ return gsm0808_submit_dtap(conn, msg, 0, 0);
+}