<p>osmith <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/13892">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vty: make retrieve-imeisv-early configurable<br><br>Prepare for Rhizomatica's subscriber on demand use case, in which the<br>network access is disabled by default for new subscribers, but the IMEI<br>is required in the HLR to find out which user has which IMSI. Due to the<br>network access being disabled, the location update request towards the<br>HLR fails and the MS gets rejected, so we need to get the IMEI early.<br><br>Related: OS#2542, OS#3755<br>Change-Id: I256224194c3b8caf2b58a88d11dccd32c569201f<br>---<br>M src/libmsc/msc_vty.c<br>M tests/test_nodes.vty<br>2 files changed, 21 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c</span><br><span>index 2990735..bd369ae 100644</span><br><span>--- a/src/libmsc/msc_vty.c</span><br><span>+++ b/src/libmsc/msc_vty.c</span><br><span>@@ -455,13 +455,24 @@</span><br><span> }</span><br><span> </span><br><span> DEFUN(cfg_msc_check_imei_rqd, cfg_msc_check_imei_rqd_cmd,</span><br><span style="color: hsl(0, 100%, 40%);">-      "check-imei-rqd (0|1)",</span><br><span style="color: hsl(120, 100%, 40%);">+      "check-imei-rqd (0|1|early)",</span><br><span>       "Send each IMEI to the EIR to ask if it is permitted or not. The EIR is implemented as part of OsmoHLR, "</span><br><span>       "and can optionally save the IMEI in the HLR.\n"</span><br><span>       "Do not send IMEIs to the EIR\n"</span><br><span style="color: hsl(0, 100%, 40%);">-      "Send each IMEI to the EIR\n")</span><br><span style="color: hsl(120, 100%, 40%);">+      "Send each IMEI to the EIR\n"</span><br><span style="color: hsl(120, 100%, 40%);">+      "Send each IMEI to the EIR, and do it at the start of the location update. This allows the EIR to receive the"</span><br><span style="color: hsl(120, 100%, 40%);">+      " IMEI, even if the MS would get rejected when the MSC sends the location update request to the HLR.\n")</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-       gsmnet->vlr->cfg.check_imei_rqd = atoi(argv[0]) ? true : false;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (strcmp(argv[0], "0") == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+            gsmnet->vlr->cfg.check_imei_rqd = false;</span><br><span style="color: hsl(120, 100%, 40%);">+                gsmnet->vlr->cfg.retrieve_imeisv_early = false;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (strcmp(argv[0], "1") == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+             gsmnet->vlr->cfg.check_imei_rqd = true;</span><br><span style="color: hsl(120, 100%, 40%);">+         gsmnet->vlr->cfg.retrieve_imeisv_early = false;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (strcmp(argv[0], "early") == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+         gsmnet->vlr->cfg.check_imei_rqd = true;</span><br><span style="color: hsl(120, 100%, 40%);">+         gsmnet->vlr->cfg.retrieve_imeisv_early = true;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span>    return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span>@@ -581,9 +592,12 @@</span><br><span>          vty_out(vty, " auth-tuple-reuse-on-error 1%s",</span><br><span>                     VTY_NEWLINE);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-       if (gsmnet->vlr->cfg.check_imei_rqd)</span><br><span style="color: hsl(0, 100%, 40%);">-              vty_out(vty, " check-imei-rqd 1 %s",</span><br><span style="color: hsl(0, 100%, 40%);">-                  VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (gsmnet->vlr->cfg.check_imei_rqd) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (gsmnet->vlr->cfg.retrieve_imeisv_early)</span><br><span style="color: hsl(120, 100%, 40%);">+                     vty_out(vty, " check-imei-rqd early%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+               else</span><br><span style="color: hsl(120, 100%, 40%);">+                  vty_out(vty, " check-imei-rqd 1%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span> </span><br><span>        if (gsmnet->paging_response_timer != MSC_PAGING_RESPONSE_TIMER_DEFAULT)</span><br><span>           vty_out(vty, " paging response-timer %u%s", gsmnet->paging_response_timer, VTY_NEWLINE);</span><br><span>diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty</span><br><span>index 28eaefb..cdb3f8a 100644</span><br><span>--- a/tests/test_nodes.vty</span><br><span>+++ b/tests/test_nodes.vty</span><br><span>@@ -38,7 +38,7 @@</span><br><span>   no assign-tmsi</span><br><span>   auth-tuple-max-reuse-count <-1-2147483647></span><br><span>   auth-tuple-reuse-on-error (0|1)</span><br><span style="color: hsl(0, 100%, 40%);">-  check-imei-rqd (0|1)</span><br><span style="color: hsl(120, 100%, 40%);">+  check-imei-rqd (0|1|early)</span><br><span>   cs7-instance-a <0-15></span><br><span>   cs7-instance-iu <0-15></span><br><span>   paging response-timer (default|<1-65535>)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/13892">change 13892</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13892"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I256224194c3b8caf2b58a88d11dccd32c569201f </div>
<div style="display:none"> Gerrit-Change-Number: 13892 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>