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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libmsc/VTY: introduce kill-switch for routing SMS over GSUP<br><br>As a rudiment of OsmoNiTB, OsmoMSC is still involved in SMS<br>processing, storage (in SQLite DB), and routing (via SMPP).<br>In real networks this is done by the external entity called<br>SMSC (SMS Centre), while the MSC is doing re-encapsulation<br>of GSM 04.11 SM-TL (Transport Layer) payload (i.e. TPDU)<br>between SM-RL (Relay Layer) and MAP.<br><br>Since OsmoMSC itself is not a 'Network in The Box' anymore, it<br>makes sense to replicate the 'traditional' behaviour of MSC.<br>The problem is that this behaviour cannot co-exist with the<br>current implementation, so the key idea is to rip out the<br>local SMS storage and routing from OsmoMSC, and (re)implement<br>it in a separate process (OsmoSMSC?).<br><br>As a temporary solution, this change introduces a 'kill-switch'<br>VTY option that enables routing of SMS messages over GSUP<br>towards ESME (through VLR and HLR), but breaks the local<br>storage and routing. This is why it's disabled by default.<br><br>As soon as we move the SMS processing and storage away from<br>OsmoMSC, this behaviour would be enabled by default, and<br>the VTY option would be hidden and deprecated. At the moment,<br>this option basically does nothing, and will take an effect<br>in the follow-up changes.<br><br>Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b<br>Related: OS#3587<br>---<br>M include/osmocom/msc/gsm_data.h<br>M src/libmsc/msc_vty.c<br>M tests/test_nodes.vty<br>3 files changed, 33 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h</span><br><span>index d2511cb..dab082d 100644</span><br><span>--- a/include/osmocom/msc/gsm_data.h</span><br><span>+++ b/include/osmocom/msc/gsm_data.h</span><br><span>@@ -160,6 +160,14 @@</span><br><span> </span><br><span>  struct gsm_sms_queue *sms_queue;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  /* The "SMS over GSUP" kill-switch that basically breaks internal</span><br><span style="color: hsl(120, 100%, 40%);">+    * SMS routing (i.e. SQLite DB and SMPP), and enables forwarding</span><br><span style="color: hsl(120, 100%, 40%);">+       * of short messages over GSUP towards ESME (through VLR and HLR).</span><br><span style="color: hsl(120, 100%, 40%);">+     * Please see OS#3587 for details. This is a temporary solution,</span><br><span style="color: hsl(120, 100%, 40%);">+       * so it should be removed as soon as we move the SMS processing</span><br><span style="color: hsl(120, 100%, 40%);">+       * logic to an external process (OsmoSMSC?). REMOVE ME! */</span><br><span style="color: hsl(120, 100%, 40%);">+    bool sms_over_gsup;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        /* control interface */</span><br><span>      struct ctrl_handle *ctrl;</span><br><span> </span><br><span>diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c</span><br><span>index 7745e5d..201d2aa 100644</span><br><span>--- a/src/libmsc/msc_vty.c</span><br><span>+++ b/src/libmsc/msc_vty.c</span><br><span>@@ -476,6 +476,24 @@</span><br><span>    return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* TODO: to be deprecated as soon as we rip SMS handling out (see OS#3587) */</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN(cfg_msc_sms_over_gsup, cfg_msc_sms_over_gsup_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+      "sms-over-gsup",</span><br><span style="color: hsl(120, 100%, 40%);">+      "Enable routing of SMS messages over GSUP\n")</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      gsmnet->sms_over_gsup = true;</span><br><span style="color: hsl(120, 100%, 40%);">+      return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* TODO: to be deprecated as soon as we rip SMS handling out (see OS#3587) */</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN(cfg_msc_no_sms_over_gsup, cfg_msc_no_sms_over_gsup_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+      "no sms-over-gsup",</span><br><span style="color: hsl(120, 100%, 40%);">+      NO_STR "Disable routing of SMS messages over GSUP\n")</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ gsmnet->sms_over_gsup = false;</span><br><span style="color: hsl(120, 100%, 40%);">+     return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static int config_write_msc(struct vty *vty)</span><br><span> {</span><br><span>        vty_out(vty, "msc%s", VTY_NEWLINE);</span><br><span>@@ -512,6 +530,9 @@</span><br><span>  if (gsmnet->msc_ipa_name)</span><br><span>                 vty_out(vty, " ipa-name %s%s", gsmnet->msc_ipa_name, VTY_NEWLINE);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   if (gsmnet->sms_over_gsup)</span><br><span style="color: hsl(120, 100%, 40%);">+         vty_out(vty, " sms-over-gsup%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   mgcp_client_config_write(vty, " ");</span><br><span> #ifdef BUILD_IU</span><br><span>     ranap_iu_vty_config_write(vty, " ");</span><br><span>@@ -1533,6 +1554,8 @@</span><br><span>       install_element(MSC_NODE, &cfg_msc_paging_response_timer_cmd);</span><br><span>   install_element(MSC_NODE, &cfg_msc_emergency_msisdn_cmd);</span><br><span>        install_element(MSC_NODE, &cfg_msc_ipa_name_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+ install_element(MSC_NODE, &cfg_msc_sms_over_gsup_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+    install_element(MSC_NODE, &cfg_msc_no_sms_over_gsup_cmd);</span><br><span> </span><br><span>    mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf);</span><br><span> #ifdef BUILD_IU</span><br><span>diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty</span><br><span>index d080082..18467d9 100644</span><br><span>--- a/tests/test_nodes.vty</span><br><span>+++ b/tests/test_nodes.vty</span><br><span>@@ -41,6 +41,8 @@</span><br><span>   paging response-timer (default|<1-65535>)</span><br><span>   emergency-call route-to-msisdn MSISDN</span><br><span>   ipa-name NAME</span><br><span style="color: hsl(120, 100%, 40%);">+  sms-over-gsup</span><br><span style="color: hsl(120, 100%, 40%);">+  no sms-over-gsup</span><br><span>   mgw local-ip A.B.C.D</span><br><span>   mgw local-port <0-65535></span><br><span>   mgw remote-ip A.B.C.D</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11918">change 11918</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/11918"/><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: Ie57685ed2ce1e4c978e775b68fdffe58de44882b </div>
<div style="display:none"> Gerrit-Change-Number: 11918 </div>
<div style="display:none"> Gerrit-PatchSet: 10 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </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: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Sperling <stsp@stsp.name> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>