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-08 07:18:16 +0800
commit2c362abfb47d75fda3b75e96060dd72d60f19445 (patch)
tree0f1dc434983a9105a6541689a066651c60152789
parentf8e0838f7a7a963ba3e3eb8e5d9c5d6dca5d25a8 (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 5d2d03650..b650210ec 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;
/* only used in forward mode */
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 984ca346c..722c1cbf5 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 bac26b1f1..87f18328f 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -55,7 +55,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);
@@ -152,16 +152,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>",
@@ -270,6 +273,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);
@@ -310,7 +314,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;