From fb625041601c525c23c96482250157dddb0941a4 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 19 May 2019 02:00:31 +0700 Subject: [PATCH] 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 --- ggsn/ggsn_vty.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 #include #include +#include #include #include @@ -736,9 +737,14 @@ static void show_one_pdp(struct vty *vty, struct pdp_t *pdp) 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);