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

October 2022

  • 2 participants
  • 2331 discussions
Change in osmo-mgw[master]: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
by pespin 19 Oct '22

19 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29808 ) Change subject: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node ...................................................................... mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node That command was already deprecated when the new commands without the "mgw" prefix were dropped, so there was no need to create a new command for it (since it shouldn't be used and it's currently implemented as a NOOP). However, the recent patch moved the install line out of the common function, which meant the command was not available anymore on the old node, and as a result old config files using it would fail to be parsed. This commit moves the command back to the common function so that it is still available for config files using the old node. Related: SYS#5987 Fixes: 8c138fe89cc070f860eca641481a092225b1247e Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29 --- M src/libosmo-mgcp-client/mgcp_client_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 6580710..390bacb 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -148,7 +148,7 @@ MGW_STR "remote port to reach the MGW at\n" "remote port\n") -DEFUN_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd, +DEFUN_DEPRECATED(cfg_mgw_mgw_endpoint_range, cfg_mgw_mgw_endpoint_range_cmd, "mgw endpoint-range <1-65534> <1-65534>", MGW_STR "DEPRECATED: the endpoint range cannot be defined by the client\n" "-\n" "-\n") @@ -158,7 +158,7 @@ VTY_NEWLINE); return CMD_SUCCESS; } -ALIAS_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd, +ALIAS_DEPRECATED(cfg_mgw_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd, "mgcpgw endpoint-range <1-65534> <1-65534>", MGW_STR "usable range of endpoint identifiers\n" "set first useable endpoint identifier\n" @@ -340,6 +340,7 @@ install_lib_element(node, &cfg_mgw_mgw_local_port_cmd); install_lib_element(node, &cfg_mgw_mgw_remote_ip_cmd); install_lib_element(node, &cfg_mgw_mgw_remote_port_cmd); + install_lib_element(node, &cfg_mgw_mgw_endpoint_range_cmd); install_lib_element(node, &cfg_mgw_mgw_endpoint_domain_name_cmd); install_lib_element(node, &cfg_mgw_mgw_reset_ep_name_cmd); install_lib_element(node, &cfg_mgw_mgw_no_reset_ep_name_cmd); @@ -593,7 +594,6 @@ install_lib_element(mgw_node, &cfg_mgw_local_port_cmd); install_lib_element(mgw_node, &cfg_mgw_remote_ip_cmd); install_lib_element(mgw_node, &cfg_mgw_remote_port_cmd); - install_lib_element(mgw_node, &cfg_mgw_endpoint_range_cmd); install_lib_element(mgw_node, &cfg_mgw_rtp_bts_base_port_cmd); install_lib_element(mgw_node, &cfg_mgw_endpoint_domain_name_cmd); install_lib_element(mgw_node, &cfg_mgw_reset_ep_name_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29 Gerrit-Change-Number: 29808 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
by osmith 19 Oct '22

19 Oct '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29808 ) Change subject: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29 Gerrit-Change-Number: 29808 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 19 Oct 2022 14:20:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
by pespin 19 Oct '22

19 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29808 ) Change subject: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node ...................................................................... mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node That command was already deprecated when the new commands without the "mgw" prefix were dropped, so there was no need to create a new command for it (since it shouldn't be used and it's currently implemented as a NOOP). However, the recent patch moved the install line out of the common function, which meant the command was not available anymore on the old node, and as a result old config files using it would fail to be parsed. This commit moves the command back to the common function so that it is still available for config files using the old node. Related: SYS#5987 Fixes: 8c138fe89cc070f860eca641481a092225b1247e Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29 --- M src/libosmo-mgcp-client/mgcp_client_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/29808/1 diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 6580710..390bacb 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -148,7 +148,7 @@ MGW_STR "remote port to reach the MGW at\n" "remote port\n") -DEFUN_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd, +DEFUN_DEPRECATED(cfg_mgw_mgw_endpoint_range, cfg_mgw_mgw_endpoint_range_cmd, "mgw endpoint-range <1-65534> <1-65534>", MGW_STR "DEPRECATED: the endpoint range cannot be defined by the client\n" "-\n" "-\n") @@ -158,7 +158,7 @@ VTY_NEWLINE); return CMD_SUCCESS; } -ALIAS_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd, +ALIAS_DEPRECATED(cfg_mgw_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd, "mgcpgw endpoint-range <1-65534> <1-65534>", MGW_STR "usable range of endpoint identifiers\n" "set first useable endpoint identifier\n" @@ -340,6 +340,7 @@ install_lib_element(node, &cfg_mgw_mgw_local_port_cmd); install_lib_element(node, &cfg_mgw_mgw_remote_ip_cmd); install_lib_element(node, &cfg_mgw_mgw_remote_port_cmd); + install_lib_element(node, &cfg_mgw_mgw_endpoint_range_cmd); install_lib_element(node, &cfg_mgw_mgw_endpoint_domain_name_cmd); install_lib_element(node, &cfg_mgw_mgw_reset_ep_name_cmd); install_lib_element(node, &cfg_mgw_mgw_no_reset_ep_name_cmd); @@ -593,7 +594,6 @@ install_lib_element(mgw_node, &cfg_mgw_local_port_cmd); install_lib_element(mgw_node, &cfg_mgw_remote_ip_cmd); install_lib_element(mgw_node, &cfg_mgw_remote_port_cmd); - install_lib_element(mgw_node, &cfg_mgw_endpoint_range_cmd); install_lib_element(mgw_node, &cfg_mgw_rtp_bts_base_port_cmd); install_lib_element(mgw_node, &cfg_mgw_endpoint_domain_name_cmd); install_lib_element(mgw_node, &cfg_mgw_reset_ep_name_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29 Gerrit-Change-Number: 29808 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-hnbgw[master]: Introduce support for libosmo-mgcp-client MGW pooling
by pespin 19 Oct '22

19 Oct '22
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29806 to look at the new patch set (#2). Change subject: Introduce support for libosmo-mgcp-client MGW pooling ...................................................................... Introduce support for libosmo-mgcp-client MGW pooling Large RAN installations may benefit from distributing the RTP voice stream load over multiple media gateways. libosmo-mgcp-client supports MGW pooling since version 1.8.0 (more than one year ago). OsmoBSC has already been making use of it since then (see osmo-bsc.git 8d22e6870637ed6d392a8a77aeaebc51b23a8a50); lets use this feature in osmo-hngw too. This commit is also part of a series of patches cleaning up libosmo-mgcp-client and slowly getting rid of the old non-mgw-pooled VTY configuration, in order to keep only 1 way to configure libosmo-mgcp-client through VTY. Related: SYS#5091 Related: SYS#5987 Change-Id: I371dc773b58788ee21037dc25d77f556c89c6b61 --- M doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg M doc/examples/osmo-hnbgw/osmo-hnbgw.cfg M doc/manuals/chapters/running.adoc M include/osmocom/hnbgw/hnbgw.h M include/osmocom/hnbgw/vty.h M src/osmo-hnbgw/hnbgw.c M src/osmo-hnbgw/hnbgw_vty.c M src/osmo-hnbgw/mgw_fsm.c M tests/ranap_rab_ass/Makefile.am 9 files changed, 82 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/06/29806/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I371dc773b58788ee21037dc25d77f556c89c6b61 Gerrit-Change-Number: 29806 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-hnbgw[master]: Makefile.am: Drop duplicated LIBOSMOMGCPCLIENT_LIBS
by pespin 19 Oct '22

19 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29807 ) Change subject: Makefile.am: Drop duplicated LIBOSMOMGCPCLIENT_LIBS ...................................................................... Makefile.am: Drop duplicated LIBOSMOMGCPCLIENT_LIBS Change-Id: Ie52f27bcacca60cc16b49142edb79a3e58dff131 --- M src/osmo-hnbgw/Makefile.am 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/07/29807/1 diff --git a/src/osmo-hnbgw/Makefile.am b/src/osmo-hnbgw/Makefile.am index 1d907ba..a6cf5ea 100644 --- a/src/osmo-hnbgw/Makefile.am +++ b/src/osmo-hnbgw/Makefile.am @@ -55,7 +55,6 @@ $(LIBOSMORUA_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOHNBAP_LIBS) \ - $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBSCTP_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29807 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ie52f27bcacca60cc16b49142edb79a3e58dff131 Gerrit-Change-Number: 29807 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-hnbgw[master]: Introduce support for libosmo-mgcp-client MGW pooling
by pespin 19 Oct '22

19 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29806 ) Change subject: Introduce support for libosmo-mgcp-client MGW pooling ...................................................................... Introduce support for libosmo-mgcp-client MGW pooling Large RAN installations may benefit from distributing the RTP voice stream load over multiple media gateways. libosmo-mgcp-client supports MGW pooling since version 1.8.0 (more than one year ago). OsmoBSC has already been making use of it since then (see osmo-bsc.git 8d22e6870637ed6d392a8a77aeaebc51b23a8a50); lets use this feature in osmo-hngw too. This commit is also part of a series of patches cleaning up libosmo-mgcp-client and slowly getting rid of the old non-mgw-pooled VTY configuration, in order to keep only 1 way to configure libosmo-mgcp-client through VTY. Related: SYS#5091 Related: SYS#5987 Change-Id: I371dc773b58788ee21037dc25d77f556c89c6b61 --- M doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg M doc/examples/osmo-hnbgw/osmo-hnbgw.cfg M doc/manuals/chapters/running.adoc M include/osmocom/hnbgw/hnbgw.h M include/osmocom/hnbgw/vty.h M src/osmo-hnbgw/hnbgw.c M src/osmo-hnbgw/hnbgw_vty.c M src/osmo-hnbgw/mgw_fsm.c 8 files changed, 80 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/06/29806/1 diff --git a/doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg b/doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg index 619b29b..cc853d5 100644 --- a/doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg +++ b/doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg @@ -11,11 +11,11 @@ iuh local-ip 0.0.0.0 hnbap-allow-tmsi 1 - mgcp - mgw remote-ip 127.0.0.1 - mgw local-port 2729 - mgw remote-port 2427 - mgw reset-endpoint rtpbridge/* + mgw 0 + remote-ip 127.0.0.1 + local-port 2729 + remote-port 2427 + reset-endpoint rtpbridge/* pfcp remote-addr 127.0.0.2 local-addr 127.0.0.1 diff --git a/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg b/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg index b7f41e1..82731a8 100644 --- a/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg +++ b/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg @@ -11,9 +11,9 @@ iuh local-ip 0.0.0.0 hnbap-allow-tmsi 1 - mgcp - mgw remote-ip 127.0.0.1 - mgw local-port 2729 - mgw remote-port 2427 - mgw reset-endpoint rtpbridge/* + mgw 0 + remote-ip 127.0.0.1 + local-port 2729 + remote-port 2427 + reset-endpoint rtpbridge/* diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc index e575215..ee4b832 100644 --- a/doc/manuals/chapters/running.adoc +++ b/doc/manuals/chapters/running.adoc @@ -136,10 +136,10 @@ ---- hnbgw - mgcp - mgw remote-ip 127.0.0.1 - mgw remote-port 2427 - mgw reset-endpoint rtpbridge/* + mgw 0 + remote-ip 127.0.0.1 + remote-port 2427 + reset-endpoint rtpbridge/* ---- ==== Configure co-located User Plane Function diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index 778fa45..8adefea 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -10,6 +10,8 @@ #define DEBUG #include <osmocom/core/logging.h> +#include <osmocom/mgcp_client/mgcp_client.h> +#include <osmocom/mgcp_client/mgcp_client_pool.h> enum { DMAIN, @@ -160,7 +162,9 @@ struct osmo_sccp_addr iucs_remote_addr; struct osmo_sccp_addr iups_remote_addr; } sccp; - struct mgcp_client *mgcp_client; + /* MGW pool, also includes the single MGCP client as fallback if no + * pool is configured. */ + struct mgcp_client_pool *mgw_pool; struct { struct osmo_pfcp_endpoint *ep; diff --git a/include/osmocom/hnbgw/vty.h b/include/osmocom/hnbgw/vty.h index e97a1ad..cf4a1eb 100644 --- a/include/osmocom/hnbgw/vty.h +++ b/include/osmocom/hnbgw/vty.h @@ -8,6 +8,7 @@ IUCS_NODE, IUPS_NODE, MGCP_NODE, + MGW_NODE, PFCP_NODE, }; diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index ce5e5e4..f0d50f9 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -104,6 +104,7 @@ context_map_init(gw); + gw->mgw_pool = mgcp_client_pool_alloc(gw); gw->config.mgcp_client = talloc_zero(tall_hnb_ctx, struct mgcp_client_conf); mgcp_client_conf_init(gw->config.mgcp_client); @@ -673,6 +674,41 @@ return 1; } +static int hnbgw_mgw_setup(void) +{ + struct mgcp_client *mgcp_client_single; + unsigned int pool_members_initalized; + + /* Initialize MGW pool. This initalizes and connects all MGCP clients that are currently configured in + * the pool. Adding additional MGCP clients to the pool is possible but the user has to configure and + * (re)connect them manually from the VTY. */ + pool_members_initalized = mgcp_client_pool_connect(g_hnb_gw->mgw_pool); + if (pool_members_initalized) { + LOGP(DMGW, LOGL_NOTICE, + "MGW pool with %u pool members configured, (ignoring MGW configuration in VTY node 'msc').\n", + pool_members_initalized); + return 0; + } + + /* Initialize and connect a single MGCP client. This MGCP client will appear as the one and only pool + * member if there is no MGW pool configured. */ + LOGP(DMGW, LOGL_NOTICE, "No MGW pool configured, using MGW configuration in VTY node 'mgcp'\n"); + mgcp_client_single = mgcp_client_init(tall_hnb_ctx, g_hnb_gw->config.mgcp_client); + if (!mgcp_client_single) { + LOGP(DMGW, LOGL_ERROR, "MGW (single) client initalization failed\n"); + return -EINVAL; + } + if (mgcp_client_connect(mgcp_client_single)) { + LOGP(DMGW, LOGL_ERROR, "MGW (single) connect failed at (%s:%u)\n", + g_hnb_gw->config.mgcp_client->remote_addr, + g_hnb_gw->config.mgcp_client->remote_port); + return -EINVAL; + } + mgcp_client_pool_register_single(g_hnb_gw->mgw_pool, mgcp_client_single); + + return 0; +} + int main(int argc, char **argv) { struct osmo_stream_srv_link *srv; @@ -784,17 +820,8 @@ g_hnb_gw->iuh = srv; /* Initialize and connect MGCP client. */ - g_hnb_gw->mgcp_client = mgcp_client_init(tall_hnb_ctx, g_hnb_gw->config.mgcp_client); - if (!g_hnb_gw->mgcp_client) { - LOGP(DMGW, LOGL_ERROR, "MGW client initalization failed\n"); + if (hnbgw_mgw_setup() != 0) return -EINVAL; - } - if (mgcp_client_connect(g_hnb_gw->mgcp_client)) { - LOGP(DMGW, LOGL_ERROR, "MGW connect failed at (%s:%u)\n", - g_hnb_gw->config.mgcp_client->remote_addr, - g_hnb_gw->config.mgcp_client->remote_port); - return -EINVAL; - } #if ENABLE_PFCP /* If UPF is configured, set up PFCP socket and send Association Setup Request to UPF */ diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c index 3f76c6f..2228260 100644 --- a/src/osmo-hnbgw/hnbgw_vty.c +++ b/src/osmo-hnbgw/hnbgw_vty.c @@ -464,14 +464,6 @@ return CMD_SUCCESS; } -static int config_write_hnbgw_mgcp(struct vty *vty) -{ - vty_out(vty, " mgcp%s", VTY_NEWLINE); - mgcp_client_config_write(vty, " "); - - return CMD_SUCCESS; -} - #if ENABLE_PFCP static int config_write_hnbgw_pfcp(struct vty *vty) { @@ -521,7 +513,11 @@ install_element_ve(&show_talloc_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_mgcp_cmd); - install_node(&mgcp_node, config_write_hnbgw_mgcp); + /* Deprecated: Old MGCP config without pooling support in MSC node: */ + install_node(&mgcp_node, NULL); + mgcp_client_vty_init(tall_hnb_ctx, MGCP_NODE, g_hnb_gw->config.mgcp_client); + + mgcp_client_pool_vty_init(HNBGW_NODE, MGW_NODE, " ", g_hnb_gw->mgw_pool); #if ENABLE_PFCP install_node(&pfcp_node, config_write_hnbgw_pfcp); @@ -531,6 +527,5 @@ install_element(PFCP_NODE, &cfg_pfcp_remote_addr_cmd); #endif - mgcp_client_vty_init(tall_hnb_ctx, MGCP_NODE, g_hnb_gw->config.mgcp_client); osmo_tdef_vty_groups_init(HNBGW_NODE, hnbgw_tdef_group); } diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c index 8e42f58..b58d01f 100644 --- a/src/osmo-hnbgw/mgw_fsm.c +++ b/src/osmo-hnbgw/mgw_fsm.c @@ -141,6 +141,7 @@ RANAP_RAB_AssignmentRequestIEs_t *ies; const char *epname; struct mgcp_conn_peer mgw_info; + struct mgcp_client *mgcp_client; int rc; LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentRequest received, creating HNB side call-leg on MGW...\n"); @@ -172,9 +173,16 @@ mgw_info.codecs[0] = CODEC_IUFP; mgw_info.codecs_len = 1; - epname = mgcp_client_rtpbridge_wildcard(map->hnb_ctx->gw->mgcp_client); + mgcp_client = mgcp_client_pool_get(map->hnb_ctx->gw->mgw_pool); + if (!mgcp_client) { + LOGPFSML(fi, LOGL_ERROR, + "cannot ensure MGW endpoint -- no MGW configured, check configuration!\n"); + osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); + return; + } + epname = mgcp_client_rtpbridge_wildcard(mgcp_client); mgw_fsm_priv->mgcpc_ep = - osmo_mgcpc_ep_alloc(fi, MGW_EV_MGCP_TERM, map->hnb_ctx->gw->mgcp_client, mgw_fsm_T_defs, fi->id, "%s", epname); + osmo_mgcpc_ep_alloc(fi, MGW_EV_MGCP_TERM, mgcp_client, mgw_fsm_T_defs, fi->id, "%s", epname); mgw_fsm_priv->mgcpc_ep_ci_hnb = osmo_mgcpc_ep_ci_add(mgw_fsm_priv->mgcpc_ep, "to-HNB"); osmo_mgcpc_ep_ci_request(mgw_fsm_priv->mgcpc_ep_ci_hnb, MGCP_VERB_CRCX, &mgw_info, fi, MGW_EV_MGCP_OK, @@ -488,9 +496,13 @@ static void mgw_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct mgw_fsm_priv *mgw_fsm_priv = fi->priv; + struct mgcp_client *mgcp_client; switch (event) { case MGW_EV_MGCP_TERM: + /* Put MGCP client back into MGW pool */ + mgcp_client = osmo_mgcpc_ep_client(mgw_fsm_priv->mgcpc_ep); + mgcp_client_pool_put(mgcp_client); mgw_fsm_priv->mgcpc_ep = NULL; LOGPFSML(fi, LOGL_ERROR, "Media gateway failed\n"); osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); @@ -547,6 +559,10 @@ struct hnbgw_context_map *map = mgw_fsm_priv->map; if (mgw_fsm_priv->mgcpc_ep) { + /* Put MGCP client back into MGW pool */ + struct mgcp_client *mgcp_client = osmo_mgcpc_ep_client(mgw_fsm_priv->mgcpc_ep); + mgcp_client_pool_put(mgcp_client); + osmo_mgcpc_ep_clear(mgw_fsm_priv->mgcpc_ep); mgw_fsm_priv->mgcpc_ep = NULL; } -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I371dc773b58788ee21037dc25d77f556c89c6b61 Gerrit-Change-Number: 29806 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-msc[master]: Use new mgcp-client VTY commands under mgw node
by pespin 19 Oct '22

19 Oct '22
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/29803 to look at the new patch set (#3). Change subject: Use new mgcp-client VTY commands under mgw node ...................................................................... Use new mgcp-client VTY commands under mgw node New VTY commands have been added recently to the "mgw" node which drop the redundant "mgw" prefix on each fo them. Change-Id: I8ac11388e9493416b644812638e1374251725584 Depends: osmo-mgw.git Change-Id: Id55af13d2ecde49d968b9dca6a2f8108a17ec484 Related: SYS#5987 --- M doc/examples/osmo-msc/osmo-msc.cfg M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg M doc/manuals/chapters/running.adoc M tests/test_nodes.vty 5 files changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/03/29803/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/29803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I8ac11388e9493416b644812638e1374251725584 Gerrit-Change-Number: 29803 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Add new VTY commands under mgw node without mgw prefix
by pespin 19 Oct '22

19 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29800 ) Change subject: mgcp-client: Add new VTY commands under mgw node without mgw prefix ...................................................................... mgcp-client: Add new VTY commands under mgw node without mgw prefix Previous existing ones are left marked as deprecated, to avoid breakage with older configs. Related: SYS#5987 Change-Id: Id55af13d2ecde49d968b9dca6a2f8108a17ec484 --- M src/libosmo-mgcp-client/mgcp_client_vty.c 1 file changed, 75 insertions(+), 29 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index b571fa0..6580710 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -62,8 +62,8 @@ } DEFUN(cfg_mgw_local_ip, cfg_mgw_local_ip_cmd, - "mgw local-ip " VTY_IPV46_CMD, - MGW_STR "local bind to connect to MGW from\n" + "local-ip " VTY_IPV46_CMD, + "local bind to connect to MGW from\n" "local bind IPv4 address\n" "local bind IPv6 address\n") { @@ -78,10 +78,16 @@ "mgcpgw local-ip A.B.C.D", MGW_STR "local bind to connect to MGCP gateway with\n" "local bind IP address\n") +ALIAS_DEPRECATED(cfg_mgw_local_ip, + cfg_mgw_mgw_local_ip_cmd, + "mgw local-ip " VTY_IPV46_CMD, + MGW_STR "local bind to connect to MGW from\n" + "local bind IPv4 address\n" + "local bind IPv6 address\n") DEFUN(cfg_mgw_local_port, cfg_mgw_local_port_cmd, - "mgw local-port <0-65535>", - MGW_STR "local port to connect to MGW from\n" + "local-port <0-65535>", + "local port to connect to MGW from\n" "local bind port\n") { struct mgcp_client_conf *conf = get_mgcp_client_config(vty); @@ -93,10 +99,15 @@ "mgcpgw local-port <0-65535>", MGW_STR "local bind to connect to MGCP gateway with\n" "local bind port\n") +ALIAS_DEPRECATED(cfg_mgw_local_port, + cfg_mgw_mgw_local_port_cmd, + "mgw local-port <0-65535>", + MGW_STR "local port to connect to MGW from\n" + "local bind port\n") DEFUN(cfg_mgw_remote_ip, cfg_mgw_remote_ip_cmd, - "mgw remote-ip " VTY_IPV46_CMD, - MGW_STR "remote IP address to reach the MGW at\n" + "remote-ip " VTY_IPV46_CMD, + "remote IP address to reach the MGW at\n" "remote IPv4 address\n" "remote IPv6 address\n") { @@ -110,10 +121,16 @@ "mgcpgw remote-ip A.B.C.D", MGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind IP address\n") +ALIAS_DEPRECATED(cfg_mgw_remote_ip, + cfg_mgw_mgw_remote_ip_cmd, + "mgw remote-ip " VTY_IPV46_CMD, + MGW_STR "remote IP address to reach the MGW at\n" + "remote IPv4 address\n" + "remote IPv6 address\n") DEFUN(cfg_mgw_remote_port, cfg_mgw_remote_port_cmd, - "mgw remote-port <0-65535>", - MGW_STR "remote port to reach the MGW at\n" + "remote-port <0-65535>", + "remote port to reach the MGW at\n" "remote port\n") { struct mgcp_client_conf *conf = get_mgcp_client_config(vty); @@ -125,6 +142,11 @@ "mgcpgw remote-port <0-65535>", MGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind port\n") +ALIAS_DEPRECATED(cfg_mgw_remote_port, + cfg_mgw_mgw_remote_port_cmd, + "mgw remote-port <0-65535>", + MGW_STR "remote port to reach the MGW at\n" + "remote port\n") DEFUN_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd, "mgw endpoint-range <1-65534> <1-65534>", @@ -164,8 +186,8 @@ DEFUN(cfg_mgw_endpoint_domain_name, cfg_mgw_endpoint_domain_name_cmd, - "mgw endpoint-domain NAME", - MGW_STR "Set the domain name to send in MGCP messages, e.g. the part 'foo' in 'rtpbridge/*@foo'.\n" + "endpoint-domain NAME", + "Set the domain name to send in MGCP messages, e.g. the part 'foo' in 'rtpbridge/*@foo'.\n" "Domain name, should be alphanumeric.\n") { struct mgcp_client_conf *conf = get_mgcp_client_config(vty); @@ -178,11 +200,16 @@ } return CMD_SUCCESS; } +ALIAS_DEPRECATED(cfg_mgw_endpoint_domain_name, + cfg_mgw_mgw_endpoint_domain_name_cmd, + "mgw endpoint-domain NAME", + MGW_STR "Set the domain name to send in MGCP messages, e.g. the part 'foo' in 'rtpbridge/*@foo'.\n" + "Domain name, should be alphanumeric.\n") DEFUN(cfg_mgw_reset_ep_name, cfg_mgw_reset_ep_name_cmd, - "mgw reset-endpoint NAME", - MGW_STR "Add an endpoint name that should be reset (DLCX) on connect to the reset-endpoint list," + "reset-endpoint NAME", + "Add an endpoint name that should be reset (DLCX) on connect to the reset-endpoint list," "e.g. 'rtpbridge/*'\n" "Endpoint name, e.g. 'rtpbridge/*' or 'ds/e1-0/s-3/su16-4'.\n") { @@ -220,11 +247,17 @@ return CMD_SUCCESS; } +ALIAS_DEPRECATED(cfg_mgw_reset_ep_name, + cfg_mgw_mgw_reset_ep_name_cmd, + "mgw reset-endpoint NAME", + MGW_STR "Add an endpoint name that should be reset (DLCX) on connect to the reset-endpoint list," + "e.g. 'rtpbridge/*'\n" + "Endpoint name, e.g. 'rtpbridge/*' or 'ds/e1-0/s-3/su16-4'.\n") DEFUN(cfg_mgw_no_reset_ep_name, cfg_mgw_no_reset_ep_name_cmd, - "no mgw reset-endpoint NAME", - NO_STR MGW_STR "remove an endpoint name from the reset-endpoint list, e.g. 'rtpbridge/*'\n" + "no reset-endpoint NAME", + NO_STR "remove an endpoint name from the reset-endpoint list, e.g. 'rtpbridge/*'\n" "Endpoint name, e.g. 'rtpbridge/*' or 'ds/e1-0/s-3/su16-4'.\n") { struct reset_ep *reset_ep; @@ -241,6 +274,11 @@ vty_out(vty, "%% no such endpoint name configured ('%s')%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } +ALIAS_DEPRECATED(cfg_mgw_no_reset_ep_name, + cfg_mgw_mgw_no_reset_ep_name_cmd, + "no mgw reset-endpoint NAME", + NO_STR MGW_STR "remove an endpoint name from the reset-endpoint list, e.g. 'rtpbridge/*'\n" + "Endpoint name, e.g. 'rtpbridge/*' or 'ds/e1-0/s-3/su16-4'.\n") static int config_write(struct vty *vty, const char *indent, struct mgcp_client_conf *conf) { @@ -253,28 +291,28 @@ addr = conf->local_addr; if (addr) - vty_out(vty, "%smgw local-ip %s%s", indent, addr, + vty_out(vty, "%slocal-ip %s%s", indent, addr, VTY_NEWLINE); port = conf->local_port; if (port >= 0) - vty_out(vty, "%smgw local-port %u%s", indent, + vty_out(vty, "%slocal-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); addr = conf->remote_addr; if (addr) - vty_out(vty, "%smgw remote-ip %s%s", indent, addr, + vty_out(vty, "%sremote-ip %s%s", indent, addr, VTY_NEWLINE); port = conf->remote_port; if (port >= 0) - vty_out(vty, "%smgw remote-port %u%s", indent, + vty_out(vty, "%sremote-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); if (conf->endpoint_domain_name[0]) - vty_out(vty, "%smgw endpoint-domain %s%s", indent, + vty_out(vty, "%sendpoint-domain %s%s", indent, conf->endpoint_domain_name, VTY_NEWLINE); llist_for_each_entry(reset_ep, &conf->reset_epnames, list) - vty_out(vty, "%smgw reset-endpoint %s%s", indent, reset_ep->name, VTY_NEWLINE); + vty_out(vty, "%sreset-endpoint %s%s", indent, reset_ep->name, VTY_NEWLINE); return CMD_SUCCESS; } @@ -297,15 +335,14 @@ { global_mgcp_client_ctx = talloc_ctx; - install_lib_element(node, &cfg_mgw_local_ip_cmd); - install_lib_element(node, &cfg_mgw_local_port_cmd); - install_lib_element(node, &cfg_mgw_remote_ip_cmd); - install_lib_element(node, &cfg_mgw_remote_port_cmd); - install_lib_element(node, &cfg_mgw_endpoint_range_cmd); - install_lib_element(node, &cfg_mgw_rtp_bts_base_port_cmd); - install_lib_element(node, &cfg_mgw_endpoint_domain_name_cmd); - install_lib_element(node, &cfg_mgw_reset_ep_name_cmd); - install_lib_element(node, &cfg_mgw_no_reset_ep_name_cmd); + /* deprecated 'mgw' commands ('mgw' prepended as first arg) */ + install_lib_element(node, &cfg_mgw_mgw_local_ip_cmd); + install_lib_element(node, &cfg_mgw_mgw_local_port_cmd); + install_lib_element(node, &cfg_mgw_mgw_remote_ip_cmd); + install_lib_element(node, &cfg_mgw_mgw_remote_port_cmd); + install_lib_element(node, &cfg_mgw_mgw_endpoint_domain_name_cmd); + install_lib_element(node, &cfg_mgw_mgw_reset_ep_name_cmd); + install_lib_element(node, &cfg_mgw_mgw_no_reset_ep_name_cmd); osmo_fsm_vty_add_cmds(); } @@ -552,6 +589,15 @@ * config */ install_node(pool->vty_node, config_write_pool); vty_init_common(pool, mgw_node); + install_lib_element(mgw_node, &cfg_mgw_local_ip_cmd); + install_lib_element(mgw_node, &cfg_mgw_local_port_cmd); + install_lib_element(mgw_node, &cfg_mgw_remote_ip_cmd); + install_lib_element(mgw_node, &cfg_mgw_remote_port_cmd); + install_lib_element(mgw_node, &cfg_mgw_endpoint_range_cmd); + install_lib_element(mgw_node, &cfg_mgw_rtp_bts_base_port_cmd); + install_lib_element(mgw_node, &cfg_mgw_endpoint_domain_name_cmd); + install_lib_element(mgw_node, &cfg_mgw_reset_ep_name_cmd); + install_lib_element(mgw_node, &cfg_mgw_no_reset_ep_name_cmd); install_element(mgw_node, &cfg_description_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29800 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Id55af13d2ecde49d968b9dca6a2f8108a17ec484 Gerrit-Change-Number: 29800 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Introduce API mgcp_client_pool_config_write
by pespin 19 Oct '22

19 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29795 ) Change subject: mgcp-client: Introduce API mgcp_client_pool_config_write ...................................................................... mgcp-client: Introduce API mgcp_client_pool_config_write It is not a good idea to use a personal write_config function for the MGW node, since it's not meant to be a 1st level (top) node. During write-config the node function will be called at an implementation specific time (based on the order defined by the app in the node type enum), so there's no real way to control that the output of the MGW node will end up under the parent configured in mgcp_client_pool_vty_init(). As mentioned the order can be tweaked based on how the node enums are configured, installed, etc. but that's really a nightmare, so let's better not rely on that. Therefore, this patch introduces a new API which the users (apps such as OsmoBSc and OsmoMSC) can use to write the config at the required time (when writing its own parent node). A hack is introduced internally to detect older versions of the users which didn't call this function to still print stuff (up to to the app if the order is correct). Related: SYS#5987 Change-Id: I7a620cf47886d8ecab30ce369cf123d98ab842c5 --- M TODO-RELEASE M include/osmocom/mgcp_client/mgcp_client_pool.h M src/libosmo-mgcp-client/mgcp_client_vty.c 3 files changed, 47 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 5fe3d53..3e10bf9 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -26,4 +26,4 @@ #library what description / commit summary line libosmo-netif >1.2.0 OSMUX_DEFAULT_PORT, osmux_xfrm_output_*, osmux_xfrm_input_* libosmocore >1.7.0 osmo_sockaddr_is_any() -libmgcp-client NEW APIs mgcp_client_pool_member_...() \ No newline at end of file +libmgcp-client NEW APIs mgcp_client_pool_member_...(), mgcp_client_pool_config_write() \ No newline at end of file diff --git a/include/osmocom/mgcp_client/mgcp_client_pool.h b/include/osmocom/mgcp_client/mgcp_client_pool.h index b547b78..46d7e90 100644 --- a/include/osmocom/mgcp_client/mgcp_client_pool.h +++ b/include/osmocom/mgcp_client/mgcp_client_pool.h @@ -9,6 +9,7 @@ struct mgcp_client_pool *mgcp_client_pool_alloc(void *talloc_ctx); void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent, struct mgcp_client_pool *pool); +int mgcp_client_pool_config_write(struct vty *vty, const char *indent); unsigned int mgcp_client_pool_connect(struct mgcp_client_pool *pool); void mgcp_client_pool_register_single(struct mgcp_client_pool *pool, struct mgcp_client *mgcp_client); diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1672f97..b571fa0 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -330,18 +330,46 @@ vty_init_common(talloc_ctx, node); } +/* Deprecated, used for backward compatibility with older users which didn't call + * mgcp_client_pool_config_write(): */ +static bool mgcp_client_pool_config_write_called = false; static int config_write_pool(struct vty *vty) { + int rc; + if (mgcp_client_pool_config_write_called) + return CMD_SUCCESS; + + rc = mgcp_client_pool_config_write(vty, NULL); + /* mgcp_client_pool_config_write sets this to true, let's reset it */ + mgcp_client_pool_config_write_called = false; + return rc; +} + +/*! Write out MGCP client config to VTY. + * \param[in] vty VTY to which we should print. + * \param[in] indent string used for indentation (e.g. " "). + If NULL, indentation passed during mgcp_client_pool_vty_init() will be used. + * \returns CMD_SUCCESS on success, CMD_WARNING on error */ +int mgcp_client_pool_config_write(struct vty *vty, const char *indent) +{ struct mgcp_client_pool *pool = global_mgcp_client_pool; struct mgcp_client_pool_member *pool_member; - unsigned int indent_buf_len = strlen(pool->vty_indent) + 1 + 1; - char *indent = talloc_zero_size(vty, indent_buf_len); + unsigned int subindent_buf_len; + char *subindent; - snprintf(indent, indent_buf_len, "%s ", pool->vty_indent); + /* Tell internal node write function that the user supports calling proper API: */ + mgcp_client_pool_config_write_called = true; + + if (!indent) + indent = pool->vty_indent ? : ""; + subindent_buf_len = strlen(indent) + 1 + 1; + subindent = talloc_zero_size(vty, subindent_buf_len); + + snprintf(subindent, subindent_buf_len, "%s ", indent); llist_for_each_entry(pool_member, &pool->member_list, list) { - vty_out(vty, "%smgw %u%s", pool->vty_indent, pool_member->nr, VTY_NEWLINE); - config_write(vty, indent, &pool_member->conf); + vty_out(vty, "%smgw %u%s", indent, pool_member->nr, VTY_NEWLINE); + config_write(vty, subindent, &pool_member->conf); } /* MGW pool API is supported by user (global_mgcp_client_pool is set @@ -350,11 +378,11 @@ * replacing it, then output the single MGW converted to the new MGW * pool VTY. */ if (llist_empty(&pool->member_list) && pool->mgcp_client_single) { - vty_out(vty, "%smgw 0%s", pool->vty_indent, VTY_NEWLINE); - config_write(vty, indent, global_mgcp_client_conf); + vty_out(vty, "%smgw 0%s", indent, VTY_NEWLINE); + config_write(vty, subindent, global_mgcp_client_conf); } - talloc_free(indent); + talloc_free(subindent); return CMD_SUCCESS; } @@ -495,7 +523,8 @@ * (called once at startup by the application process). * \param[in] parent_node identifier of the parent node on which the mgw node appears. * \param[in] mgw_node identifier that should be used with the newly installed MGW node. - * \param[in] indent indentation string to match the indentation in the VTY config + * \param[in] indent indentation string to match the indentation in the VTY config. + If NULL, it must be passed explicitly each time mgcp_client_pool_config_write() is called. * \param[in] pool user provided memory to store the configured MGCP client (MGW) pool. */ void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent, struct mgcp_client_pool *pool) { @@ -503,11 +532,12 @@ OSMO_ASSERT(pool); /* Never allow this function to be called twice on the same pool */ - OSMO_ASSERT(!pool->vty_indent); OSMO_ASSERT(!pool->vty_node); - pool->vty_indent = talloc_strdup(pool, indent); - OSMO_ASSERT(pool->vty_indent); + if (indent) { + pool->vty_indent = talloc_strdup(pool, indent); + OSMO_ASSERT(pool->vty_indent); + } pool->vty_node = talloc_zero(pool, struct cmd_node); OSMO_ASSERT(pool->vty_node); pool->vty_node->node = mgw_node; @@ -517,6 +547,9 @@ install_lib_element(parent_node, &cfg_mgw_cmd); install_lib_element(parent_node, &cfg_no_mgw_cmd); + /* Note: config_write_pool is deprecated and user is expected to + * manually call mgcp_client_pool_config_write() when printing the VTY + * config */ install_node(pool->vty_node, config_write_pool); vty_init_common(pool, mgw_node); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I7a620cf47886d8ecab30ce369cf123d98ab842c5 Gerrit-Change-Number: 29795 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Introduce API mgcp_client_pool_config_write
by pespin 19 Oct '22

19 Oct '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29795 ) Change subject: mgcp-client: Introduce API mgcp_client_pool_config_write ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I7a620cf47886d8ecab30ce369cf123d98ab842c5 Gerrit-Change-Number: 29795 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 19 Oct 2022 11:55:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • ...
  • 234
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.