Change in openbsc[master]: Make alert notifications vty configurable per ESME

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Keith Whyte gerrit-no-reply at lists.osmocom.org
Thu Jan 17 00:29:45 UTC 2019


Keith Whyte has uploaded this change for review. ( https://gerrit.osmocom.org/12601


Change subject: Make alert notifications vty configurable per ESME
......................................................................

Make alert notifications vty configurable per ESME

OSMO-MSC backport

Adds (no) alert-notifications as a per-esme vty command,
in order to allow some ESMEs to be excluded from alerts.
The default is still to send alert notifications to all esme,
so no changes are required to the config file to maintain
identical operation after this patch.

Change-Id: I2b52f2778b24eebc82b2e5e2fb3c2250b1f9e5b0
---
M openbsc/src/libmsc/smpp_openbsc.c
M openbsc/src/libmsc/smpp_smsc.c
M openbsc/src/libmsc/smpp_smsc.h
M openbsc/src/libmsc/smpp_vty.c
4 files changed, 34 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/12601/1

diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index 3fe2dfd..f463e1c 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -278,8 +278,12 @@
 	llist_for_each_entry(esme, &smsc->esme_list, list) {
 		/* we currently send an alert notification to each ESME that is
 		 * connected, and do not require a (non-existant) delivery
-		 * pending flag to be set before,  FIXME: make this VTY
-		 * configurable */
+		 * pending flag to be set before. */
+		if (!esme->acl->alert_notifications) {
+			LOGP(DSMPP, LOGL_DEBUG,
+			"[%s] is not set to receive Alert Notifications\n", esme->system_id);
+			continue;
+		}
 		if (esme->acl && esme->acl->deliver_src_imsi) {
 			smpp_tx_alert(esme, TON_Subscriber_Number,
 				      NPI_Land_Mobile_E212,
diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c
index e4acd3a..35097b4 100644
--- a/openbsc/src/libmsc/smpp_smsc.c
+++ b/openbsc/src/libmsc/smpp_smsc.c
@@ -148,6 +148,7 @@
 
 	acl->smsc = smsc;
 	strcpy(acl->system_id, sys_id);
+	acl->alert_notifications = 1;
 	INIT_LLIST_HEAD(&acl->route_list);
 
 	llist_add_tail(&acl->list, &smsc->acl_list);
diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h
index 257383f..2398201 100644
--- a/openbsc/src/libmsc/smpp_smsc.h
+++ b/openbsc/src/libmsc/smpp_smsc.h
@@ -68,6 +68,7 @@
 	int deliver_src_imsi;
 	int osmocom_ext;
 	int dcs_transparent;
+	int alert_notifications;
 	struct llist_head route_list;
 };
 
diff --git a/openbsc/src/libmsc/smpp_vty.c b/openbsc/src/libmsc/smpp_vty.c
index 0a84358..ff0314e 100644
--- a/openbsc/src/libmsc/smpp_vty.c
+++ b/openbsc/src/libmsc/smpp_vty.c
@@ -499,6 +499,28 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_esme_alert_notif, cfg_esme_alert_notif_cmd,
+	"alert-notifications",
+	"Disable sending of SMPP Alert Notifications for this ESME")
+{
+	struct osmo_smpp_acl *acl = vty->index;
+
+	acl->alert_notifications = 1;
+
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_esme_no_alert_notif, cfg_esme_no_alert_notif_cmd,
+	"no alert-notifications", NO_STR
+	"Disable sending of SMPP Alert Notifications for this ESME")
+{
+	struct osmo_smpp_acl *acl = vty->index;
+
+	acl->alert_notifications = 0;
+
+	return CMD_SUCCESS;
+}
+
 
 static void dump_one_esme(struct vty *vty, struct osmo_esme *esme)
 {
@@ -560,6 +582,8 @@
 		vty_out(vty, "  osmocom-extensions%s", VTY_NEWLINE);
 	if (acl->dcs_transparent)
 		vty_out(vty, "  dcs-transparent%s", VTY_NEWLINE);
+	if (acl->alert_notifications)
+		vty_out(vty, "  alert-notifications%s", VTY_NEWLINE);
 
 	llist_for_each_entry(r, &acl->route_list, list)
 		write_esme_route_single(vty, r);
@@ -603,6 +627,8 @@
 	install_element(SMPP_ESME_NODE, &cfg_esme_no_osmo_ext_cmd);
 	install_element(SMPP_ESME_NODE, &cfg_esme_dcs_transp_cmd);
 	install_element(SMPP_ESME_NODE, &cfg_esme_no_dcs_transp_cmd);
+	install_element(SMPP_ESME_NODE, &cfg_esme_alert_notif_cmd);
+	install_element(SMPP_ESME_NODE, &cfg_esme_no_alert_notif_cmd);
 
 	install_element_ve(&show_esme_cmd);
 

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

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b52f2778b24eebc82b2e5e2fb3c2250b1f9e5b0
Gerrit-Change-Number: 12601
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte <keith at rhizomatica.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190117/9115ad23/attachment.htm>


More information about the gerrit-log mailing list