aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-17 23:35:53 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-20 02:51:29 +0800
commit54aaa0fbedf6a966b3cabd6585c987969c4c13d4 (patch)
tree0f15574571112e2c7a1ae7e5dd5a96fa86f82efa
parentc5f9248c3f3027e7ca44ae8593e7a74da190146c (diff)
mgcp: Add ports for the transcoder as well
-rw-r--r--openbsc/include/openbsc/mgcp.h1
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c27
2 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 3f76f6c7..0e45f521 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -121,6 +121,7 @@ struct mgcp_config {
struct mgcp_port_range bts_ports;
struct mgcp_port_range net_ports;
+ struct mgcp_port_range transcoder_ports;
int endp_dscp;
/* spec handling */
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index b222f65d..b6035709 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -81,6 +81,12 @@ static int config_write_mgcp(struct vty *vty)
if (g_cfg->transcoder_ip)
vty_out(vty, " transcoder-mgw %s%s", g_cfg->transcoder_ip, VTY_NEWLINE);
+ if (g_cfg->transcoder_ports.mode == PORT_ALLOC_STATIC)
+ vty_out(vty, " rtp transcoder-base %u%s", g_cfg->transcoder_ports.base_port, VTY_NEWLINE);
+ else
+ vty_out(vty, " rtp transcoder-range %u %u%s",
+ g_cfg->transcoder_ports.range_start, g_cfg->transcoder_ports.range_end, VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -224,6 +230,25 @@ DEFUN(cfg_mgcp_rtp_net_base_port,
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_transcoder_range,
+ cfg_mgcp_rtp_transcoder_range_cmd,
+ "rtp transcoder-range <0-65534> <0-65534>",
+ "Range of ports to allocate for the transcoder\n"
+ "Start of the range of ports\n" "End of the range of ports\n")
+{
+ parse_range(&g_cfg->transcoder_ports, argv);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_mgcp_rtp_transcoder_base,
+ cfg_mgcp_rtp_transcoder_base_cmd,
+ "rtp transcoder-base <0-65534>",
+ "Base port for the transcoder range\n" "Port\n")
+{
+ parse_base(&g_cfg->transcoder_ports, argv);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_mgcp_rtp_ip_dscp,
cfg_mgcp_rtp_ip_dscp_cmd,
"rtp ip-dscp <0-255>",
@@ -418,6 +443,8 @@ int mgcp_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_rtp_net_base_port_cmd);
install_element(MGCP_NODE, &cfg_mgcp_rtp_bts_range_cmd);
install_element(MGCP_NODE, &cfg_mgcp_rtp_net_range_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_rtp_transcoder_range_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_rtp_transcoder_base_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);