Change in osmo-msc[master]: vty: Add option to enable osmux towards BSCs

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun May 19 07:28:02 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14038 )

Change subject: vty: Add option to enable osmux towards BSCs
......................................................................

vty: Add option to enable osmux towards BSCs

Change-Id: I6de1be0322ddbdc115074ebb6be2598ebf6c95db
---
M include/osmocom/msc/Makefile.am
M include/osmocom/msc/gsm_data.h
A include/osmocom/msc/osmux.h
M src/libmsc/msc_vty.c
M tests/test_nodes.vty
5 files changed, 40 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am
index 9ca4c38..0d7d45c 100644
--- a/include/osmocom/msc/Makefile.am
+++ b/include/osmocom/msc/Makefile.am
@@ -28,6 +28,7 @@
 	msc_t_remote.h \
 	msub.h \
 	neighbor_ident.h \
+	osmux.h \
 	paging.h \
 	ran_conn.h \
 	ran_infra.h \
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 42bb69a..f6e3ed9 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -19,6 +19,7 @@
 #include <osmocom/msc/neighbor_ident.h>
 
 #include "gsm_data_shared.h"
+#include "osmux.h"
 
 /** annotations for msgb ownership */
 #define __uses
@@ -231,6 +232,9 @@
 		uint64_t range_end;
 		uint64_t next;
 	} handover_number;
+
+	/* Whether we want to use Osmux against BSCs. Controlled via VTY */
+	enum osmux_usage use_osmux;
 };
 
 struct osmo_esme;
diff --git a/include/osmocom/msc/osmux.h b/include/osmocom/msc/osmux.h
new file mode 100644
index 0000000..7af32fc
--- /dev/null
+++ b/include/osmocom/msc/osmux.h
@@ -0,0 +1,11 @@
+#pragma once
+
+enum osmux_usage {
+	/* MSC won't use Osmux in call legs towards its RAN */
+	OSMUX_USAGE_OFF = 0,
+	/* MSC will use Osmux in call legs towards RAN as long as RAN announced support for it */
+	OSMUX_USAGE_ON = 1,
+	/* MSC will always use Osmux in call legs towards its RAN, and will
+	   reject calls for RANs which didn't announce support for it */
+	OSMUX_USAGE_ONLY = 2,
+};
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 5c58221..0c07bc2 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -59,6 +59,7 @@
 #include <osmocom/msc/gsm_04_14.h>
 #include <osmocom/msc/signal.h>
 #include <osmocom/msc/mncc_int.h>
+#include <osmocom/msc/osmux.h>
 #include <osmocom/msc/rrlp.h>
 #include <osmocom/msc/vlr_sgs.h>
 #include <osmocom/msc/sgs_vty.h>
@@ -565,6 +566,22 @@
 	return CMD_SUCCESS;
 }
 
+#define OSMUX_STR "RTP multiplexing\n"
+DEFUN(cfg_msc_osmux,
+      cfg_msc_osmux_cmd,
+      "osmux (on|off|only)",
+       OSMUX_STR "Enable OSMUX\n" "Disable OSMUX\n" "Only use OSMUX\n")
+{
+	if (strcmp(argv[0], "off") == 0)
+		gsmnet->use_osmux = OSMUX_USAGE_OFF;
+	else if (strcmp(argv[0], "on") == 0)
+		gsmnet->use_osmux = OSMUX_USAGE_ON;
+	else if (strcmp(argv[0], "only") == 0)
+		gsmnet->use_osmux = OSMUX_USAGE_ONLY;
+
+	return CMD_SUCCESS;
+}
+
 static int config_write_msc(struct vty *vty)
 {
 	vty_out(vty, "msc%s", VTY_NEWLINE);
@@ -615,6 +632,11 @@
 			gsmnet->handover_number.range_start, gsmnet->handover_number.range_end,
 			VTY_NEWLINE);
 
+	if (gsmnet->use_osmux != OSMUX_USAGE_OFF) {
+		vty_out(vty, " osmux %s%s", gsmnet->use_osmux == OSMUX_USAGE_ON ? "on" : "only",
+			VTY_NEWLINE);
+	}
+
 	mgcp_client_config_write(vty, " ");
 #ifdef BUILD_IU
 	ranap_iu_vty_config_write(vty, " ");
@@ -1757,6 +1779,7 @@
 	install_element(MSC_NODE, &cfg_msc_emergency_msisdn_cmd);
 	install_element(MSC_NODE, &cfg_msc_sms_over_gsup_cmd);
 	install_element(MSC_NODE, &cfg_msc_no_sms_over_gsup_cmd);
+	install_element(MSC_NODE, &cfg_msc_osmux_cmd);
 	install_element(MSC_NODE, &cfg_msc_handover_number_range_cmd);
 
 	neighbor_ident_vty_init(msc_network);
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index cdb3f8a..fb7b1c5 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -45,6 +45,7 @@
   emergency-call route-to-msisdn MSISDN
   sms-over-gsup
   no sms-over-gsup
+  osmux (on|off|only)
   handover-number range MSISDN_FIRST MSISDN_LAST
   neighbor (a|iu) lac <0-65535> (ran-pc|msc-ipa-name) RAN_PC_OR_MSC_IPA_NAME
   neighbor (a|iu) lac-ci <0-65535> <0-65535> (ran-pc|msc-ipa-name) RAN_PC_OR_MSC_IPA_NAME

-- 
To view, visit https://gerrit.osmocom.org/14038
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: I6de1be0322ddbdc115074ebb6be2598ebf6c95db
Gerrit-Change-Number: 14038
Gerrit-PatchSet: 4
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190519/99c442ed/attachment.html>


More information about the gerrit-log mailing list