summaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/mgcp/mgcp_vty.c')
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index d78b8c78a..b47470dd0 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -99,14 +99,14 @@ DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
vty_out(vty, "MGCP is up and running with %u endpoints:%s", g_cfg->number_endpoints - 1, VTY_NEWLINE);
for (i = 1; i < g_cfg->number_endpoints; ++i) {
struct mgcp_endpoint *endp = &g_cfg->endpoints[i];
- vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s traffic received bts: %u/%u remote: %u/%u transcoder: %u%s",
+ vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s traffic received bts: %u/%u remote: %u/%u transcoder: %u/%u%s",
i, endp->ci,
ntohs(endp->net_end.rtp_port), ntohs(endp->net_end.rtcp_port),
ntohs(endp->bts_end.rtp_port), ntohs(endp->bts_end.rtcp_port),
inet_ntoa(endp->bts_end.addr),
endp->bts_end.packets, endp->bts_state.lost_no,
endp->net_end.packets, endp->net_state.lost_no,
- endp->transcoder_end.packets,
+ endp->trans_net.packets, endp->trans_bts.packets,
VTY_NEWLINE);
}
@@ -319,6 +319,20 @@ DEFUN(cfg_mgcp_transcoder,
return CMD_SUCCESS;
}
+DEFUN(cfg_mgcp_no_transcoder,
+ cfg_mgcp_no_transcoder_cmd,
+ NO_STR "transcoder-mgw",
+ "Disable the transcoding\n")
+{
+ if (g_cfg->transcoder_ip) {
+ LOGP(DMGCP, LOGL_NOTICE, "Disabling transcoding on future calls.\n");
+ talloc_free(g_cfg->transcoder_ip);
+ g_cfg->transcoder_ip = NULL;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_mgcp_transcoder_remote_base,
cfg_mgcp_transcoder_remote_base_cmd,
"transcoder-remote-base <0-65534>",
@@ -453,6 +467,7 @@ int mgcp_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd);
install_element(MGCP_NODE, &cfg_mgcp_agent_addr_cmd);
install_element(MGCP_NODE, &cfg_mgcp_transcoder_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_no_transcoder_cmd);
install_element(MGCP_NODE, &cfg_mgcp_transcoder_remote_base_cmd);
return 0;
}
@@ -508,13 +523,23 @@ int mgcp_parse_config(const char *config_file, struct mgcp_config *cfg)
}
if (g_cfg->transcoder_ip && g_cfg->transcoder_ports.mode == PORT_ALLOC_STATIC) {
+ /* network side */
rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp),
g_cfg->transcoder_ports.base_port);
- if (mgcp_bind_transcoder_rtp_port(endp, rtp_port) != 0) {
+ if (mgcp_bind_trans_net_rtp_port(endp, rtp_port) != 0) {
+ LOGP(DMGCP, LOGL_FATAL, "Failed to bind: %d\n", rtp_port);
+ return -1;
+ }
+ endp->trans_net.local_alloc = PORT_ALLOC_STATIC;
+
+ /* bts side */
+ rtp_port = rtp_calculate_port(endp_back_channel(ENDPOINT_NUMBER(endp)),
+ g_cfg->transcoder_ports.base_port);
+ if (mgcp_bind_trans_bts_rtp_port(endp, rtp_port) != 0) {
LOGP(DMGCP, LOGL_FATAL, "Failed to bind: %d\n", rtp_port);
return -1;
}
- endp->transcoder_end.local_alloc = PORT_ALLOC_STATIC;
+ endp->trans_bts.local_alloc = PORT_ALLOC_STATIC;
}
}