Change in osmo-msc[master]: libmsc/gsm_04_80.c: HACK: reimplement GSM 04.08 RELEASE COMPLETE

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Nov 28 19:20:38 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11991


Change subject: libmsc/gsm_04_80.c: HACK: reimplement GSM 04.08 RELEASE COMPLETE
......................................................................

libmsc/gsm_04_80.c: HACK: reimplement GSM 04.08 RELEASE COMPLETE

The previous implementation of msc_send_ussd_release_complete()
was based on libosmogsm's GSM 04.80 API, which doesn't allow to
specify GSM 04.08 transaction identifier.

Ideally, we need to deprecate the old GSM 04.80 API and introduce
a proper implementation, but it would require much more efforts.
So, let's avoid using the libosmogsm's API for now.

Change-Id: I89727354385b40e18732e8fd1d6c93f4463ade37
---
M include/osmocom/msc/gsm_04_80.h
M src/libmsc/gsm_04_80.c
M src/libmsc/msc_vty.c
3 files changed, 21 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/91/11991/1

diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h
index c448c91..b68655e 100644
--- a/include/osmocom/msc/gsm_04_80.h
+++ b/include/osmocom/msc/gsm_04_80.h
@@ -10,4 +10,5 @@
 
 int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
 			 const char *text);
-int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn);
+int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn,
+				   uint8_t transaction_id);
diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c
index 81f2001..602d900 100644
--- a/src/libmsc/gsm_04_80.c
+++ b/src/libmsc/gsm_04_80.c
@@ -4,6 +4,7 @@
 /* (C) 2008-2009 by Harald Welte <laforge at gnumonks.org>
  * (C) 2008, 2009, 2010 by Holger Hans Peter Freyther <zecke at selfish.org>
  * (C) 2009 by Mike Haben <michael.haben at btinternet.com>
+ * (C) 2018 by Vadim Yanitskiy <axilirator at gmail.com>
  *
  * All Rights Reserved
  *
@@ -78,10 +79,21 @@
 	return msc_tx_dtap(conn, msg);
 }
 
-int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn)
+int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn,
+				   uint8_t transaction_id)
 {
-	struct msgb *msg = gsm0480_create_ussd_release_complete();
+	struct gsm48_hdr *gh;
+	struct msgb *msg;
+
+	msg = gsm0480_msgb_alloc_name("TS 04.80 SS/USSD REL COMPL");
 	if (!msg)
 		return -1;
+
+	/* Push the L3 header */
+	gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh));
+	gh->proto_discr  = GSM48_PDISC_NC_SS;
+	gh->proto_discr |= transaction_id << 4;
+	gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
+
 	return msc_tx_dtap(conn, msg);
 }
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index cdf3184..245a227 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -1029,8 +1029,12 @@
 		return CMD_WARNING;
 	}
 
+	/* NOTE: we don't allocate transaction here
+	 * so we don't know GSM 04.08 transaction ID.
+	 * NOTE: buggy libosmogsm's GSM 04.80 API
+	 * hard-codes both TID and direction to 0. */
 	msc_send_ussd_notify(conn, level, text);
-	msc_send_ussd_release_complete(conn);
+	msc_send_ussd_release_complete(conn, 0);
 
 	vlr_subscr_put(vsub);
 	talloc_free(text);

-- 
To view, visit https://gerrit.osmocom.org/11991
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I89727354385b40e18732e8fd1d6c93f4463ade37
Gerrit-Change-Number: 11991
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181128/8bb48acc/attachment.htm>


More information about the gerrit-log mailing list