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
This commit is contained in:
Neels Hofmeyr 2017-09-04 01:03:58 +02:00 committed by Neels Hofmeyr
parent fb11041da9
commit 6c8afe148b
11 changed files with 41 additions and 69 deletions

View File

@ -47,7 +47,7 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0)
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])],
@ -127,33 +127,6 @@ if test "$enable_coverage" = "yes"; then
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], [
AC_CACHE_CHECK(
[whether struct tm has tm_gmtoff member],

View File

@ -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 @@ struct gsm_network {
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) */

View File

@ -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 @@ int a_iface_tx_assignment(const struct gsm_trans *trans)
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));

View File

@ -557,7 +557,7 @@ static int bssmap_rx_ass_compl(const struct osmo_sccp_user *scu, const struct a_
{
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 @@ static int bssmap_rx_ass_compl(const struct osmo_sccp_user *scu, const struct a_
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);

View File

@ -2667,7 +2667,7 @@ static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans,
* (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,

View File

@ -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 @@ static void mgcp_response_rab_act_cs_crcx(struct mgcp_response *r, void *priv)
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 @@ rab_act_cs_error:
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 @@ int msc_call_assignment(struct gsm_trans *trans)
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 @@ int msc_call_assignment(struct gsm_trans *trans)
#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 @@ int msc_call_assignment(struct gsm_trans *trans)
* 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 @@ static void mgcp_bridge(struct gsm_trans *from, struct gsm_trans *to,
{
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 @@ static void mgcp_bridge(struct gsm_trans *from, struct gsm_trans *to,
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 @@ int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip)
* 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 @@ int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip)
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 @@ int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip)
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 @@ void msc_call_release(struct gsm_trans *trans)
{
struct msgb *msg;
struct gsm_subscriber_connection *conn;
struct mgcpgw_client *mgcp;
struct mgcp_client *mgcp;
if (!trans)
return;
@ -408,16 +408,16 @@ void msc_call_release(struct gsm_trans *trans)
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);
}

View File

@ -101,7 +101,7 @@ static int config_write_msc(struct vty *vty)
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 @@ void msc_vty_init(struct gsm_network *msc_network)
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

View File

@ -17,7 +17,7 @@ AM_CFLAGS = \
$(LIBOSMORANAP_CFLAGS) \
$(LIBASN1C_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
$(LIBOSMOLEGACYMGCP_CFLAGS) \
$(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
AM_LDFLAGS = \
@ -45,8 +45,7 @@ osmo_msc_LDADD = \
$(LIBSMPP34_LIBS) \
$(LIBCRYPTO_LIBS) \
$(LIBOSMOSIGTRAN_LIBS) \
$(LIBOSMOLEGACYMGCP_LIBS) \
$(LIBRARY_GSM) \
$(LIBOSMOMGCPCLIENT_LIBS) \
-ldbi \
$(NULL)
if BUILD_IU

View File

@ -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 @@ struct gsm_network *msc_network_alloc(void *ctx,
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 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
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;
}

View File

@ -15,7 +15,7 @@ AM_CFLAGS = \
$(LIBOSMOSIGTRAN_CFLAGS) \
$(LIBOSMORANAP_CFLAGS) \
$(LIBASN1C_CFLAGS) \
$(LIBOSMOLEGACYMGCP_CFLAGS) \
$(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
AM_LDFLAGS = \
@ -44,7 +44,7 @@ AM_LDFLAGS = \
$(LIBOSMOSIGTRAN_LIBS) \
$(LIBOSMORANAP_LIBS) \
$(LIBASN1C_LIBS) \
$(LIBOSMOLEGACYMGCP_LIBS) \
$(LIBOSMOMGCPCLIENT_LIBS) \
$(LIBRARY_GSM) \
-ldbi \
-lrt \

View File

@ -14,7 +14,7 @@ AM_CFLAGS = \
$(LIBOSMOSIGTRAN_CFLAGS) \
$(LIBOSMORANAP_CFLAGS) \
$(LIBASN1C_CFLAGS) \
$(LIBOSMOLEGACYMGCP_CFLAGS) \
$(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
EXTRA_DIST = \
@ -44,7 +44,7 @@ sms_queue_test_LDADD = \
$(LIBOSMOSIGTRAN_LIBS) \
$(LIBOSMORANAP_LIBS) \
$(LIBASN1C_LIBS) \
$(LIBOSMOLEGACYMGCP_LIBS) \
$(LIBOSMOMGCPCLIENT_LIBS) \
$(LIBRARY_GSM) \
-ldbi \
-lrt \