Change in osmo-ggsn[master]: osmo-ggsn: properly show subscriber's MSISDN in the VTY

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
Sat May 18 19:02:04 UTC 2019


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


Change subject: osmo-ggsn: properly show subscriber's MSISDN in the VTY
......................................................................

osmo-ggsn: properly show subscriber's MSISDN in the VTY

Instead of printing subscriber's MSISDN as a hex-string, let's
attempt to decode it using gsm48_decode_bcd_number2().

Change-Id: I3f3a105dc8d0d582f2b9d8e1ff6c5785369e569b
---
M ggsn/ggsn_vty.c
1 file changed, 7 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/81/14081/1

diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c
index 214e2fa..c6dc0d9 100644
--- a/ggsn/ggsn_vty.c
+++ b/ggsn/ggsn_vty.c
@@ -27,6 +27,7 @@
 #include <osmocom/core/utils.h>
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/gsm/apn.h>
+#include <osmocom/gsm/gsm48_ie.h>
 #include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
 
 #include <osmocom/vty/command.h>
@@ -736,9 +737,14 @@
 	struct in46_addr eua46;
 	char name_buf[256];
 	char *apn_name;
+	int rc;
+
+	/* Attempt to decode MSISDN */
+	rc = gsm48_decode_bcd_number2(name_buf, sizeof(name_buf),
+				      pdp->msisdn.v, pdp->msisdn.l, 0);
 
 	vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", imsi_gtp2str(&pdp->imsi), pdp->nsapi,
-		osmo_hexdump_nospc(pdp->msisdn.v, pdp->msisdn.l), VTY_NEWLINE);
+		rc ? "(NONE)" : name_buf, VTY_NEWLINE);
 
 	vty_out(vty, " Control: %s:%08x ", print_gsnaddr(&pdp->gsnlc), pdp->teic_own);
 	vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnrc), pdp->teic_gn, VTY_NEWLINE);

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

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f3a105dc8d0d582f2b9d8e1ff6c5785369e569b
Gerrit-Change-Number: 14081
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/20190518/18d50d79/attachment.htm>


More information about the gerrit-log mailing list