osmith has uploaded this change for review. ( https://gerrit.osmocom.org/12527


Change subject: VTY: integrate IMEI
......................................................................

VTY: integrate IMEI

Display the IMEI in "show subscriber", and allow showing subscribers by
their IMEI with: "show subscriber imei ..."

Related: OS#2541
Change-Id: I1af7b573ca2a1cb22497052665012d9c1acf3b30
---
M src/hlr_vty_subscr.c
1 file changed, 7 insertions(+), 2 deletions(-)



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

diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c
index 92cfa2a..ba22e78 100644
--- a/src/hlr_vty_subscr.c
+++ b/src/hlr_vty_subscr.c
@@ -58,6 +58,8 @@

        vty_out(vty, "    IMSI: %s%s", *subscr->imsi ? subscr->imsi : "none", 
VTY_NEWLINE);
        vty_out(vty, "    MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : 
"none", VTY_NEWLINE);
+       if (*subscr->imei)
+               vty_out(vty, "    IMEI: %s%s", subscr->imei, VTY_NEWLINE);
        if (*subscr->vlr_number)
                vty_out(vty, "    VLR number: %s%s", subscr->vlr_number, 
VTY_NEWLINE);
        if (*subscr->sgsn_number)
@@ -138,6 +140,8 @@
                rc = db_subscr_get_by_msisdn(g_hlr->dbc, id, subscr);
        else if (strcmp(type, "id") == 0)
                rc = db_subscr_get_by_id(g_hlr->dbc, atoll(id), subscr);
+       else if (strcmp(type, "imei") == 0)
+               rc = db_subscr_get_by_imei(g_hlr->dbc, id, subscr);
        if (rc)
                vty_out(vty, "%% No subscriber for %s = '%s'%s",
                        type, id, VTY_NEWLINE);
@@ -147,12 +151,13 @@
 #define SUBSCR_CMD "subscriber "
 #define SUBSCR_CMD_HELP "Subscriber management commands\n"

-#define SUBSCR_ID "(imsi|msisdn|id) IDENT"
+#define SUBSCR_ID "(imsi|msisdn|id|imei) IDENT"
 #define SUBSCR_ID_HELP \
        "Identify subscriber by IMSI\n" \
        "Identify subscriber by MSISDN (phone number)\n" \
        "Identify subscriber by database ID\n" \
-       "IMSI/MSISDN/ID of the subscriber\n"
+       "Identify subscriber by IMEI (14 digits, without 15th check digit)\n" \
+       "IMSI/MSISDN/ID/IMEI of the subscriber\n"

 #define SUBSCR                 SUBSCR_CMD SUBSCR_ID " "
 #define SUBSCR_HELP    SUBSCR_CMD_HELP SUBSCR_ID_HELP

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1af7b573ca2a1cb22497052665012d9c1acf3b30
Gerrit-Change-Number: 12527
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to