[MERGED] osmo-ttcn3-hacks[master]: GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC

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.org
Sat Jan 27 13:32:56 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC
......................................................................


GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC

OsmoMSC seems to have broken encoding of MSISDN which is not in-line
with the spec.  Let's adapt to it.

Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3
Related: OS#2883
---
M library/GSUP_Types.ttcn
1 file changed, 29 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn
index 7f239ca..4d2c3c5 100644
--- a/library/GSUP_Types.ttcn
+++ b/library/GSUP_Types.ttcn
@@ -80,6 +80,11 @@
 	OSMO_GSUP_CN_DOMAIN_CS			(2)
 } with { variant "FIELDLENGTH(8)" };
 
+type record GSUP_MSISDN {
+	uint8_t	len,
+	hexstring digits optional
+} with { variant (len) "LENGTHTO(digits)" };
+
 type record GSUP_IE {
 	GSUP_IEI	tag,
 	uint8_t		len,
@@ -121,7 +126,7 @@
 	octetstring	ck,
 	octetstring	autn,
 	octetstring	res,
-	hexstring	msisdn,
+	GSUP_MSISDN	msisdn,
 	octetstring	hlr_number,
 	GSUP_CnDomain	cn_domain,
 	octetstring	charg_char
@@ -157,6 +162,27 @@
 		}
 	}
 }
+
+template (value) GSUP_MSISDN ts_GSUP_MSISDN(hexstring digits,
+					    BIT3 ton := '000'B,
+					    BIT4 npi := '0000'B) := {
+	len := 0, /* overwritten */
+	/* numberingPlanIdentification := npi,
+	typeOfNumber := ton,
+	ext1 := '0'B, */
+	digits := digits
+}
+
+template GSUP_MSISDN tr_GSUP_MSISDN(template hexstring digits,
+				    template BIT3 ton := ?,
+				    template BIT4 npi := ?) := {
+	len := ?,
+	/* numberingPlanIdentification := npi,
+	typeOfNumber := ton,
+	ext1 := '0'B, */
+	digits := digits
+}
+
 
 
 template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres,
@@ -273,7 +299,7 @@
 	tag := OSMO_GSUP_MSISDN_IE,
 	len := 0, /* overwritten */
 	val := {
-		msisdn := msisdn
+		msisdn := ts_GSUP_MSISDN(msisdn)
 	}
 }
 
@@ -281,7 +307,7 @@
 	tag := OSMO_GSUP_MSISDN_IE,
 	len := ?,
 	val := {
-		msisdn := msisdn
+		msisdn := tr_GSUP_MSISDN(msisdn)
 	}
 }
 

-- 
To view, visit https://gerrit.osmocom.org/6122
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list