diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-04 15:29:56 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-04 15:34:18 +0100 |
commit | e4baf402cb457ad46642cec9271b762a394a59ea (patch) | |
tree | e390eab0c4bb81fd6728af306b3432ef08da91a5 /openbsc/src/libbsc/gsm_04_80_utils.c | |
parent | 53d782fc38c1c609cb5986fc07980651d3ed8916 (diff) |
move two gsm0480_send_*() to xsc as gsm0480_gen_*()
Have two separate gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete()
for each of libbsc and libmsc. Move their core into libxsc as generator
functions returning a msgb.
Add src/libbsc/gsm_04_80_utils.c (note, not 04_08) to implement the libbsc
side of it.
The code is identical, but the linked structs and functions differ in each
case. There could be a common source file built for both, but I decided against
it, for more clarity I hope.
Diffstat (limited to 'openbsc/src/libbsc/gsm_04_80_utils.c')
-rw-r--r-- | openbsc/src/libbsc/gsm_04_80_utils.c | 39 |
1 files changed, 39 insertions, 0 deletions
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..ddd8caf7d --- /dev/null +++ b/openbsc/src/libbsc/gsm_04_80_utils.c @@ -0,0 +1,39 @@ +/* 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 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 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); +} |