vty: make retrieve-imeisv-early configurable

Prepare for Rhizomatica's subscriber on demand use case, in which the
network access is disabled by default for new subscribers, but the IMEI
is required in the HLR to find out which user has which IMSI. Due to the
network access being disabled, the location update request towards the
HLR fails and the MS gets rejected, so we need to get the IMEI early.

Related: OS#2542, OS#3755
Change-Id: I256224194c3b8caf2b58a88d11dccd32c569201f
This commit is contained in:
Oliver Smith 2019-05-02 10:40:50 +02:00 committed by osmith
parent d24c46a38b
commit 03ded913ad
2 changed files with 21 additions and 7 deletions

View File

@ -455,13 +455,24 @@ DEFUN(cfg_msc_auth_tuple_reuse_on_error, cfg_msc_auth_tuple_reuse_on_error_cmd,
}
DEFUN(cfg_msc_check_imei_rqd, cfg_msc_check_imei_rqd_cmd,
"check-imei-rqd (0|1)",
"check-imei-rqd (0|1|early)",
"Send each IMEI to the EIR to ask if it is permitted or not. The EIR is implemented as part of OsmoHLR, "
"and can optionally save the IMEI in the HLR.\n"
"Do not send IMEIs to the EIR\n"
"Send each IMEI to the EIR\n")
"Send each IMEI to the EIR\n"
"Send each IMEI to the EIR, and do it at the start of the location update. This allows the EIR to receive the"
" IMEI, even if the MS would get rejected when the MSC sends the location update request to the HLR.\n")
{
gsmnet->vlr->cfg.check_imei_rqd = atoi(argv[0]) ? true : false;
if (strcmp(argv[0], "0") == 0) {
gsmnet->vlr->cfg.check_imei_rqd = false;
gsmnet->vlr->cfg.retrieve_imeisv_early = false;
} else if (strcmp(argv[0], "1") == 0) {
gsmnet->vlr->cfg.check_imei_rqd = true;
gsmnet->vlr->cfg.retrieve_imeisv_early = false;
} else if (strcmp(argv[0], "early") == 0) {
gsmnet->vlr->cfg.check_imei_rqd = true;
gsmnet->vlr->cfg.retrieve_imeisv_early = true;
}
return CMD_SUCCESS;
}
@ -581,9 +592,12 @@ static int config_write_msc(struct vty *vty)
vty_out(vty, " auth-tuple-reuse-on-error 1%s",
VTY_NEWLINE);
if (gsmnet->vlr->cfg.check_imei_rqd)
vty_out(vty, " check-imei-rqd 1 %s",
VTY_NEWLINE);
if (gsmnet->vlr->cfg.check_imei_rqd) {
if (gsmnet->vlr->cfg.retrieve_imeisv_early)
vty_out(vty, " check-imei-rqd early%s", VTY_NEWLINE);
else
vty_out(vty, " check-imei-rqd 1%s", VTY_NEWLINE);
}
if (gsmnet->paging_response_timer != MSC_PAGING_RESPONSE_TIMER_DEFAULT)
vty_out(vty, " paging response-timer %u%s", gsmnet->paging_response_timer, VTY_NEWLINE);

View File

@ -38,7 +38,7 @@ OsmoMSC(config-msc)# list
no assign-tmsi
auth-tuple-max-reuse-count <-1-2147483647>
auth-tuple-reuse-on-error (0|1)
check-imei-rqd (0|1)
check-imei-rqd (0|1|early)
cs7-instance-a <0-15>
cs7-instance-iu <0-15>
paging response-timer (default|<1-65535>)