MGCP: add 'X-Osmo-IGN: C' for SCCPlite by default

Use libosmo-mgcp-client's new X-Osmo-IGN header to indicate that CallIDs are
allowed to mismatch.

Add VTY commands 'msc' / 'mgw x-osmo-ign call-id' and 'no mgw x-osmo-ign' to
switch this behavior explicitly.

For SCCPlite MSCs, unless a specific config was issued, always send
'X-Osmo-IGN: C' by default, to ignore CallID mismatches.

Depends: Id7ae275ffde8ea9389270cfe3db087ee8db00b51 (osmo-mgw)
Change-Id: I257ad574d8060fef19afce9798bd8a5a7f8c99fe
This commit is contained in:
Neels Hofmeyr 2018-08-23 17:28:55 +02:00
parent 24f2f55132
commit d8f46c0074
4 changed files with 56 additions and 1 deletions

View File

@ -130,6 +130,9 @@ struct bsc_msc_data {
* BSSMAP RESET procedure */
struct osmo_fsm_inst *reset_fsm;
} a;
uint32_t x_osmo_ign;
bool x_osmo_ign_configured;
};
/*

View File

@ -29,6 +29,7 @@
#include <osmocom/bsc/mgw_endpoint_fsm.h>
#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
#include <osmocom/bsc/abis_rsl.h>
#include <osmocom/bsc/bsc_msc_data.h>
static struct osmo_fsm lchan_rtp_fsm;
@ -154,8 +155,11 @@ static void lchan_rtp_fsm_wait_mgw_endpoint_available_onenter(struct osmo_fsm_in
lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS");
if (lchan->conn)
if (lchan->conn) {
crcx_info.call_id = lchan->conn->sccp.conn_id;
if (lchan->conn->sccp.msc)
crcx_info.x_osmo_ign = lchan->conn->sccp.msc->x_osmo_ign;
}
crcx_info.ptime = 20;
mgcp_pick_codec(&crcx_info, lchan, true);

View File

@ -35,6 +35,7 @@
#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
#include <osmocom/bsc/gsm_data.h>
#include <osmocom/mgcp/mgcp_common.h>
/* A pointer to a list with all involved MSCs
* (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */
@ -496,6 +497,15 @@ int osmo_bsc_sigtran_init(struct llist_head *mscs)
if (!msc->a.sccp)
return -EINVAL;
/* In SCCPlite, the MSC side of the MGW endpoint is configured by the MSC. Since we have
* no way to figure out which CallID ('C:') the MSC will issue in its CRCX command, set
* an X-Osmo-IGN flag telling osmo-mgw to ignore CallID mismatches for this endpoint.
* If an explicit VTY command has already indicated whether or not to send X-Osmo-IGN, do
* not overwrite that setting. */
if (msc->a.asp_proto == OSMO_SS7_ASP_PROT_IPA
&& !msc->x_osmo_ign_configured)
msc->x_osmo_ign |= MGCP_X_OSMO_IGN_CALLID;
/* If unset, use default local SCCP address */
if (!msc->a.bsc_addr.presence)
osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, msc->a.sccp,

View File

@ -191,6 +191,13 @@ static void write_msc(struct vty *vty, struct bsc_msc_data *msc)
/* write MGW configuration */
mgcp_client_config_write(vty, " ");
if (msc->x_osmo_ign_configured) {
if (!msc->x_osmo_ign)
vty_out(vty, " no mgw x-osmo-ign%s", VTY_NEWLINE);
else
vty_out(vty, " mgw x-osmo-ign call-id%s", VTY_NEWLINE);
}
}
static int config_write_msc(struct vty *vty)
@ -672,6 +679,35 @@ DEFUN(cfg_net_msc_lcls_mismtch,
return CMD_SUCCESS;
}
DEFUN(cfg_msc_mgw_x_osmo_ign,
cfg_msc_mgw_x_osmo_ign_cmd,
"mgw x-osmo-ign call-id",
MGCP_CLIENT_MGW_STR
"Set a (non-standard) X-Osmo-IGN header in all CRCX messages for RTP streams"
" associated with this MSC, useful for A/SCCPlite MSCs, since osmo-bsc cannot know"
" the MSC's chosen CallID. This is enabled by default for A/SCCPlite connections,"
" disabled by default for all others.\n"
"Send 'X-Osmo-IGN: C' to ignore CallID mismatches. See OsmoMGW.\n")
{
struct bsc_msc_data *msc = bsc_msc_data(vty);
msc->x_osmo_ign |= MGCP_X_OSMO_IGN_CALLID;
msc->x_osmo_ign_configured = true;
return CMD_SUCCESS;
}
DEFUN(cfg_msc_no_mgw_x_osmo_ign,
cfg_msc_no_mgw_x_osmo_ign_cmd,
"no mgw x-osmo-ign",
NO_STR
MGCP_CLIENT_MGW_STR
"Do not send X-Osmo-IGN MGCP header to this MSC\n")
{
struct bsc_msc_data *msc = bsc_msc_data(vty);
msc->x_osmo_ign = 0;
msc->x_osmo_ign_configured = true;
return CMD_SUCCESS;
}
DEFUN(cfg_net_bsc_mid_call_text,
cfg_net_bsc_mid_call_text_cmd,
"mid-call-text .TEXT",
@ -983,6 +1019,8 @@ int bsc_vty_init_extra(void)
install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd);
mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf);
install_element(MSC_NODE, &cfg_msc_mgw_x_osmo_ign_cmd);
install_element(MSC_NODE, &cfg_msc_no_mgw_x_osmo_ign_cmd);
return 0;
}