aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-cscn/cscn_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/osmo-cscn/cscn_main.c')
-rw-r--r--openbsc/src/osmo-cscn/cscn_main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/openbsc/src/osmo-cscn/cscn_main.c b/openbsc/src/osmo-cscn/cscn_main.c
index 694b5b9fe..1f333b477 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;
@@ -245,6 +256,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;
}
@@ -471,6 +484,10 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
}
#endif
+ 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);