From 377c1e3fd773b321c7a579b91250f8cd82390091 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 4 Apr 2023 14:48:55 +0200 Subject: [PATCH] bsc_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: I3a8418fb5841c71049ec91439143e1fe5553ed40 --- TODO-RELEASE | 3 ++- src/osmo-bsc/osmo_bsc_main.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/TODO-RELEASE b/TODO-RELEASE index 2658cdd1c..690e9ea2b 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -13,4 +13,5 @@ libosmogsm >1.8.0 circuit switched data stuff (gsm0808_enc/dec_channel_type etc.) libosmo-abis >1.4.0 osmo_ortp.h: add RTP_PT_CSDATA libosmo-sccp >1.7.0 osmo_sccp_{get,set}_priv() -libosmocore >1.8.0 GSM48_IE_CIP_MODE_SET_HO and GSM48_IE_SYNC_IND_HO \ No newline at end of file +libosmocore >1.8.0 GSM48_IE_CIP_MODE_SET_HO and GSM48_IE_SYNC_IND_HO +libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty() diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5866ec1d0..50cc0e099 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -839,8 +839,12 @@ static int bsc_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(bsc_gsmnet->mgw.mgw_pool); - if (pool_members_initalized) { + if (!mgcp_client_pool_empty(bsc_gsmnet->mgw.mgw_pool)) { + pool_members_initalized = mgcp_client_pool_connect(bsc_gsmnet->mgw.mgw_pool); + if (!pool_members_initalized) { + LOGP(DNM, LOGL_ERROR, "MGW pool failed to initialize any pool members\n"); + return -EINVAL; + } LOGP(DNM, LOGL_NOTICE, "MGW pool with %u pool members configured, (ignoring MGW configuration in VTY node 'msc').\n", pool_members_initalized);