[PATCH] osmo-msc[master]: use separated libosmo-mgcp-client, apply rename to mgcp_clie...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Sep 6 14:43:17 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3787

to look at the new patch set (#4).

use separated libosmo-mgcp-client, apply rename to mgcp_client_*

After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and
I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new
libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*.

Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is
used to contact the MGW (Media Gateway).

Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw)
         I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw)
Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d
---
M configure.ac
M include/osmocom/msc/gsm_data.h
M src/libmsc/a_iface.c
M src/libmsc/a_iface_bssap.c
M src/libmsc/gsm_04_08.c
M src/libmsc/msc_ifaces.c
M src/libmsc/msc_vty.c
M src/osmo-msc/Makefile.am
M src/osmo-msc/msc_main.c
M tests/msc_vlr/Makefile.am
M tests/sms_queue/Makefile.am
11 files changed, 41 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3787/4

diff --git a/configure.ac b/configure.ac
index dd61e52..8f8bdb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,7 +47,7 @@
 PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1)
 PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version?
 PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
-PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1)
+PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0)
 
 # Enable/disable smpp support in the msc?
 AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
@@ -125,33 +125,6 @@
    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
    AC_SUBST([COVERAGE_CFLAGS])
    AC_SUBST([COVERAGE_LDFLAGS])
-fi
-
-AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [
-  AC_CACHE_CHECK(
-    [whether libosmo-legacy-mgcp needs -lgsm],
-    libosmo_cv_legacy_mgcp_needs_libgsm, [
-       SAVE_LDFLAGS="${LDFLAGS}"
-       LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}"
-       AC_LINK_IFELSE(
-         [AC_LANG_PROGRAM([
-                           #include <osmocom/legacy_mgcp/mgcpgw_client.h>
-                         ], [
-                           mgcpgw_client_init(0, 0);
-                         ])],
-         [libosmo_cv_legacy_mgcp_needs_libgsm=no],
-         [libosmo_cv_legacy_mgcp_needs_libgsm=yes])
-       LDFLAGS="${SAVE_LDFLAGS}"
-       ])
-  ])
-CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM
-if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then
-    AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""],
-		   [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])])
-    AC_SUBST(LIBRARY_GSM)
-    if test "$osmo_ac_with_g729" = "yes" ; then
-	PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])])
-    fi
 fi
 
 AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 9343c31..5d3d5ca 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -17,7 +17,7 @@
 #include <osmocom/msc/common.h>
 #include <osmocom/msc/rest_octets.h>
 #include <osmocom/msc/common_cs.h>
-#include <osmocom/legacy_mgcp/mgcpgw_client.h>
+#include <osmocom/mgcp_client/mgcp_client.h>
 
 
 /** annotations for msgb ownership */
@@ -486,9 +486,9 @@
 	uint8_t t3212;
 
 	struct {
-		struct mgcpgw_client_conf conf;
-		struct mgcpgw_client *client;
-	} mgcpgw;
+		struct mgcp_client_conf conf;
+		struct mgcp_client *client;
+	} mgw;
 
 	struct {
 		/* CS7 instance id number (set via VTY) */
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index 7a6000a..3d2013e 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -34,7 +34,7 @@
 #include <osmocom/msc/a_iface.h>
 #include <osmocom/msc/a_iface_bssap.h>
 #include <osmocom/msc/transaction.h>
-#include <osmocom/legacy_mgcp/mgcpgw_client.h>
+#include <osmocom/mgcp_client/mgcp_client.h>
 #include <osmocom/core/byteswap.h>
 #include <osmocom/sccp/sccp_types.h>
 #include <osmocom/msc/a_reset.h>
@@ -401,7 +401,7 @@
 	memset(&rtp_addr_in, 0, sizeof(rtp_addr_in));
 	rtp_addr_in.sin_family = AF_INET;
 	rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr);
-	rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcpgw_client_remote_addr_n(gsm_network->mgcpgw.client));
+	rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client));
 
 	memset(&rtp_addr, 0, sizeof(rtp_addr));
 	memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in));
diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index 1cd6723..34d03e3 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -557,7 +557,7 @@
 {
 	struct gsm_network *network = a_conn_info->network;
 	struct gsm_subscriber_connection *conn;
-	struct mgcpgw_client *mgcp;
+	struct mgcp_client *mgcp;
 	struct tlv_parsed tp;
 	struct sockaddr_storage rtp_addr;
 	struct sockaddr_in *rtp_addr_in;
@@ -567,7 +567,7 @@
 	if (!conn)
 		goto fail;
 
-	mgcp = conn->network->mgcpgw.client;
+	mgcp = conn->network->mgw.client;
 	OSMO_ASSERT(mgcp);
 
 	LOGP(DMSC, LOGL_NOTICE, "BSC sends assignment complete message (conn_id=%i)\n", conn->a.conn_id);
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 2ef0b30..84f52c6 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -2667,7 +2667,7 @@
 	 * (0 if unknown) */
 	msg_type = GSM_TCHF_FRAME;
 
-	uint32_t addr = mgcpgw_client_remote_addr_n(net->mgcpgw.client);
+	uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client);
 	uint16_t port = trans->conn->rtp.port_cn;
 
 	/* FIXME: This has to be set to some meaningful value,
diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c
index b191e0d..7a04153 100644
--- a/src/libmsc/msc_ifaces.c
+++ b/src/libmsc/msc_ifaces.c
@@ -26,7 +26,7 @@
 #include <osmocom/msc/gsm_subscriber.h>
 #include <osmocom/msc/transaction.h>
 #include <osmocom/legacy_mgcp/mgcp.h>
-#include <osmocom/legacy_mgcp/mgcpgw_client.h>
+#include <osmocom/mgcp_client/mgcp_client.h>
 #include <osmocom/msc/vlr.h>
 #include <osmocom/msc/a_iface.h>
 
@@ -192,7 +192,7 @@
 
 	conn->rtp.port_cn = r->audio_port;
 
-	rtp_ip = mgcpgw_client_remote_addr_n(conn->network->mgcpgw.client);
+	rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client);
 
 	if (trans->conn->via_ran == RAN_UTRAN_IU) {
 		/* Assign a voice channel via RANAP on 3G */
@@ -222,7 +222,7 @@
 int msc_call_assignment(struct gsm_trans *trans)
 {
 	struct gsm_subscriber_connection *conn;
-	struct mgcpgw_client *mgcp;
+	struct mgcp_client *mgcp;
 	struct msgb *msg;
 	uint16_t bts_base;
 
@@ -232,7 +232,7 @@
 		return -EINVAL;
 
 	conn = trans->conn;
-	mgcp = conn->network->mgcpgw.client;
+	mgcp = conn->network->mgw.client;
 
 #ifdef BUILD_IU
 	/* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */
@@ -242,14 +242,14 @@
 #endif
 
 	conn->rtp.mgcp_rtp_endpoint =
-		mgcpgw_client_next_endpoint(conn->network->mgcpgw.client);
+		mgcp_client_next_endpoint(conn->network->mgw.client);
 
 	/* This will calculate the port we assign to the BTS via AoIP
 	 * assignment command (or rab-assignment on 3G) The BTS will send
 	 * its RTP traffic to that port on the MGCPGW side. The MGCPGW only
 	 * gets the endpoint ID via the CRCX. It will do the same calculation
 	 * on his side too to get knowledge of the rtp port. */
-	bts_base = mgcpgw_client_conf_actual(mgcp)->bts_base;
+	bts_base = mgcp_client_conf_actual(mgcp)->bts_base;
 	conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint;
 
 	/* Establish the RTP stream first as looping back to the originator.
@@ -257,7 +257,7 @@
 	 * tone instead. */
 	msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint,
 			    conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK);
-	return mgcpgw_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans);
+	return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans);
 }
 
 static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv);
@@ -268,7 +268,7 @@
 {
 	struct gsm_subscriber_connection *conn1 = from->conn;
 	struct gsm_subscriber_connection *conn2 = to->conn;
-	struct mgcpgw_client *mgcp = conn1->network->mgcpgw.client;
+	struct mgcp_client *mgcp = conn1->network->mgw.client;
 	const char *ip;
 	struct msgb *msg;
 
@@ -278,13 +278,13 @@
 	from->bridge.state = state;
 
 	/* Loop back to the same MGCP GW */
-	ip = mgcpgw_client_remote_addr_str(mgcp);
+	ip = mgcp_client_remote_addr_str(mgcp);
 
 	msg = mgcp_msg_mdcx(mgcp,
 			    conn1->rtp.mgcp_rtp_endpoint,
 			    ip, conn2->rtp.port_cn,
 			    mode);
-	if (mgcpgw_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from))
+	if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from))
 		LOGP(DMGCP, LOGL_ERROR,
 		     "Failed to send MDCX message for %s\n",
 		     vlr_subscr_name(from->vsub));
@@ -346,7 +346,7 @@
 	 * is in use */
 
 	struct gsm_subscriber_connection *conn;
-	struct mgcpgw_client *mgcp;
+	struct mgcp_client *mgcp;
 	struct msgb *msg;
 
 	if (!trans)
@@ -355,10 +355,10 @@
 		return -EINVAL;
 	if (!trans->conn->network)
 		return -EINVAL;
-	if (!trans->conn->network->mgcpgw.client)
+	if (!trans->conn->network->mgw.client)
 		return -EINVAL;
 
-	mgcp = trans->conn->network->mgcpgw.client;
+	mgcp = trans->conn->network->mgw.client;
 
 	struct in_addr ip_addr;
 	ip_addr.s_addr = ntohl(ip);
@@ -368,7 +368,7 @@
 	msg = mgcp_msg_mdcx(mgcp,
 			    conn->rtp.mgcp_rtp_endpoint,
 			    inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND);
-	if (mgcpgw_client_tx(mgcp, msg, NULL, trans))
+	if (mgcp_client_tx(mgcp, msg, NULL, trans))
 		LOGP(DMGCP, LOGL_ERROR,
 		     "Failed to send MDCX message for %s\n",
 		     vlr_subscr_name(trans->vsub));
@@ -398,7 +398,7 @@
 {
 	struct msgb *msg;
 	struct gsm_subscriber_connection *conn;
-	struct mgcpgw_client *mgcp;
+	struct mgcp_client *mgcp;
 
 	if (!trans)
 		return;
@@ -408,16 +408,16 @@
 		return;
 
 	conn = trans->conn;
-	mgcp = conn->network->mgcpgw.client;
+	mgcp = conn->network->mgw.client;
 
 	/* Send DLCX */
 	msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint,
 			    conn->rtp.mgcp_rtp_endpoint);
-	if (mgcpgw_client_tx(mgcp, msg, NULL, NULL))
+	if (mgcp_client_tx(mgcp, msg, NULL, NULL))
 		LOGP(DMGCP, LOGL_ERROR,
 		     "Failed to send DLCX message for %s\n",
 		     vlr_subscr_name(trans->vsub));
 
 	/* Release endpoint id */
-	mgcpgw_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp);
+	mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp);
 }
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 2f0f056..5c9539d 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -101,7 +101,7 @@
 	vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance,
 		VTY_NEWLINE);
 
-	mgcpgw_client_config_write(vty, " ");
+	mgcp_client_config_write(vty, " ");
 #ifdef BUILD_IU
 	ranap_iu_vty_config_write(vty, " ");
 #endif
@@ -155,7 +155,7 @@
 	install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd);
 	install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd);
 
-	mgcpgw_client_vty_init(msc_network, MSC_NODE, &msc_network->mgcpgw.conf);
+	mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf);
 #ifdef BUILD_IU
 	ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc);
 #endif
diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am
index a26b4bd..85a5a5a 100644
--- a/src/osmo-msc/Makefile.am
+++ b/src/osmo-msc/Makefile.am
@@ -17,7 +17,7 @@
 	$(LIBOSMORANAP_CFLAGS) \
 	$(LIBASN1C_CFLAGS) \
 	$(LIBOSMOSIGTRAN_CFLAGS) \
-	$(LIBOSMOLEGACYMGCP_CFLAGS) \
+	$(LIBOSMOMGCPCLIENT_CFLAGS) \
 	$(NULL)
 
 AM_LDFLAGS = \
@@ -45,8 +45,7 @@
 	$(LIBSMPP34_LIBS) \
 	$(LIBCRYPTO_LIBS) \
 	$(LIBOSMOSIGTRAN_LIBS) \
-	$(LIBOSMOLEGACYMGCP_LIBS) \
-	$(LIBRARY_GSM) \
+	$(LIBOSMOMGCPCLIENT_LIBS) \
 	-ldbi \
 	$(NULL)
 if BUILD_IU
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index 41dfedb..75ba19c 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -64,7 +64,7 @@
 #include <osmocom/msc/osmo_bsc_rf.h>
 #include <osmocom/msc/smpp.h>
 #include <osmocom/sigtran/osmo_ss7.h>
-#include <osmocom/legacy_mgcp/mgcpgw_client.h>
+#include <osmocom/mgcp_client/mgcp_client.h>
 
 #ifdef BUILD_IU
 #include <osmocom/ranap/iu_client.h>
@@ -251,7 +251,7 @@
 						  MSC_HLR_REMOTE_IP_DEFAULT);
 	net->gsup_server_port = MSC_HLR_REMOTE_PORT_DEFAULT;
 
-	mgcpgw_client_conf_init(&net->mgcpgw.conf);
+	mgcp_client_conf_init(&net->mgw.conf);
 
 	return net;
 }
@@ -553,10 +553,10 @@
 	if (sms_queue_start(msc_network, 20) != 0)
 		return -1;
 
-	msc_network->mgcpgw.client = mgcpgw_client_init(
-			msc_network, &msc_network->mgcpgw.conf);
+	msc_network->mgw.client = mgcp_client_init(
+			msc_network, &msc_network->mgw.conf);
 
-	if (mgcpgw_client_connect(msc_network->mgcpgw.client)) {
+	if (mgcp_client_connect(msc_network->mgw.client)) {
 		printf("MGCPGW connect failed\n");
 		return 7;
 	}
diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am
index fb4857f..aa2b3fe 100644
--- a/tests/msc_vlr/Makefile.am
+++ b/tests/msc_vlr/Makefile.am
@@ -15,7 +15,7 @@
 	$(LIBOSMOSIGTRAN_CFLAGS) \
 	$(LIBOSMORANAP_CFLAGS) \
 	$(LIBASN1C_CFLAGS) \
-	$(LIBOSMOLEGACYMGCP_CFLAGS) \
+	$(LIBOSMOMGCPCLIENT_CFLAGS) \
 	$(NULL)
 
 AM_LDFLAGS = \
@@ -44,7 +44,7 @@
 	$(LIBOSMOSIGTRAN_LIBS) \
 	$(LIBOSMORANAP_LIBS) \
 	$(LIBASN1C_LIBS) \
-	$(LIBOSMOLEGACYMGCP_LIBS) \
+	$(LIBOSMOMGCPCLIENT_LIBS) \
 	$(LIBRARY_GSM) \
 	-ldbi \
 	-lrt \
diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am
index 1d3b9da..1f8ee7b 100644
--- a/tests/sms_queue/Makefile.am
+++ b/tests/sms_queue/Makefile.am
@@ -14,7 +14,7 @@
 	$(LIBOSMOSIGTRAN_CFLAGS) \
 	$(LIBOSMORANAP_CFLAGS) \
 	$(LIBASN1C_CFLAGS) \
-	$(LIBOSMOLEGACYMGCP_CFLAGS) \
+	$(LIBOSMOMGCPCLIENT_CFLAGS) \
 	$(NULL)
 
 EXTRA_DIST = \
@@ -44,7 +44,7 @@
 	$(LIBOSMOSIGTRAN_LIBS) \
 	$(LIBOSMORANAP_LIBS) \
 	$(LIBASN1C_LIBS) \
-	$(LIBOSMOLEGACYMGCP_LIBS) \
+	$(LIBOSMOMGCPCLIENT_LIBS) \
 	$(LIBRARY_GSM) \
 	-ldbi \
 	-lrt \

-- 
To view, visit https://gerrit.osmocom.org/3787
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d
Gerrit-PatchSet: 4
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list