aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2017-09-07 16:35:01 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 18:59:28 +0100
commit98fcd4a19dba5f546f545b11431fe367e7d6454f (patch)
treef433306237caee05799b82059a1f4687bb8b8f9f /openbsc/src
parent97c37dd729cfbd03a759d4b50fb1d3f20301afb3 (diff)
osmo-bsc_mgcp: Make it work with the changes supporting multiple MGCP
osmo-bsc_mgcp will still only use the first mgcp instance, but this copes with the API changes in mgcp_parse_config. Change-Id: I52ea74103acef374212e276dfa8122b00ca4562a
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/osmo-bsc_mgcp/mgcp_main.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index 4ea070079..d6ca0467e 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -43,6 +43,7 @@
#include <osmocom/core/select.h>
#include <osmocom/core/stats.h>
#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/linuxlist.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
@@ -198,6 +199,7 @@ static struct vty_app_info vty_info = {
int main(int argc, char **argv)
{
+ struct llist_head mgcp_cfgs;
struct gsm_network dummy_network;
struct sockaddr_in addr;
int on = 1, rc;
@@ -208,16 +210,6 @@ int main(int argc, char **argv)
osmo_init_ignore_signals();
osmo_init_logging(&log_info);
- cfg = mgcp_config_alloc();
- if (!cfg)
- return -1;
-
-#ifdef BUILD_MGCP_TRANSCODING
- cfg->setup_rtp_processing_cb = &mgcp_transcoding_setup;
- cfg->rtp_processing_cb = &mgcp_transcoding_process_rtp;
- cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format;
-#endif
-
vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
logging_vty_add_cmds(NULL);
@@ -229,9 +221,13 @@ int main(int argc, char **argv)
rate_ctr_init(tall_bsc_ctx);
osmo_stats_init(tall_bsc_ctx);
- rc = mgcp_parse_config(config_file, cfg, MGCP_BSC);
+ rc = mgcp_parse_config(config_file, &mgcp_cfgs, MGCP_BSC);
if (rc < 0)
return rc;
+ if (llist_empty(&mgcp_cfgs))
+ return -1;
+
+ cfg = llist_entry(mgcp_cfgs.next, struct mgcp_config, entry);
/* start telnet after reading config for vty_get_bind_addr() */
rc = telnet_init_dynif(tall_bsc_ctx, &dummy_network,
@@ -239,6 +235,12 @@ int main(int argc, char **argv)
if (rc < 0)
return rc;
+#ifdef BUILD_MGCP_TRANSCODING
+ cfg->setup_rtp_processing_cb = &mgcp_transcoding_setup;
+ cfg->rtp_processing_cb = &mgcp_transcoding_process_rtp;
+ cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format;
+#endif
+
/* set some callbacks */
cfg->reset_cb = mgcp_rsip_cb;