diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2017-12-21 12:42:22 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2018-01-30 18:59:29 +0100 |
commit | c458f43bf5ed39067e203ab198320756d023b9f9 (patch) | |
tree | 65c2b23aaa41a0dcc7f6962db3dfab4429d24d33 /openbsc/src/osmo-bsc_nat | |
parent | 7a49c9a3661b3d7feef9ce1106396cabb0ee2f3d (diff) |
osmo-bsc_nat: Reenable osmux support
Change-Id: Ib98b65767884d615aac5c537dc58f2cdf5ff4bfa
Diffstat (limited to 'openbsc/src/osmo-bsc_nat')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 4 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 3432d6b9a..efb56f9c6 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -511,7 +511,7 @@ struct nat_sccp_connection *bsc_mgcp_find_con(struct bsc_nat *nat, struct mgcp_c static int nat_osmux_only(struct mgcp_config *mgcp_cfg, struct bsc_config *bsc_cfg) { - if (mgcp_cfg->osmux == OSMUX_USAGE_ONLY) + if (mgcp_cfg->osmux_cfg->osmux_enabled == OSMUX_USAGE_ONLY) return 1; if (bsc_cfg->osmux == OSMUX_USAGE_ONLY) return 1; @@ -567,7 +567,7 @@ static int bsc_mgcp_policy_cb(struct mgcp_trunk_config *tcfg, int endpoint, int /* Allocate a Osmux circuit ID */ if (state == MGCP_ENDP_CRCX) { - if (tcfg->cfg->osmux && sccp->bsc->cfg->osmux) { + if (tcfg->cfg->osmux_cfg->osmux_enabled && sccp->bsc->cfg->osmux) { osmux_allocate_cid(mgcp_endp); if (mgcp_endp->osmux.allocated_cid < 0 && nat_osmux_only(tcfg->cfg, sccp->bsc->cfg)) { diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index f18098210..b0b6be0e8 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -1302,6 +1302,7 @@ DEFUN(cfg_bsc_osmux, OSMUX_STR "Enable OSMUX\n" "Disable OSMUX\n" "Only OSMUX\n") { struct bsc_config *conf = vty->index; + struct mgcp_config *mgcp_cfg; int old = conf->osmux; if (strcmp(argv[0], "on") == 0) @@ -1311,14 +1312,13 @@ DEFUN(cfg_bsc_osmux, else if (strcmp(argv[0], "only") == 0) conf->osmux = OSMUX_USAGE_ONLY; -#warning "OSMUX is missing support for multiple mgcp" if (conf->osmux != OSMUX_USAGE_OFF) return CMD_WARNING; -#if 0 - if (old == 0 && conf->osmux > 0 && !conf->nat->mgcp_cfg->osmux_init) { + mgcp_cfg = mgcp_config_by_num(conf->nat->mgcp_cfgs, 0); + if (old == 0 && conf->osmux > 0 && !osmux_is_inited(mgcp_cfg->osmux_cfg)) { LOGP(DMGCP, LOGL_NOTICE, "Setting up OSMUX socket\n"); - if (osmux_init(OSMUX_ROLE_BSC_NAT, conf->nat->mgcp_cfg) < 0) { + if (osmux_init(OSMUX_ROLE_BSC_NAT, mgcp_cfg->osmux_cfg) < 0) { LOGP(DMGCP, LOGL_ERROR, "Cannot init OSMUX\n"); vty_out(vty, "%% failed to create Osmux socket%s", VTY_NEWLINE); @@ -1331,7 +1331,6 @@ DEFUN(cfg_bsc_osmux, * new upcoming flows should use RTP. */ } -#endif return CMD_SUCCESS; } |