This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged.
Change subject: gsm0480: add gsm0480_create_ussd_notify() and *_release_complete()
......................................................................
gsm0480: add gsm0480_create_ussd_notify() and *_release_complete()
Add two functions to create USSD messages. Moves and generalizes code from
openbsc. Pending: use the new functions in openbsc.
It looks like _release_complete() should also set trans_id and direction flag;
but since this is moving code from openbsc that is apparently working, just
place a fixme comment and don't change the functionality.
Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0
---
M include/osmocom/gsm/gsm0480.h
M src/gsm/gsm0480.c
M src/gsm/libosmogsm.map
3 files changed, 33 insertions(+), 0 deletions(-)
Approvals:
Neels Hofmeyr: Looks good to me, but someone else must approve
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h
index f49ca6b..6ca23e9 100644
--- a/include/osmocom/gsm/gsm0480.h
+++ b/include/osmocom/gsm/gsm0480.h
@@ -32,6 +32,8 @@
struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text);
struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text);
struct msgb *gsm0480_create_notifySS(const char *text);
+struct msgb *gsm0480_create_ussd_notify(int level, const char *text);
+struct msgb *gsm0480_create_ussd_release_complete(void);
int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id);
int gsm0480_wrap_facility(struct msgb *msg);
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index cab4d01..3c23f6f 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -540,3 +540,32 @@
gh->msg_type = msg_type;
return gh;
}
+
+struct msgb *gsm0480_create_ussd_notify(int level, const char *text)
+{
+ struct msgb *msg;
+
+ msg = gsm0480_create_unstructuredSS_Notify(level, text);
+ if (!msg)
+ return NULL;
+
+ gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0);
+ gsm0480_wrap_facility(msg);
+
+ gsm0480_l3hdr_push(msg, GSM48_PDISC_NC_SS, GSM0480_MTYPE_REGISTER);
+ return msg;
+}
+
+struct msgb *gsm0480_create_ussd_release_complete(void)
+{
+ struct msgb *msg;
+
+ msg = msgb_alloc_headroom(1024, 128, "GSM 04.80 USSD REL COMPL");
+ if (!msg)
+ return NULL;
+
+ /* FIXME: should this set trans_id and TI direction flag? */
+ gsm0480_l3hdr_push(msg, GSM48_PDISC_NC_SS,
+ GSM0480_MTYPE_RELEASE_COMPLETE);
+ return msg;
+}
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index f0baa21..3e7333c 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -63,6 +63,8 @@
gsm0480_create_notifySS;
gsm0480_create_unstructuredSS_Notify;
gsm0480_create_ussd_resp;
+gsm0480_create_ussd_notify;
+gsm0480_create_ussd_release_complete;
gsm0480_decode_ussd_request;
gsm0480_decode_ss_request;
gsm0480_wrap_facility;
--
To view, visit https://gerrit.osmocom.org/1340
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>