aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-17 03:58:52 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-20 02:51:29 +0800
commita2a10ebf033e618ec9dc69d8d9089940f540a3a7 (patch)
tree3f3572695af4cd02136dd177a76866ad33e230c4
parent985f5694c76245c0f0455f2f3197bbfe663aacde (diff)
mgcp: Add a transcoder-mgw command to store the address
-rw-r--r--openbsc/include/openbsc/mgcp.h2
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 00c5071a..3f76f6c7 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -109,8 +109,10 @@ struct mgcp_config {
unsigned int number_endpoints;
char *bts_ip;
char *call_agent_addr;
+ char *transcoder_ip;
struct in_addr bts_in;
+ struct in_addr transcoder_in;
char *audio_name;
int audio_payload;
int audio_loop;
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index e86ce7d7..b1c006cb 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -78,6 +78,8 @@ static int config_write_mgcp(struct vty *vty)
vty_out(vty, " number endpoints %u%s", g_cfg->number_endpoints - 1, VTY_NEWLINE);
if (g_cfg->call_agent_addr)
vty_out(vty, " call agent ip %s%s", g_cfg->call_agent_addr, VTY_NEWLINE);
+ if (g_cfg->transcoder_ip)
+ vty_out(vty, " transcoder-mgw %s%s", g_cfg->transcoder_ip, VTY_NEWLINE);
return CMD_SUCCESS;
}
@@ -282,6 +284,20 @@ DEFUN(cfg_mgcp_agent_addr,
return CMD_SUCCESS;
}
+DEFUN(cfg_mgcp_transcoder,
+ cfg_mgcp_transcoder_cmd,
+ "transcoder-mgw A.B.C.D",
+ "Use a MGW to detranscoder RTP\n"
+ "The IP address of the MGW")
+{
+ if (g_cfg->transcoder_ip)
+ talloc_free(g_cfg->transcoder_ip);
+ g_cfg->transcoder_ip = talloc_strdup(g_cfg, argv[0]);
+ inet_aton(g_cfg->transcoder_ip, &g_cfg->transcoder_in);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(loop_endp,
loop_endp_cmd,
"loop-endpoint NAME (0|1)",
@@ -403,6 +419,7 @@ int mgcp_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_loop_cmd);
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);
return 0;
}