Change in osmo-msc[master]: libmsc: fix: properly initialize the SGs server

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Mar 21 19:09:48 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13373


Change subject: libmsc: fix: properly initialize the SGs server
......................................................................

libmsc: fix: properly initialize the SGs server

Change-Id: Ie0c31205ac48be7e50d0380a89833771b2708da4
---
M src/libmsc/sgs_iface.c
M src/libmsc/sgs_vty.c
M src/osmo-msc/msc_main.c
3 files changed, 16 insertions(+), 8 deletions(-)



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

diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index 95b68f8..450d552 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -1258,8 +1258,6 @@
 		return NULL;
 	g_sgs = sgs;
 
-	sgs_server_open(sgs);
-
 	return sgs;
 }
 
diff --git a/src/libmsc/sgs_vty.c b/src/libmsc/sgs_vty.c
index 8ba5a79..dbf2607 100644
--- a/src/libmsc/sgs_vty.c
+++ b/src/libmsc/sgs_vty.c
@@ -56,9 +56,11 @@
 	osmo_strlcpy(sgs->cfg.local_addr, argv[0], sizeof(sgs->cfg.local_addr));
 	osmo_stream_srv_link_set_addr(sgs->srv_link, sgs->cfg.local_addr);
 
-	rc = sgs_server_open(sgs);
-	if (rc < 0)
-		return CMD_WARNING;
+	if (vty->type != VTY_FILE) {
+		rc = sgs_server_open(sgs);
+		if (rc < 0)
+			return CMD_WARNING;
+	}
 
 	return CMD_SUCCESS;
 }
@@ -74,9 +76,11 @@
 	sgs->cfg.local_port = atoi(argv[0]);
 	osmo_stream_srv_link_set_port(sgs->srv_link, sgs->cfg.local_port);
 
-	rc = sgs_server_open(sgs);
-	if (rc < 0)
-		return CMD_WARNING;
+	if (vty->type != VTY_FILE) {
+		rc = sgs_server_open(sgs);
+		if (rc < 0)
+			return CMD_WARNING;
+	}
 
 	return CMD_SUCCESS;
 }
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index f29b2a8..b55d38f 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -62,6 +62,7 @@
 #include <osmocom/sigtran/osmo_ss7.h>
 #include <osmocom/mgcp_client/mgcp_client.h>
 #include <osmocom/msc/sgs_iface.h>
+#include <osmocom/msc/sgs_server.h>
 
 #ifdef BUILD_IU
 #include <osmocom/ranap/iu_client.h>
@@ -692,6 +693,11 @@
 		return 8;
 	}
 
+	if (sgs_server_open(g_sgs)) {
+		printf("Starting SGs server failed\n");
+		return 9;
+	}
+
 #ifdef BUILD_IU
 	/* Set up IuCS */
 	ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event);

-- 
To view, visit https://gerrit.osmocom.org/13373
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0c31205ac48be7e50d0380a89833771b2708da4
Gerrit-Change-Number: 13373
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190321/c308224e/attachment.html>


More information about the gerrit-log mailing list