diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2017-09-07 16:35:01 +0200 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2017-09-07 16:35:01 +0200 |
commit | 9bc66b806fa75e914b2bc958058391907d3860aa (patch) | |
tree | b551c973c9bd23eab8bf78f340e626b48ca7f35e /openbsc | |
parent | 2152d82dafd8c8b390de9a0e4bc8719bcd51273d (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')
-rw-r--r-- | openbsc/src/osmo-bsc_mgcp/mgcp_main.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c index d755c906c..87154c298 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; @@ -207,16 +209,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(&log_info); @@ -228,14 +220,25 @@ 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); + rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_BSC_MGCP); 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; |