bsc: Add a mobile country code setting for the backbone.

This commit is contained in:
Holger Hans Peter Freyther 2010-11-05 19:43:07 +01:00
parent 52d42abdb7
commit 2a8675e49a
4 changed files with 18 additions and 1 deletions

View File

@ -47,6 +47,7 @@ struct osmo_msc_data {
struct timer_list pong_timer;
struct bsc_msc_connection *msc_con;
int core_ncc;
int core_mcc;
int rtp_payload;
int rtp_base;

View File

@ -101,7 +101,8 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg)
net = conn->bts->network;
if (mtype == GSM48_MT_MM_LOC_UPD_ACCEPT) {
if (net->msc_data->core_ncc != -1) {
if (net->msc_data->core_ncc != -1 ||
net->msc_data->core_mcc != -1) {
if (msgb_l3len(msg) >= sizeof(*gh) + sizeof(*lai)) {
lai = (struct gsm48_loc_area_id *) &gh->data[0];
gsm48_generate_lai(lai, net->country_code,

View File

@ -60,6 +60,9 @@ static int config_write_msc(struct vty *vty)
if (data->core_ncc != -1)
vty_out(vty, " core-mobile-network-code %d%s",
data->core_ncc, VTY_NEWLINE);
if (data->core_mcc != -1)
vty_out(vty, " core-mobile-country-code %d%s",
data->core_mcc, VTY_NEWLINE);
vty_out(vty, " ip.access rtp-payload %d%s",
data->rtp_payload, VTY_NEWLINE);
vty_out(vty, " ip.access rtp-base %d%s", data->rtp_base, VTY_NEWLINE);
@ -112,6 +115,16 @@ DEFUN(cfg_net_bsc_ncc,
return CMD_SUCCESS;
}
DEFUN(cfg_net_bsc_mcc,
cfg_net_bsc_mcc_cmd,
"core-mobile-country-code <0-255>",
"Use this country code for the backbone\n" "MCC value\n")
{
struct osmo_msc_data *data = osmo_msc_data(vty);
data->core_mcc = atoi(argv[0]);
return CMD_SUCCESS;
}
DEFUN(cfg_net_bsc_rtp_payload,
cfg_net_bsc_rtp_payload_cmd,
"ip.access rtp-payload <0-255>",
@ -269,6 +282,7 @@ int bsc_vty_init_extra(void)
install_default(MSC_NODE);
install_element(MSC_NODE, &cfg_net_bsc_token_cmd);
install_element(MSC_NODE, &cfg_net_bsc_ncc_cmd);
install_element(MSC_NODE, &cfg_net_bsc_mcc_cmd);
install_element(MSC_NODE, &cfg_net_bsc_rtp_payload_cmd);
install_element(MSC_NODE, &cfg_net_bsc_rtp_base_cmd);
install_element(MSC_NODE, &cfg_net_bsc_codec_list_cmd);

View File

@ -318,6 +318,7 @@ struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_c
net->msc_data->ping_timeout = 20;
net->msc_data->pong_timeout = 5;
net->msc_data->core_ncc = -1;
net->msc_data->core_mcc = -1;
net->msc_data->rtp_payload = 126;
net->msc_data->rtp_base = 4000;