aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-31 11:46:41 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-31 11:46:41 +0200
commit7513b3a1c2bac3c830de86c7e341127e3a492cae (patch)
tree53871fcea0d80959a3793813b4fd40647db1f008
parent135d99b36ef2faecbe005a5a682162017d04b20b (diff)
[mgcp] Add a new config option to set the call agent ip addr
In the case of the nat we only want to communicate with one upstream call agent and this can now be configured.
-rw-r--r--openbsc/include/openbsc/mgcp.h1
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 2361a2160..778a1f116 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -84,6 +84,7 @@ struct mgcp_config {
char *local_ip;
char *source_addr;
char *bts_ip;
+ char *call_agent_addr;
/* default endpoint data */
struct in_addr bts_in;
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index 6773d889f..70f7528e0 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -63,6 +63,8 @@ static int config_write_mgcp(struct vty *vty)
vty_out(vty, " forward audio ip %s%s", g_cfg->forward_ip, VTY_NEWLINE);
if (g_cfg->forward_port != 0)
vty_out(vty, " forward audio port %d%s", g_cfg->forward_port, VTY_NEWLINE);
+ if (g_cfg->call_agent_addr)
+ vty_out(vty, " call agent ip %s%s", g_cfg->call_agent_addr, VTY_NEWLINE);
return CMD_SUCCESS;
}
@@ -237,6 +239,17 @@ DEFUN(cfg_mgcp_forward_port,
return CMD_SUCCESS;
}
+DEFUN(cfg_mgcp_agent_addr,
+ cfg_mgcp_agent_addr_cmd,
+ "call agent ip IP",
+ "Set the address of the call agent.")
+{
+ if (g_cfg->call_agent_addr)
+ talloc_free(g_cfg->call_agent_addr);
+ g_cfg->call_agent_addr = talloc_strdup(g_cfg, argv[0]);
+ return CMD_SUCCESS;
+}
+
int mgcp_vty_init(void)
{
install_element(VIEW_NODE, &show_mgcp_cmd);
@@ -256,6 +269,7 @@ int mgcp_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd);
install_element(MGCP_NODE, &cfg_mgcp_forward_ip_cmd);
install_element(MGCP_NODE, &cfg_mgcp_forward_port_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_agent_addr_cmd);
return 0;
}