osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/32206 )


Change subject: msc_mgw_setup: use mgcp_client_pool_empty()
......................................................................

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.

Related: OS#5993
Change-Id: I44e7b2723d801ceb03aaa2e5546802b4eb56b3c3
---
M TODO-RELEASE
M src/osmo-msc/msc_main.c
2 files changed, 24 insertions(+), 6 deletions(-)



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

diff --git a/TODO-RELEASE b/TODO-RELEASE
index d0852fc..a2695f2 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 a1e91ce..9417c0b 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -560,12 +560,16 @@
        /* 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) {
-               LOGP(DMSC, LOGL_NOTICE,
-                    "MGW pool with %u pool members configured, (ignoring MGW 
configuration in VTY node 'msc').\n",
-                    pool_members_initalized);
-               return 0;
+       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_NOTICE,
+                            "MGW pool with %u pool members configured, 
(ignoring MGW configuration in VTY node 'msc').\n",
+                            pool_members_initalized);
+                       return 0;
+               }
+               LOGP(DMSC, LOGL_ERROR, "MGW pool failed to configure any pool 
members\n");
+               return -EINVAL;
        }

        /* Initialize and connect a single MGCP client. This MGCP client will 
appear as the one and only pool

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/32206
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I44e7b2723d801ceb03aaa2e5546802b4eb56b3c3
Gerrit-Change-Number: 32206
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to