lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2022

  • 2 participants
  • 1343 discussions
Change in osmo-msc[master]: sms: Give smsc its own VTY
by laforge 17 May '22

17 May '22
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/28133 to look at the new patch set (#2). Change subject: sms: Give smsc its own VTY ...................................................................... sms: Give smsc its own VTY The pre-historic sms_queue code used to have very strange aspects, such as having some parameters (max-failure, max-pending) which could only be sent from the 'enable' node, but not from a config file. Before adding more configuration parameters, let's clean this up by introducing a proper VTY config node for the 'smsc'; move the existing config commands there and add new ones for max-failure and max-pending. As the sms_queue data structure is only allocated after the config file parsing happens, we are introducing a new 'sms_queue_config' data structure. This encapsulates the public readable/writable config parameters. Change-Id: Ie8e0ab1a9f979337ff06544b9ab3820954d9804a --- M include/osmocom/msc/sms_queue.h M include/osmocom/msc/vty.h M src/libmsc/Makefile.am M src/libmsc/msc_vty.c M src/libmsc/sms_queue.c A src/libmsc/smsc_vty.c M src/osmo-msc/msc_main.c M tests/test_nodes.vty 8 files changed, 178 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/28133/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ie8e0ab1a9f979337ff06544b9ab3820954d9804a Gerrit-Change-Number: 28133 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-msc[master]: switch from libdbi to lbsqlite3
by laforge 17 May '22

17 May '22
Attention is currently required from: neels, keith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28114 ) Change subject: switch from libdbi to lbsqlite3 ...................................................................... Patch Set 10: Verified+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790 Gerrit-Change-Number: 28114 Gerrit-PatchSet: 10 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith <keith(a)rhizomatica.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: keith <keith(a)rhizomatica.org> Gerrit-Comment-Date: Tue, 17 May 2022 12:46:04 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-msc[master]: switch from libdbi to lbsqlite3
by laforge 17 May '22

17 May '22
Attention is currently required from: neels, laforge, keith. laforge has removed a vote from this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28114 ) Change subject: switch from libdbi to lbsqlite3 ...................................................................... Removed Verified-1 by Jenkins Builder (1000002) -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790 Gerrit-Change-Number: 28114 Gerrit-PatchSet: 10 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith <keith(a)rhizomatica.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: keith <keith(a)rhizomatica.org> Gerrit-MessageType: deleteVote
1 0
0 0
Change in osmo-msc[master]: sms: Give smsc its own VTY
by laforge 17 May '22

17 May '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/28133 ) Change subject: sms: Give smsc its own VTY ...................................................................... sms: Give smsc its own VTY The pre-historic sms_queue code used to have very strange aspects, such as having some parameters (max-failure, max-pending) which could only be sent from the 'enable' node, but not from a config file. Before adding more configuration parameters, let's clean this up by introducing a proper VTY config node for the 'smsc'; move the existing config commands there and add new ones for max-failure and max-pending. As the sms_queue data structure is only allocated after the config file parsing happens, we are introducing a new 'sms_queue_config' data structure. This encapsulates the public readable/writable config parameters. Change-Id: Ie8e0ab1a9f979337ff06544b9ab3820954d9804a --- M include/osmocom/msc/sms_queue.h M include/osmocom/msc/vty.h M src/libmsc/Makefile.am M src/libmsc/msc_vty.c M src/libmsc/sms_queue.c A src/libmsc/smsc_vty.c M src/osmo-msc/msc_main.c 7 files changed, 174 insertions(+), 72 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/28133/1 diff --git a/include/osmocom/msc/sms_queue.h b/include/osmocom/msc/sms_queue.h index c0d6e9e..e2b9a59 100644 --- a/include/osmocom/msc/sms_queue.h +++ b/include/osmocom/msc/sms_queue.h @@ -21,8 +21,6 @@ /* vty helper functions */ int sms_queue_stats(struct gsm_sms_queue *, struct vty* vty); -int sms_queue_set_max_pending(struct gsm_sms_queue *, int max); -int sms_queue_set_max_failure(struct gsm_sms_queue *, int fail); int sms_queue_clear(struct gsm_sms_queue *); int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id); diff --git a/include/osmocom/msc/vty.h b/include/osmocom/msc/vty.h index 2a3b18b..1e13846 100644 --- a/include/osmocom/msc/vty.h +++ b/include/osmocom/msc/vty.h @@ -24,11 +24,13 @@ SMPP_ESME_NODE, HLR_NODE, CFG_SGS_NODE, + SMSC_NODE, }; int bsc_vty_init_extra(void); void msc_vty_init(struct gsm_network *msc_network); +void smsc_vty_init(struct gsm_network *msc_network); struct gsm_network *gsmnet_from_vty(struct vty *vty); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index e6a2dc1..d3b6035 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -67,6 +67,7 @@ sdp_msg.c \ silent_call.c \ sms_queue.c \ + smsc_vty.c \ transaction.c \ msc_net_init.c \ ctrl_commands.c \ diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 5ceb6c4..be05a95 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -410,7 +410,7 @@ #define MNCC_GUARD_TIMEOUT_STR "Set global guard timer for mncc interface activity\n" #define MNCC_GUARD_TIMEOUT_VALUE_STR "guard timer value (sec.)\n" -DEFUN(cfg_sms_database, cfg_sms_database_cmd, +DEFUN_DEPRECATED(cfg_sms_database, cfg_sms_database_cmd, "sms-database PATH", "Set the path to the MSC-SMS database file\n" "Relative or absolute file system path to the database file (default is '" SMS_DEFAULT_DB_FILE_PATH "')\n") @@ -754,8 +754,6 @@ static int config_write_msc(struct vty *vty) { vty_out(vty, "msc%s", VTY_NEWLINE); - if (gsmnet->sms_queue_cfg->db_file_path && strcmp(gsmnet->sms_queue_cfg->db_file_path, SMS_DEFAULT_DB_FILE_PATH)) - vty_out(vty, " sms-database %s%s", gsmnet->sms_queue_cfg->db_file_path, VTY_NEWLINE); if (gsmnet->mncc_sock_path) vty_out(vty, " mncc external %s%s", gsmnet->mncc_sock_path, VTY_NEWLINE); vty_out(vty, " mncc guard-timeout %i%s", @@ -1860,51 +1858,6 @@ return CMD_SUCCESS; } -DEFUN(show_smsqueue, - show_smsqueue_cmd, - "show sms-queue", - SHOW_STR "Display SMSqueue statistics\n") -{ - sms_queue_stats(gsmnet->sms_queue, vty); - return CMD_SUCCESS; -} - -DEFUN(smsqueue_trigger, - smsqueue_trigger_cmd, - "sms-queue trigger", - "SMS Queue\n" "Trigger sending messages\n") -{ - sms_queue_trigger(gsmnet->sms_queue); - return CMD_SUCCESS; -} - -DEFUN(smsqueue_max, - smsqueue_max_cmd, - "sms-queue max-pending <1-500>", - "SMS Queue\n" "SMS to deliver in parallel\n" "Amount\n") -{ - sms_queue_set_max_pending(gsmnet->sms_queue, atoi(argv[0])); - return CMD_SUCCESS; -} - -DEFUN(smsqueue_clear, - smsqueue_clear_cmd, - "sms-queue clear", - "SMS Queue\n" "Clear the queue of pending SMS\n") -{ - sms_queue_clear(gsmnet->sms_queue); - return CMD_SUCCESS; -} - -DEFUN(smsqueue_fail, - smsqueue_fail_cmd, - "sms-queue max-failure <1-500>", - "SMS Queue\n" "Maximum amount of delivery failures\n" "Amount\n") -{ - sms_queue_set_max_failure(gsmnet->sms_queue, atoi(argv[0])); - return CMD_SUCCESS; -} - DEFUN(cfg_mncc_int, cfg_mncc_int_cmd, "mncc-int", "Configure internal MNCC handler") @@ -2118,6 +2071,7 @@ ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)&msc_network->iu.rab_assign_addr_enc); #endif sgs_vty_init(); + smsc_vty_init(msc_network); osmo_fsm_vty_add_cmds(); @@ -2143,14 +2097,9 @@ install_element_ve(&subscriber_mstest_open_cmd); install_element_ve(&subscriber_paging_cmd); install_element_ve(&show_stats_cmd); - install_element_ve(&show_smsqueue_cmd); install_element_ve(&logging_fltr_imsi_cmd); install_element(ENABLE_NODE, &ena_subscr_expire_cmd); - install_element(ENABLE_NODE, &smsqueue_trigger_cmd); - install_element(ENABLE_NODE, &smsqueue_max_cmd); - install_element(ENABLE_NODE, &smsqueue_clear_cmd); - install_element(ENABLE_NODE, &smsqueue_fail_cmd); install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd); install_element(ENABLE_NODE, &subscriber_sms_delete_all_cmd); diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index e0433ee..a47f8e0 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -672,22 +672,6 @@ return 0; } -int sms_queue_set_max_pending(struct gsm_sms_queue *smsq, int max_pending) -{ - LOGP(DLSMS, LOGL_NOTICE, "SMSqueue old max: %d new: %d\n", - smsq->cfg->max_pending, max_pending); - smsq->cfg->max_pending = max_pending; - return 0; -} - -int sms_queue_set_max_failure(struct gsm_sms_queue *smsq, int max_fail) -{ - LOGP(DLSMS, LOGL_NOTICE, "SMSqueue max failure old: %d new: %d\n", - smsq->cfg->max_fail, max_fail); - smsq->cfg->max_fail = max_fail; - return 0; -} - int sms_queue_clear(struct gsm_sms_queue *smsq) { struct gsm_sms_pending *pending, *tmp; diff --git a/src/libmsc/smsc_vty.c b/src/libmsc/smsc_vty.c new file mode 100644 index 0000000..cdb81c6 --- /dev/null +++ b/src/libmsc/smsc_vty.c @@ -0,0 +1,168 @@ +/* SMSC interface to VTY */ +/* (C) 2016-2018 by sysmocom s.m.f.c. GmbH <info(a)sysmocom.de> + * Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c) + * (C) 2009-2022 by Harald Welte <laforge(a)gnumonks.org> + * (C) 2009-2011 by Holger Hans Peter Freyther + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include "config.h" + +#include <osmocom/vty/command.h> +#include <osmocom/vty/logging.h> +#include <osmocom/vty/misc.h> + +#include <osmocom/msc/vty.h> +#include <osmocom/msc/gsm_data.h> +#include <osmocom/msc/sms_queue.h> + + +static struct gsm_network *gsmnet; +static struct sms_queue_config *smqcfg; + +/*********************************************************************** + * SMSC Config Node + ***********************************************************************/ + +static struct cmd_node smsc_node = { + SMSC_NODE, + "%s(config-smsc)# ", + 1, +}; + +DEFUN(cfg_smsc, cfg_smsc_cmd, + "smsc", "Configure SMSC options") +{ + vty->node = SMSC_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_sms_database, cfg_sms_database_cmd, + "database PATH", + "Set the path to the MSC-SMS database file\n" + "Relative or absolute file system path to the database file (default is '" SMS_DEFAULT_DB_FILE_PATH "')\n") +{ + osmo_talloc_replace_string(smqcfg, &smqcfg->db_file_path, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_sms_queue_max, cfg_sms_queue_max_cmd, + "queue max-pending <1-500>", + "SMS Queue\n" "SMS to deliver in parallel\n" "Amount\n") +{ + smqcfg->max_pending = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_sms_queue_fail, cfg_sms_queue_fail_cmd, + "queue max-failure <1-500>", + "SMS Queue\n" "Maximum number of delivery failures before giving up\n" "Amount\n") +{ + smqcfg->max_fail = atoi(argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * View / Enable Node + ***********************************************************************/ + +DEFUN(show_smsqueue, + show_smsqueue_cmd, + "show sms-queue", + SHOW_STR "Display SMSqueue statistics\n") +{ + sms_queue_stats(gsmnet->sms_queue, vty); + return CMD_SUCCESS; +} + +DEFUN(smsqueue_trigger, + smsqueue_trigger_cmd, + "sms-queue trigger", + "SMS Queue\n" "Trigger sending messages\n") +{ + sms_queue_trigger(gsmnet->sms_queue); + return CMD_SUCCESS; +} + +DEFUN(smsqueue_max, + smsqueue_max_cmd, + "sms-queue max-pending <1-500>", + "SMS Queue\n" "SMS to deliver in parallel\n" "Amount\n") +{ + int max_pending = atoi(argv[0]); + vty_out(vty, "%% SMSqueue old max: %d new: %d%s", + smqcfg->max_pending, max_pending, VTY_NEWLINE); + smqcfg->max_pending = max_pending; + return CMD_SUCCESS; +} + +DEFUN(smsqueue_clear, + smsqueue_clear_cmd, + "sms-queue clear", + "SMS Queue\n" "Clear the queue of pending SMS\n") +{ + sms_queue_clear(gsmnet->sms_queue); + return CMD_SUCCESS; +} + +DEFUN(smsqueue_fail, + smsqueue_fail_cmd, + "sms-queue max-failure <1-500>", + "SMS Queue\n" "Maximum amount of delivery failures\n" "Amount\n") +{ + int max_fail = atoi(argv[0]); + vty_out(vty, "%% SMSqueue max failure old: %d new: %d%s", + smqcfg->max_fail, max_fail, VTY_NEWLINE); + smqcfg->max_fail = max_fail; + return CMD_SUCCESS; +} + +static int config_write_smsc(struct vty *vty) +{ + vty_out(vty, "smsc%s", VTY_NEWLINE); + + if (smqcfg->db_file_path && strcmp(smqcfg->db_file_path, SMS_DEFAULT_DB_FILE_PATH)) + vty_out(vty, " database %s%s", smqcfg->db_file_path, VTY_NEWLINE); + + vty_out(vty, " queue max-pending %u%s", smqcfg->max_pending, VTY_NEWLINE); + vty_out(vty, " queue max-failure %u%s", smqcfg->max_fail, VTY_NEWLINE); + + return 0; +} + +void smsc_vty_init(struct gsm_network *msc_network) +{ + OSMO_ASSERT(gsmnet == NULL); + gsmnet = msc_network; + smqcfg = msc_network->sms_queue_cfg; + + /* config node */ + install_element(CONFIG_NODE, &cfg_smsc_cmd); + install_node(&smsc_node, config_write_smsc); + install_element(SMSC_NODE, &cfg_sms_database_cmd); + install_element(SMSC_NODE, &cfg_sms_queue_max_cmd); + install_element(SMSC_NODE, &cfg_sms_queue_fail_cmd); + + /* enable node */ + install_element(ENABLE_NODE, &smsqueue_trigger_cmd); + install_element(ENABLE_NODE, &smsqueue_max_cmd); + install_element(ENABLE_NODE, &smsqueue_clear_cmd); + install_element(ENABLE_NODE, &smsqueue_fail_cmd); + + /* view / enable node */ + install_element_ve(&show_smsqueue_cmd); +} diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 9329de5..bdffb41 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -205,7 +205,7 @@ break; case 'l': fprintf(stderr, "Command line argument '-%c' is deprecated, use VTY " - "parameter 'msc' / 'sms-database %s' instead.\n", c, optarg); + "parameter 'smsc' / 'database %s' instead.\n", c, optarg); exit(2); break; case 'c': -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ie8e0ab1a9f979337ff06544b9ab3820954d9804a Gerrit-Change-Number: 28133 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-msc[master]: sms: Encapsulate SMS queue related config parameters
by laforge 17 May '22

17 May '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/28132 ) Change subject: sms: Encapsulate SMS queue related config parameters ...................................................................... sms: Encapsulate SMS queue related config parameters Introduce a 'struct sms_queue_config' that holds all config parameters related to the SMS queue. Change-Id: I559ab7a6e0502a1a12a662ebd5591875d47ec7b2 --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/sms_queue.h M src/libmsc/msc_net_init.c M src/libmsc/msc_vty.c M src/libmsc/sms_queue.c M src/osmo-msc/msc_main.c 6 files changed, 53 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/28132/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 34d42db..78b9c9a 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -19,6 +19,7 @@ #include <osmocom/msc/msc_common.h> #include <osmocom/msc/neighbor_ident.h> +#include <osmocom/msc/sms_queue.h> #include "gsm_data_shared.h" #include "osmux.h" @@ -263,7 +264,8 @@ /* Whether to use lcls on the network */ bool lcls_permitted; - char *sms_db_file_path; + /* SMS queue config parameters */ + struct sms_queue_config *sms_queue_cfg; }; struct osmo_esme; diff --git a/include/osmocom/msc/sms_queue.h b/include/osmocom/msc/sms_queue.h index ef73baf..c0d6e9e 100644 --- a/include/osmocom/msc/sms_queue.h +++ b/include/osmocom/msc/sms_queue.h @@ -5,10 +5,18 @@ struct gsm_sms_queue; struct vty; +struct sms_queue_config { + char *db_file_path; /* SMS database file path */ + int max_fail; /* maximum number of delivery failures */ + int max_pending; /* maximum number of gsm_sms_pending in RAM */ +}; + +struct sms_queue_config *sms_queue_cfg_alloc(void *ctx); + #define VSUB_USE_SMS_PENDING "SMS-pending" #define MSC_A_USE_SMS_PENDING "SMS-pending" -int sms_queue_start(struct gsm_network *, int in_flight); +int sms_queue_start(struct gsm_network *); int sms_queue_trigger(struct gsm_sms_queue *); /* vty helper functions */ diff --git a/src/libmsc/msc_net_init.c b/src/libmsc/msc_net_init.c index af23fe5..45500b2 100644 --- a/src/libmsc/msc_net_init.c +++ b/src/libmsc/msc_net_init.c @@ -62,8 +62,6 @@ if (!net) return NULL; - net->sms_db_file_path = talloc_strdup(net, SMS_DEFAULT_DB_FILE_PATH); - net->plmn = (struct osmo_plmn_id){ .mcc=1, .mnc=1 }; /* Permit a compile-time default of A5/3 and A5/1 */ diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 4dd834b..5ceb6c4 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -415,7 +415,7 @@ "Set the path to the MSC-SMS database file\n" "Relative or absolute file system path to the database file (default is '" SMS_DEFAULT_DB_FILE_PATH "')\n") { - osmo_talloc_replace_string(gsmnet, &gsmnet->sms_db_file_path, argv[0]); + osmo_talloc_replace_string(gsmnet, &gsmnet->sms_queue_cfg->db_file_path, argv[0]); return CMD_SUCCESS; } @@ -754,8 +754,8 @@ static int config_write_msc(struct vty *vty) { vty_out(vty, "msc%s", VTY_NEWLINE); - if (gsmnet->sms_db_file_path && strcmp(gsmnet->sms_db_file_path, SMS_DEFAULT_DB_FILE_PATH)) - vty_out(vty, " sms-database %s%s", gsmnet->sms_db_file_path, VTY_NEWLINE); + if (gsmnet->sms_queue_cfg->db_file_path && strcmp(gsmnet->sms_queue_cfg->db_file_path, SMS_DEFAULT_DB_FILE_PATH)) + vty_out(vty, " sms-database %s%s", gsmnet->sms_queue_cfg->db_file_path, VTY_NEWLINE); if (gsmnet->mncc_sock_path) vty_out(vty, " mncc external %s%s", gsmnet->mncc_sock_path, VTY_NEWLINE); vty_out(vty, " mncc guard-timeout %i%s", diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index cc44f58..e0433ee 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -124,11 +124,9 @@ struct osmo_timer_list resend_pending; /* timer triggering sms_resend_pending() */ struct osmo_timer_list push_queue; /* timer triggering sms_submit_pending() */ struct gsm_network *network; - int max_fail; /* maximum number of delivery failures */ - int max_pending; /* maximum number of gsm_sms_pending in RAM */ - int pending; /* current number of gsm_sms_pending in RAM */ - struct llist_head pending_sms; /* list of gsm_sms_pending */ + struct sms_queue_config *cfg; + int pending; /* current number of gsm_sms_pending in RAM */ /* last MSISDN for which we read SMS from the database and created gsm_sms_pending records */ char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1]; @@ -251,7 +249,7 @@ pending->sms_id, pending->failed_attempts); smsq = net->sms_queue; - if (pending->failed_attempts < smsq->max_fail) + if (pending->failed_attempts < smsq->cfg->max_fail) return sms_pending_resend(pending); sms_pending_free(smsq, pending); @@ -342,7 +340,7 @@ static void sms_submit_pending(void *_data) { struct gsm_sms_queue *smsq = _data; - int attempts = smsq->max_pending - smsq->pending; + int attempts = smsq->cfg->max_pending - smsq->pending; int initialized = 0; unsigned long long first_sub = 0; int attempted = 0, rounds = 0; @@ -466,9 +464,22 @@ return 0; } +/* allocate + initialize SMS queue configuration with some default values */ +struct sms_queue_config *sms_queue_cfg_alloc(void *ctx) +{ + struct sms_queue_config *sqcfg = talloc_zero(ctx, struct sms_queue_config); + OSMO_ASSERT(sqcfg); + + sqcfg->max_pending = 20; + sqcfg->max_fail = 1; + sqcfg->db_file_path = talloc_strdup(ctx, SMS_DEFAULT_DB_FILE_PATH); + + return sqcfg; +} + /* initialize the sms_queue subsystem and read the first batch of SMS from * the database for delivery */ -int sms_queue_start(struct gsm_network *network, int max_pending) +int sms_queue_start(struct gsm_network *network) { struct gsm_sms_queue *sms = talloc_zero(network, struct gsm_sms_queue); if (!sms) { @@ -476,6 +487,7 @@ return -1; } + sms->cfg = network->sms_queue_cfg; sms->statg = osmo_stat_item_group_alloc(sms, &smsq_statg_desc, 0); if (!sms->statg) goto err_free; @@ -486,15 +498,24 @@ network->sms_queue = sms; INIT_LLIST_HEAD(&sms->pending_sms); - sms->max_fail = 1; sms->network = network; - sms->max_pending = max_pending; osmo_timer_setup(&sms->push_queue, sms_submit_pending, sms); osmo_timer_setup(&sms->resend_pending, sms_resend_pending, sms); osmo_signal_register_handler(SS_SUBSCR, sms_subscr_cb, network); osmo_signal_register_handler(SS_SMS, sms_sms_cb, network); + if (db_init(sms, sms->cfg->db_file_path, true)) { + LOGP(DMSC, LOGL_FATAL, "DB: Failed to init database: %s\n", + osmo_quote_str(sms->cfg->db_file_path, -1)); + return -1; + } + + if (db_prepare()) { + LOGP(DMSC, LOGL_FATAL, "DB: Failed to prepare database.\n"); + return -1; + } + sms_submit_pending(sms); return 0; @@ -642,7 +663,7 @@ struct gsm_sms_pending *pending; vty_out(vty, "SMSqueue with max_pending: %d pending: %d%s", - smsq->max_pending, smsq->pending, VTY_NEWLINE); + smsq->cfg->max_pending, smsq->pending, VTY_NEWLINE); llist_for_each_entry(pending, &smsq->pending_sms, entry) vty_out(vty, " SMS Pending for Subscriber: %llu SMS: %llu Failed: %d.%s", @@ -654,16 +675,16 @@ int sms_queue_set_max_pending(struct gsm_sms_queue *smsq, int max_pending) { LOGP(DLSMS, LOGL_NOTICE, "SMSqueue old max: %d new: %d\n", - smsq->max_pending, max_pending); - smsq->max_pending = max_pending; + smsq->cfg->max_pending, max_pending); + smsq->cfg->max_pending = max_pending; return 0; } int sms_queue_set_max_failure(struct gsm_sms_queue *smsq, int max_fail) { LOGP(DLSMS, LOGL_NOTICE, "SMSqueue max failure old: %d new: %d\n", - smsq->max_fail, max_fail); - smsq->max_fail = max_fail; + smsq->cfg->max_fail, max_fail); + smsq->cfg->max_fail = max_fail; return 0; } diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index e3ac100..9329de5 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -100,12 +100,10 @@ /* end deps from libbsc legacy. */ static struct { - const char *database_name; const char *config_file; int daemonize; const char *mncc_sock_path; } msc_cmdline_config = { - .database_name = NULL, .config_file = "osmo-msc.cfg", }; @@ -206,9 +204,9 @@ msc_cmdline_config.daemonize = 1; break; case 'l': - msc_cmdline_config.database_name = optarg; fprintf(stderr, "Command line argument '-%c' is deprecated, use VTY " "parameter 'msc' / 'sms-database %s' instead.\n", c, optarg); + exit(2); break; case 'c': msc_cmdline_config.config_file = optarg; @@ -264,6 +262,7 @@ net->mgw.tdefs = g_mgw_tdefs; osmo_tdefs_reset(net->mgw.tdefs); + net->sms_queue_cfg = sms_queue_cfg_alloc(ctx); return net; } @@ -683,14 +682,6 @@ /* TODO: is this used for crypto?? Improve randomness, at least we * should try to use the nanoseconds part of the current time. */ - if (msc_cmdline_config.database_name) - osmo_talloc_replace_string(msc_network, &msc_network->sms_db_file_path, msc_cmdline_config.database_name); - if (db_init(tall_msc_ctx, msc_network->sms_db_file_path, true)) { - fprintf(stderr, "DB: Failed to init database: %s\n", - osmo_quote_str((char*)msc_network->sms_db_file_path, -1)); - return 4; - } - if (msc_gsup_client_start(msc_network)) { fprintf(stderr, "Failed to start GSUP client\n"); exit(1); @@ -703,11 +694,6 @@ exit(1); } - if (db_prepare()) { - fprintf(stderr, "DB: Failed to prepare database.\n"); - return 5; - } - signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); @@ -716,7 +702,7 @@ osmo_init_ignore_signals(); /* start the SMS queue */ - if (sms_queue_start(msc_network, 20) != 0) + if (sms_queue_start(msc_network) != 0) return -1; msc_network->mgw.client = mgcp_client_init( -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28132 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I559ab7a6e0502a1a12a662ebd5591875d47ec7b2 Gerrit-Change-Number: 28132 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-msc[master]: switch from libdbi to lbsqlite3
by laforge 17 May '22

17 May '22
Attention is currently required from: neels, laforge, keith. Hello Jenkins Builder, neels, pespin, keith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/28114 to look at the new patch set (#10). Change subject: switch from libdbi to lbsqlite3 ...................................................................... switch from libdbi to lbsqlite3 The choice of libdbi was one of the biggest early mistakes in (back then) OpenBSC development. A database abstraction library that prevents you from using proper prepared statements. Let's finally abandon it and use sqlite3 directly, just like we do in osmo-hlr. I decided to remove the database migration code as it would be relatively cumbersome to port all of it to direct sqlite3 with prepared statements, and it is prone to introduction of all kinds of errors. Since we don't have a body of older database files and comprehensive migration tests, it is safer to not offer migration code of uncertain quality. The last schema revision (5) was introduced 5 years ago in 2017 (osmo-msc v1.1.0), so it is considered an exceptionally rare case. People can install osmo-msc 1.1.0 through 1.8.0 to upgrade to v5 before using this new 'direct sqlite3' version of osmo-msc. Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790 Related: OS#5559, OS#5563, OS#5564 --- M configure.ac M contrib/osmo-msc.spec.in M debian/control M include/osmocom/msc/db.h M src/libmsc/db.c M src/libmsc/sms_queue.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/db_sms/Makefile.am M tests/db_sms/db_sms_test.c M tests/sms_queue/Makefile.am 11 files changed, 664 insertions(+), 721 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/28114/10 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790 Gerrit-Change-Number: 28114 Gerrit-PatchSet: 10 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith <keith(a)rhizomatica.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: keith <keith(a)rhizomatica.org> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-ttcn3-hacks[master]: stp: Fix sporadic failure in TC_ipa_to_m3ua_ni
by pespin 17 May '22

17 May '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28131 ) Change subject: stp: Fix sporadic failure in TC_ipa_to_m3ua_ni ...................................................................... stp: Fix sporadic failure in TC_ipa_to_m3ua_ni It was spotted that from time to time the test set NI international instead of national. This is presumable due to a race condition between VTY and messages being received and forwarded. Let's add some wait time to make sure everything happens in the proepr order. Change-Id: I3ef08447d2e36b6948d3db4ec9d1459beebc9384 --- M stp/STP_Tests.ttcn 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/31/28131/1 diff --git a/stp/STP_Tests.ttcn b/stp/STP_Tests.ttcn index ac45b1d..1a3f775 100644 --- a/stp/STP_Tests.ttcn +++ b/stp/STP_Tests.ttcn @@ -143,7 +143,9 @@ var PDU_SCCP sccp := valueof(ts_SCCP_UDT(called, calling, data)); var octetstring sccp_enc := enc_PDU_SCCP(sccp); f_vty_config2(VTY, {"cs7 instance 0"}, "network-indicator national"); + f_sleep(1.0); /* Wait some time for the VTY transaction to finish */ f_IPA_send(3, sccp_enc); + f_sleep(1.0); /* Wait some time for the IPA msg to be forwarded before resetting. */ f_vty_config2(VTY, {"cs7 instance 0"}, "network-indicator international"); /* expect to receive it via M3UA */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28131 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3ef08447d2e36b6948d3db4ec9d1459beebc9384 Gerrit-Change-Number: 28131 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-msc[master]: db: Switch from 'synchronous = FULL' to 'synchronous = NORMAL'
by pespin 17 May '22

17 May '22
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28130 ) Change subject: db: Switch from 'synchronous = FULL' to 'synchronous = NORMAL' ...................................................................... Patch Set 1: Code-Review+1 (1 comment) File src/libmsc/db.c: https://gerrit.osmocom.org/c/osmo-msc/+/28130/comment/f49b8c04_4d9008c2 PS1, Line 566: if (rc != SQLITE_OK) { typo: lol it didn't fail? Also maybe use same format, " = " or "=" for both. -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28130 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ie782f0fe90e7204c4d55cdb3948b728c348367d1 Gerrit-Change-Number: 28130 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 17 May 2022 09:43:27 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-msc[master]: switch from libdbi to lbsqlite3
by pespin 17 May '22

17 May '22
Attention is currently required from: neels, laforge, keith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28114 ) Change subject: switch from libdbi to lbsqlite3 ...................................................................... Patch Set 9: (1 comment) File include/osmocom/msc/db.h: https://gerrit.osmocom.org/c/osmo-msc/+/28114/comment/e7d2f8a6_05a390a3 PS8, Line 43: int max_failed); > no, it doesn't make sense. […] Then IMHO it makes much more sense to convert unsigned to signed inside the function/implementation (trimming the bigges values to INT MAX, or returning error) rather than transporting the problem to the API. -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790 Gerrit-Change-Number: 28114 Gerrit-PatchSet: 9 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith <keith(a)rhizomatica.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: keith <keith(a)rhizomatica.org> Gerrit-Comment-Date: Tue, 17 May 2022 09:40:37 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-e1-hardware[master]: Doc Update - Build process for DAHDI on Debian 11
by laforge 17 May '22

17 May '22
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27014 ) Change subject: Doc Update - Build process for DAHDI on Debian 11 ...................................................................... Patch Set 2: (2 comments) File doc/manuals/chapters/host-software.adoc: https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27014/comment/84cfca24_f3d8… PS1, Line 53: $ sudo apt-get install -y linux-headers-`uname -r` git dfu-util make gcc autoconf libtool > I think it should include 'libnewt-dev' as otherwise dahdi_tool will not be built, and I think it is […] Done https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27014/comment/503813ef_3575… PS1, Line 67: At this point you can plug in the icE1usb, and scan for it with `sudo dahdi_scan` which should list the two E1 ports on the iCE1usb. > it might make sense to expand a bit more, showing examle "dmesg" output, as well as stating that fil […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27014 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I0679bd14702b7b3d05c3346ce10358f45fef0301 Gerrit-Change-Number: 27014 Gerrit-PatchSet: 2 Gerrit-Owner: nickvsnetworking <nick(a)nickvsnetworking.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 17 May 2022 09:37:36 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • ...
  • 135
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.