[PATCH] osmo-msc[master]: mgcp: add VTY Option to force-realloc endpoints

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Aug 11 16:30:11 UTC 2017


Review at  https://gerrit.osmocom.org/3487

mgcp: add VTY Option to force-realloc endpoints

Currently the force_realloc feature is turnd on and of in a
hardcoded way. This patch makes the option available via VTY.

Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f
---
M src/libmgcp/mgcp_vty.c
M src/osmo-bsc_mgcp/mgcp_main.c
M src/osmo-bsc_nat/bsc_mgcp_utils.c
M src/osmo-bsc_nat/bsc_nat.c
4 files changed, 18 insertions(+), 2 deletions(-)


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

diff --git a/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c
index 7d4b2da..51889d9 100644
--- a/src/libmgcp/mgcp_vty.c
+++ b/src/libmgcp/mgcp_vty.c
@@ -591,6 +591,16 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_mgcp_force_realloc,
+      cfg_mgcp_force_realloc_cmd,
+      "force-realloc (0|1)",
+      "Force endpoint reallocation when the endpoint is still seized\n"
+      "Don't force reallocation\n" "force reallocation\n")
+{
+	g_cfg->trunk.force_realloc = atoi(argv[0]);
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_mgcp_number_endp,
       cfg_mgcp_number_endp_cmd,
       "number endpoints <0-65534>",
@@ -803,9 +813,10 @@
 				trunk->keepalive_interval, VTY_NEWLINE);
 		else
 			vty_out(vty, "  no rtp keep-alive%s", VTY_NEWLINE);
-
 		vty_out(vty, "  loop %d%s",
 			trunk->audio_loop, VTY_NEWLINE);
+		vty_out(vty, "  force-realloc %d%s",
+			trunk->force_realloc, VTY_NEWLINE);
 		if (trunk->omit_rtcp)
 			vty_out(vty, "  rtcp-omit%s", VTY_NEWLINE);
 		else
@@ -1379,6 +1390,7 @@
 	install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_number_cmd_old);
 	install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_name_cmd_old);
 	install_element(MGCP_NODE, &cfg_mgcp_loop_cmd);
+	install_element(MGCP_NODE, &cfg_mgcp_force_realloc_cmd);
 	install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd);
 	install_element(MGCP_NODE, &cfg_mgcp_omit_rtcp_cmd);
 	install_element(MGCP_NODE, &cfg_mgcp_no_omit_rtcp_cmd);
diff --git a/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c
index 4ea0700..6cf9ab7 100644
--- a/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/src/osmo-bsc_mgcp/mgcp_main.c
@@ -218,6 +218,8 @@
 	cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format;
 #endif
 
+	cfg->trunk.force_realloc = 1;
+
 	vty_info.copyright = openbsc_copyright;
 	vty_init(&vty_info);
 	logging_vty_add_cmds(NULL);
diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c
index 4884786..7df362f 100644
--- a/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -1101,7 +1101,6 @@
 	/* some more MGCP config handling */
 	cfg->data = nat;
 	cfg->policy_cb = bsc_mgcp_policy_cb;
-	cfg->trunk.force_realloc = 1;
 
 	if (cfg->bts_ip)
 		talloc_free(cfg->bts_ip);
diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c
index daa066d..d15ba87 100644
--- a/src/osmo-bsc_nat/bsc_nat.c
+++ b/src/osmo-bsc_nat/bsc_nat.c
@@ -1628,6 +1628,9 @@
 	rate_ctr_init(tall_bsc_ctx);
 	osmo_stats_init(tall_bsc_ctx);
 
+	/* Ensure that forced enpoint allocation is turned on by default */
+	cfg->trunk.force_realloc = 1;
+
 	/* init vty and parse */
 	if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) {
 		fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file);

-- 
To view, visit https://gerrit.osmocom.org/3487
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list