Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2019-01-02 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11918 )

Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..

libmsc/VTY: introduce kill-switch for routing SMS over GSUP

As a rudiment of OsmoNiTB, OsmoMSC is still involved in SMS
processing, storage (in SQLite DB), and routing (via SMPP).
In real networks this is done by the external entity called
SMSC (SMS Centre), while the MSC is doing re-encapsulation
of GSM 04.11 SM-TL (Transport Layer) payload (i.e. TPDU)
between SM-RL (Relay Layer) and MAP.

Since OsmoMSC itself is not a 'Network in The Box' anymore, it
makes sense to replicate the 'traditional' behaviour of MSC.
The problem is that this behaviour cannot co-exist with the
current implementation, so the key idea is to rip out the
local SMS storage and routing from OsmoMSC, and (re)implement
it in a separate process (OsmoSMSC?).

As a temporary solution, this change introduces a 'kill-switch'
VTY option that enables routing of SMS messages over GSUP
towards ESME (through VLR and HLR), but breaks the local
storage and routing. This is why it's disabled by default.

As soon as we move the SMS processing and storage away from
OsmoMSC, this behaviour would be enabled by default, and
the VTY option would be hidden and deprecated. At the moment,
this option basically does nothing, and will take an effect
in the follow-up changes.

Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Related: OS#3587
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/msc_vty.c
M tests/test_nodes.vty
3 files changed, 33 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index d2511cb..dab082d 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -160,6 +160,14 @@

struct gsm_sms_queue *sms_queue;

+   /* The "SMS over GSUP" kill-switch that basically breaks internal
+* SMS routing (i.e. SQLite DB and SMPP), and enables forwarding
+* of short messages over GSUP towards ESME (through VLR and HLR).
+* Please see OS#3587 for details. This is a temporary solution,
+* so it should be removed as soon as we move the SMS processing
+* logic to an external process (OsmoSMSC?). REMOVE ME! */
+   bool sms_over_gsup;
+
/* control interface */
struct ctrl_handle *ctrl;

diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 7745e5d..201d2aa 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -476,6 +476,24 @@
return CMD_SUCCESS;
 }

+/* TODO: to be deprecated as soon as we rip SMS handling out (see OS#3587) */
+DEFUN(cfg_msc_sms_over_gsup, cfg_msc_sms_over_gsup_cmd,
+  "sms-over-gsup",
+  "Enable routing of SMS messages over GSUP\n")
+{
+   gsmnet->sms_over_gsup = true;
+   return CMD_SUCCESS;
+}
+
+/* TODO: to be deprecated as soon as we rip SMS handling out (see OS#3587) */
+DEFUN(cfg_msc_no_sms_over_gsup, cfg_msc_no_sms_over_gsup_cmd,
+  "no sms-over-gsup",
+  NO_STR "Disable routing of SMS messages over GSUP\n")
+{
+   gsmnet->sms_over_gsup = false;
+   return CMD_SUCCESS;
+}
+
 static int config_write_msc(struct vty *vty)
 {
vty_out(vty, "msc%s", VTY_NEWLINE);
@@ -512,6 +530,9 @@
if (gsmnet->msc_ipa_name)
vty_out(vty, " ipa-name %s%s", gsmnet->msc_ipa_name, 
VTY_NEWLINE);

+   if (gsmnet->sms_over_gsup)
+   vty_out(vty, " sms-over-gsup%s", VTY_NEWLINE);
+
mgcp_client_config_write(vty, " ");
 #ifdef BUILD_IU
ranap_iu_vty_config_write(vty, " ");
@@ -1533,6 +1554,8 @@
install_element(MSC_NODE, _msc_paging_response_timer_cmd);
install_element(MSC_NODE, _msc_emergency_msisdn_cmd);
install_element(MSC_NODE, _msc_ipa_name_cmd);
+   install_element(MSC_NODE, _msc_sms_over_gsup_cmd);
+   install_element(MSC_NODE, _msc_no_sms_over_gsup_cmd);

mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf);
 #ifdef BUILD_IU
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index d080082..18467d9 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -41,6 +41,8 @@
   paging response-timer (default|<1-65535>)
   emergency-call route-to-msisdn MSISDN
   ipa-name NAME
+  sms-over-gsup
+  no sms-over-gsup
   mgw local-ip A.B.C.D
   mgw local-port <0-65535>
   mgw remote-ip A.B.C.D

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 

Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2018-12-30 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11918 )

Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..


Patch Set 10: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 11918
Gerrit-PatchSet: 10
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 30 Dec 2018 12:19:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2018-12-20 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/11918 )

Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..


Patch Set 8: Code-Review+1


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 11918
Gerrit-PatchSet: 8
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 20 Dec 2018 11:35:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2018-12-20 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11918 )

Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..


Patch Set 8: Code-Review+1


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 11918
Gerrit-PatchSet: 8
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 20 Dec 2018 10:17:27 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2018-12-19 Thread Vadim Yanitskiy
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11918

to look at the new patch set (#8).

Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..

libmsc/VTY: introduce kill-switch for routing SMS over GSUP

As a rudiment of OsmoNiTB, OsmoMSC is still involved in SMS
processing, storage (in SQLite DB), and routing (via SMPP).
In real networks this is done by the external entity called
SMSC (SMS Centre), while the MSC is doing re-encapsulation
of GSM 04.11 SM-TL (Transport Layer) payload (i.e. TPDU)
between SM-RL (Relay Layer) and MAP.

Since OsmoMSC itself is not a 'Network in The Box' anymore, it
makes sense to replicate the 'traditional' behaviour of MSC.
The problem is that this behaviour cannot co-exist with the
current implementation, so the key idea is to rip out the
local SMS storage and routing from OsmoMSC, and (re)implement
it in a separate process (OsmoSMSC?).

As a temporary solution, this change introduces a 'kill-switch'
VTY option that enables routing of SMS messages over GSUP
towards ESME (through VLR and HLR), but breaks the local
storage and routing. This is why it's disabled by default.

As soon as we move the SMS processing and storage away from
OsmoMSC, this behaviour would be enabled by default, and
the VTY option would be hidden and deprecated. At the moment,
this option basically does nothing, and will take an effect
in the follow-up changes.

Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Related: OS#3587
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/msc_vty.c
M tests/test_nodes.vty
3 files changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/11918/8
--
To view, visit https://gerrit.osmocom.org/11918
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 11918
Gerrit-PatchSet: 8
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2018-12-19 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11918 )

Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..


Set Ready For Review


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 11918
Gerrit-PatchSet: 7
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Wed, 19 Dec 2018 18:47:18 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/VTY: introduce kill-switch for routing SMS over GSUP

2018-11-25 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11918


Change subject: libmsc/VTY: introduce kill-switch for routing SMS over GSUP
..

libmsc/VTY: introduce kill-switch for routing SMS over GSUP

As a rudiment of OsmoNiTB, OsmoMSC is still involved in SMS
processing, storage (in SQLite DB), and routing (via SMPP).
In real networks this is done by the external entity called
SMSC (SMS Centre), while the MSC is doing re-encapsulation
of GSM 04.11 SM-TL (Transport Layer) payload (i.e. TPDU)
between SM-RL (Relay Layer) and MAP.

Since OsmoMSC itself is not a 'Network in The Box' anymore, it
makes sense to replicate the 'traditional' behaviour of MSC.
The problem is that this behaviour cannot co-exist with the
current implementation, so the key idea is to rip out the
local SMS storage and routing from OsmoMSC, and (re)implement
it in a separate process (OsmoSMSC?).

As a temporary solution, this change introduces a 'kill-switch'
VTY option that enables routing of SMS messages over GSUP
towards ESME (through VLR and HLR), but breaks the local
storage and routing. This is why it's disabled by default.

As soon as we move the SMS processing and storage away from
OsmoMSC, this behaviour would be enabled by default, and
the VTY option would be hidden and deprecated. At the moment,
this option basically does nothing, and will take an effect
in the follow-up changes.

Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Related: OS#3587
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/msc_vty.c
2 files changed, 31 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/11918/1

diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 085248c..3c018b6 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -314,6 +314,14 @@

struct gsm_sms_queue *sms_queue;

+   /* The "SMS over GSUP" kill-switch that basically breaks internal
+* SMS routing (i.e. SQLite DB and SMPP), and enables forwarding
+* of short messages over GSUP towards ESME (through VLR and HLR).
+* Please see OS#3587 for details. This is a temporary solution,
+* so it should be removed as soon as we move the SMS processing
+* logic to an external process (OsmoSMSC?). REMOVE ME! */
+   bool enable_sms_over_gsup;
+
/* control interface */
struct ctrl_handle *ctrl;

diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 4f3ac04..89dcd2e 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -431,6 +431,24 @@
return CMD_SUCCESS;
 }

+/* TODO: to be deprecated as soon as we rip SMS handling out (see OS#3587) */
+DEFUN(cfg_msc_sms_over_gsup, cfg_msc_sms_over_gsup_cmd,
+  "sms-over-gsup",
+  "Enable routing of SMS messages over GSUP\n")
+{
+   gsmnet->enable_sms_over_gsup = true;
+   return CMD_SUCCESS;
+}
+
+/* TODO: to be deprecated as soon as we rip SMS handling out (see OS#3587) */
+DEFUN(cfg_msc_no_sms_over_gsup, cfg_msc_no_sms_over_gsup_cmd,
+  "no sms-over-gsup",
+  NO_STR "Disable routing of SMS messages over GSUP\n")
+{
+   gsmnet->enable_sms_over_gsup = false;
+   return CMD_SUCCESS;
+}
+
 static int config_write_msc(struct vty *vty)
 {
vty_out(vty, "msc%s", VTY_NEWLINE);
@@ -462,6 +480,9 @@
gsmnet->emergency.route_to_msisdn, VTY_NEWLINE);
}

+   if (gsmnet->enable_sms_over_gsup)
+   vty_out(vty, " sms-over-gsup%s", VTY_NEWLINE);
+
mgcp_client_config_write(vty, " ");
 #ifdef BUILD_IU
ranap_iu_vty_config_write(vty, " ");
@@ -1451,6 +1472,8 @@
install_element(MSC_NODE, _msc_cs7_instance_iu_cmd);
install_element(MSC_NODE, _msc_paging_response_timer_cmd);
install_element(MSC_NODE, _msc_emergency_msisdn_cmd);
+   install_element(MSC_NODE, _msc_sms_over_gsup_cmd);
+   install_element(MSC_NODE, _msc_no_sms_over_gsup_cmd);

mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf);
 #ifdef BUILD_IU

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b
Gerrit-Change-Number: 11918
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy