aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-05 03:46:07 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-05 06:10:58 +0800
commit196349dda18d8e6a49c318ad6659291818ad21fd (patch)
treefc57fb20b1c98d981a3072c045057479d0f46a6b
parentc49212778f84736f1cc59fccf7946595c629ed91 (diff)
mgcp: Rename the base port to bts_base as it will be used for the bts
-rw-r--r--openbsc/include/openbsc/mgcp.h2
-rw-r--r--openbsc/src/mgcp/mgcp_protocol.c4
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c16
3 files changed, 13 insertions, 9 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index e3fd511a4..811ba2ced 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -91,7 +91,7 @@ struct mgcp_config {
char *audio_name;
int audio_payload;
int audio_loop;
- int rtp_base_port;
+ int rtp_bts_base_port;
int endp_dscp;
/* spec handling */
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 69362e4b0..8dbe2b021 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -427,7 +427,7 @@ static struct msgb *handle_create_con(struct mgcp_config *cfg, struct msgb *msg)
memset(&endp->net_end.addr, 0, sizeof(endp->net_end.addr));
/* bind to the port now */
- port = rtp_calculate_port(ENDPOINT_NUMBER(endp), cfg->rtp_base_port);
+ port = rtp_calculate_port(ENDPOINT_NUMBER(endp), cfg->rtp_bts_base_port);
endp->bts_end.local_port = port;
endp->net_end.local_port = port;
@@ -708,7 +708,7 @@ struct mgcp_config *mgcp_config_alloc(void)
cfg->source_addr = talloc_strdup(cfg, "0.0.0.0");
cfg->audio_name = talloc_strdup(cfg, "GSM-EFR/8000");
cfg->audio_payload = 97;
- cfg->rtp_base_port = RTP_PORT_DEFAULT;
+ cfg->rtp_bts_base_port = RTP_PORT_DEFAULT;
return cfg;
}
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index d4c03cbc9..ea10a2e6f 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -56,7 +56,7 @@ static int config_write_mgcp(struct vty *vty)
vty_out(vty, " bts ip %s%s", g_cfg->bts_ip, VTY_NEWLINE);
vty_out(vty, " bind ip %s%s", g_cfg->source_addr, VTY_NEWLINE);
vty_out(vty, " bind port %u%s", g_cfg->source_port, VTY_NEWLINE);
- vty_out(vty, " rtp base %u%s", g_cfg->rtp_base_port, VTY_NEWLINE);
+ vty_out(vty, " rtp bts-base %u%s", g_cfg->rtp_bts_base_port, VTY_NEWLINE);
vty_out(vty, " rtp ip-dscp %d%s", g_cfg->endp_dscp, VTY_NEWLINE);
if (g_cfg->audio_payload != -1)
vty_out(vty, " sdp audio payload number %d%s", g_cfg->audio_payload, VTY_NEWLINE);
@@ -153,16 +153,19 @@ DEFUN(cfg_mgcp_bind_early,
return CMD_WARNING;
}
-DEFUN(cfg_mgcp_rtp_base_port,
- cfg_mgcp_rtp_base_port_cmd,
- "rtp base <0-65534>",
+DEFUN(cfg_mgcp_rtp_bts_base_port,
+ cfg_mgcp_rtp_bts_base_port_cmd,
+ "rtp bts-base <0-65534>",
"Base port to use")
{
unsigned int port = atoi(argv[0]);
- g_cfg->rtp_base_port = port;
+ g_cfg->rtp_bts_base_port = port;
return CMD_SUCCESS;
}
+ALIAS_DEPRECATED(cfg_mgcp_rtp_bts_base_port, cfg_mgcp_rtp_base_port_cmd,
+ "rtp base <0-65534>", "Base port to use")
+
DEFUN(cfg_mgcp_rtp_ip_dscp,
cfg_mgcp_rtp_ip_dscp_cmd,
"rtp ip-dscp <0-255>",
@@ -273,6 +276,7 @@ int mgcp_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_bind_port_cmd);
install_element(MGCP_NODE, &cfg_mgcp_bind_early_cmd);
install_element(MGCP_NODE, &cfg_mgcp_rtp_base_port_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_rtp_bts_base_port_cmd);
install_element(MGCP_NODE, &cfg_mgcp_rtp_ip_dscp_cmd);
install_element(MGCP_NODE, &cfg_mgcp_rtp_ip_tos_cmd);
install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_number_cmd);
@@ -313,7 +317,7 @@ int mgcp_parse_config(const char *config_file, struct mgcp_config *cfg)
struct mgcp_endpoint *endp = &g_cfg->endpoints[i];
int rtp_port;
- rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), g_cfg->rtp_base_port);
+ rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), g_cfg->rtp_bts_base_port);
if (mgcp_bind_bts_rtp_port(endp, rtp_port) != 0) {
LOGP(DMGCP, LOGL_FATAL, "Failed to bind: %d\n", rtp_port);
return -1;