[PATCH] osmo-hlr[master]: gsup: send subscriber MSISDN

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Dec 19 12:16:34 UTC 2016


Review at  https://gerrit.osmocom.org/1454

gsup: send subscriber MSISDN

Change-Id: Iace97a1a828b29ce11913a14243bcf80bbae9136
---
M src/hlr.c
1 file changed, 16 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/54/1454/1

diff --git a/src/hlr.c b/src/hlr.c
index d7d97b1..cfb05b6 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -24,6 +24,7 @@
 #include <osmocom/core/logging.h>
 #include <osmocom/core/application.h>
 #include <osmocom/gsm/gsup.h>
+#include <osmocom/gsm/gsm48_ie.h>
 
 #include "db.h"
 #include "logging.h"
@@ -264,6 +265,8 @@
 void lu_op_tx_insert_subscr_data(struct lu_operation *luop)
 {
 	struct osmo_gsup_message gsup;
+	uint8_t msisdn_enc[43]; /* TODO use constant; TS 24.008 10.5.4.7 */
+	int len;
 
 	OSMO_ASSERT(luop->state == LU_S_LU_RECEIVED ||
 		    luop->state == LU_S_CANCEL_ACK_RECEIVED);
@@ -271,8 +274,20 @@
 	memset(&gsup, 0, sizeof(gsup));
 	gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_REQUEST;
 	strncpy(gsup.imsi, luop->subscr.imsi, sizeof(gsup.imsi)-1);
+
+	len = gsm48_encode_bcd_number(msisdn_enc, sizeof(msisdn_enc), 0,
+				      luop->subscr.msisdn);
+	if (len < 1) {
+		LOGP(DMAIN, LOGL_ERROR,
+		     "%s: Error: cannot encode MSISDN '%s'\n",
+		     luop->subscr.imsi, luop->subscr.msisdn);
+		lu_op_tx_error(luop, GMM_CAUSE_PROTO_ERR_UNSPEC);
+		return;
+	}
+	gsup.msisdn_enc = msisdn_enc;
+	gsup.msisdn_enc_len = len;
+
 	/* FIXME: deal with encoding the following data */
-	gsup.msisdn_enc;
 	gsup.hlr_enc;
 
 	if (luop->is_ps) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iace97a1a828b29ce11913a14243bcf80bbae9136
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list