aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2023-04-04 14:27:42 +0200
committerosmith <osmith@sysmocom.de>2023-04-04 16:08:52 +0000
commit30cfe7174af10a4275fe42a0db5a644b5dd3fd82 (patch)
tree84e93ea8b71849bba219229fa9f5869279720b2e
parent7a5c8b525707b860e72b906f1b05de669ce946f6 (diff)
msc_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: I44e7b2723d801ceb03aaa2e5546802b4eb56b3c3
-rw-r--r--TODO-RELEASE1
-rw-r--r--src/osmo-msc/msc_main.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index d0852fc9b..a2695f2a5 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty()
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index c87749daf..7f60ea886 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -560,8 +560,12 @@ static int msc_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(msc_network->mgw.mgw_pool);
- if (pool_members_initalized) {
+ if (!mgcp_client_pool_empty(msc_network->mgw.mgw_pool)) {
+ pool_members_initalized = mgcp_client_pool_connect(msc_network->mgw.mgw_pool);
+ if (!pool_members_initalized) {
+ LOGP(DMSC, LOGL_ERROR, "MGW pool failed to initialize any pool members\n");
+ return -EINVAL;
+ }
LOGP(DMSC, LOGL_NOTICE,
"MGW pool with %u pool members configured, (ignoring MGW configuration in VTY node 'msc').\n",
pool_members_initalized);