aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2021-07-05 15:41:05 +0200
committerOliver Smith <osmith@sysmocom.de>2021-08-06 22:25:10 +0200
commitab39b622cc35d95e4a60e3d8c4043b0f79a30e15 (patch)
tree42a6deb4c48642be1cc7a569115f1a7b2eb5b706
parent3aba7ad2ae28d7a000c0808f1332ba716d1c6708 (diff)
vty: add "page imsi"
Make it easy to manually test pagings from SGSN to the PCU. Related: SYS#4878 Change-Id: I8a73caa234f6b841e641be866e22e7fa03152eb7
-rw-r--r--src/sgsn/sgsn_vty.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 30bd864ee..e0e26775e 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -35,6 +35,7 @@
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/gprs/gprs_ns2.h>
+#include <osmocom/sgsn/gprs_gb.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_sgsn.h>
#include <osmocom/sgsn/gtp_mme.h>
@@ -1209,6 +1210,25 @@ DEFUN(update_subscr_update_auth_info, update_subscr_update_auth_info_cmd,
return CMD_SUCCESS;
}
+DEFUN(page_subscr, page_subscr_info_cmd,
+ "page imsi IMSI",
+ "Send a PS paging request to subscriber\n"
+ "Use the IMSI to select the subscriber\n"
+ "The IMSI\n")
+{
+ const char *imsi = argv[0];
+ struct sgsn_mm_ctx *mm;
+
+ mm = sgsn_mm_ctx_by_imsi(imsi);
+ if (!mm) {
+ vty_out(vty, "No MM context for IMSI %s%s", imsi, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ gprs_gb_page_ps_ra(mm);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_gsup_ipa_name,
cfg_gsup_ipa_name_cmd,
"gsup ipa-name NAME",
@@ -1675,6 +1695,7 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(ENABLE_NODE, &update_subscr_cancel_cmd);
install_element(ENABLE_NODE, &update_subscr_update_location_result_cmd);
install_element(ENABLE_NODE, &update_subscr_update_auth_info_cmd);
+ install_element(ENABLE_NODE, &page_subscr_info_cmd);
install_element(ENABLE_NODE, &reset_sgsn_state_cmd);
install_element(CONFIG_NODE, &cfg_sgsn_cmd);