hnbgw_mgw_setup: use mgcp_client_pool_empty()

Don't fall back to the legacy config if the pool is configured but no
connection to any pool member can be established.

Depends: osmo-mgw I009483ac9dfd6627e414f14d43b89f40ea4644db
Related: OS#5993
Change-Id: Icf3f3f0524c9d27f645c68851aaf9c6f33842927
This commit is contained in:
Oliver Smith 2023-04-04 14:58:20 +02:00
parent 612d3255b8
commit 8fd4159ea9
2 changed files with 7 additions and 2 deletions

View File

@ -10,3 +10,4 @@
osmo-hnbgw cfg config deprecated: 'sccp cr max-payload-len <0-999999>'
libosmo-sigtran >=1.7.0 Ensure SCCP CR max payload length of 130 bytes is enforced.
Uses osmo_scu_prim_hdr_name_c()
libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty()

View File

@ -693,8 +693,12 @@ static int hnbgw_mgw_setup(void)
/* 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) {
if (!mgcp_client_pool_empty(g_hnb_gw->mgw_pool)) {
pool_members_initalized = mgcp_client_pool_connect(g_hnb_gw->mgw_pool);
if (!pool_members_initalized) {
LOGP(DMGW, LOGL_ERROR, "MGW pool failed to initialize any pool members\n");
return -EINVAL;
}
LOGP(DMGW, LOGL_NOTICE,
"MGW pool with %u pool members configured, (ignoring MGW configuration in VTY node 'mgcp').\n",
pool_members_initalized);