diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-09-22 20:21:10 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-11-12 16:06:44 +0100 |
commit | ea51bfd87535bd8f8a00db6d9777fff126ec2deb (patch) | |
tree | 77eaaea6c2dd2c3e904253c88ff14b23af6d6bb5 /openbsc/src | |
parent | a9370b6b65e3610d78cbf2b805220df923bc2cd5 (diff) |
cscn: add mgcpgw client (with dummy read cb so far)
Store the mgcpgw client data in struct gsm_network.
Initialize VTY and bind the client.
Change-Id: Ifc4efb1ca44fa34c29bf23b35addb54155296d68
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/libmsc/cscn_vty.c | 4 | ||||
-rw-r--r-- | openbsc/src/osmo-cscn/Makefile.am | 1 | ||||
-rw-r--r-- | openbsc/src/osmo-cscn/cscn_main.c | 17 |
3 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/cscn_vty.c b/openbsc/src/libmsc/cscn_vty.c index adba37daa..f93c5602b 100644 --- a/openbsc/src/libmsc/cscn_vty.c +++ b/openbsc/src/libmsc/cscn_vty.c @@ -121,6 +121,9 @@ static int config_write_cscn(struct vty *vty) VTY_NEWLINE); vty_out(vty, " %sassign-tmsi%s", gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE); + + mgcpgw_client_config_write(vty, " "); + return CMD_SUCCESS; } @@ -171,4 +174,5 @@ void cscn_vty_init(struct gsm_network *cscn_network) install_element(CSCN_NODE, &cfg_cscn_no_subscr_create_cmd); install_element(CSCN_NODE, &cfg_cscn_assign_tmsi_cmd); install_element(CSCN_NODE, &cfg_cscn_no_assign_tmsi_cmd); + mgcpgw_client_vty_init(CSCN_NODE, &cscn_network->mgcpgw.conf); } diff --git a/openbsc/src/osmo-cscn/Makefile.am b/openbsc/src/osmo-cscn/Makefile.am index 8245a64e9..2f9c31a10 100644 --- a/openbsc/src/osmo-cscn/Makefile.am +++ b/openbsc/src/osmo-cscn/Makefile.am @@ -41,6 +41,7 @@ osmo_cscn_LDADD = \ $(top_builddir)/src/libxsc/libxsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libmgcp/libmgcp.a \ $(LIBCRYPT) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) \ diff --git a/openbsc/src/osmo-cscn/cscn_main.c b/openbsc/src/osmo-cscn/cscn_main.c index 27526e7d7..88393c909 100644 --- a/openbsc/src/osmo-cscn/cscn_main.c +++ b/openbsc/src/osmo-cscn/cscn_main.c @@ -66,6 +66,7 @@ #include <openbsc/smpp.h> #include <osmocom/sigtran/sccp_sap.h> #include <osmocom/sigtran/sua.h> +#include <openbsc/mgcpgw_client.h> #include <openbsc/msc_ifaces.h> #include <openbsc/iu.h> @@ -95,6 +96,16 @@ void *tall_map_ctx = NULL; void *tall_upq_ctx = NULL; /* end deps from libbsc legacy. */ +static void mgcp_rx_cb(struct msgb *msg, void *priv) +{ + static char strbuf[4096]; + unsigned int l = msg->len < sizeof(strbuf)-1 ? msg->len : sizeof(strbuf)-1; + strncpy(strbuf, (const char*)msg->data, l); + strbuf[l] = '\0'; + DEBUGP(DMGCP, "Rx MGCP msg from MGCP GW: '%s'\n", strbuf); + talloc_free(msg); +} + static struct { const char *database_name; const char *config_file; @@ -247,6 +258,8 @@ struct gsm_network *cscn_network_alloc(void *ctx, net->name_long = talloc_strdup(net, "OsmoCSCN"); net->name_short = talloc_strdup(net, "OsmoCSCN"); + mgcpgw_client_conf_init(&net->mgcpgw.conf); + return net; } @@ -456,6 +469,10 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i /* TODO: is this used for crypto?? Improve randomness, at least we * should try to use the nanoseconds part of the current time. */ + cscn_network->mgcpgw.client = mgcpgw_client_init( + cscn_network, &cscn_network->mgcpgw.conf, + mgcp_rx_cb, NULL); + if (db_init(cscn_cmdline_config.database_name)) { printf("DB: Failed to init database: %s\n", cscn_cmdline_config.database_name); |