aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/osmo_bsc_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-08-23 17:28:55 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-08-25 17:07:20 +0200
commitd8f46c0074e6c2b3b693f48ca496d11a301d4923 (patch)
treefe99147500ba19c9d70e2263122b910ae6bfa53f /src/osmo-bsc/osmo_bsc_vty.c
parent24f2f55132f7230e387aef85612dcd6fc59cebe5 (diff)
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
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_vty.c')
-rw-r--r--src/osmo-bsc/osmo_bsc_vty.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index efa12e09b..f90ad6f9d 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -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;
}