diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index d2511cb7b..dab082d82 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -160,6 +160,14 @@ struct gsm_network { 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 7745e5d99..201d2aa1a 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -476,6 +476,24 @@ DEFUN(cfg_msc_ipa_name, 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 @@ static int config_write_msc(struct vty *vty) 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 @@ void msc_vty_init(struct gsm_network *msc_network) install_element(MSC_NODE, &cfg_msc_paging_response_timer_cmd); install_element(MSC_NODE, &cfg_msc_emergency_msisdn_cmd); install_element(MSC_NODE, &cfg_msc_ipa_name_cmd); + install_element(MSC_NODE, &cfg_msc_sms_over_gsup_cmd); + install_element(MSC_NODE, &cfg_msc_no_sms_over_gsup_cmd); mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index d08008213..18467d96f 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -41,6 +41,8 @@ OsmoMSC(config-msc)# list 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