aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-12 20:06:16 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-12 20:06:16 +0200
commita777c9ee3d4e433c713f7a5c346519aa0321f096 (patch)
tree6cdff2927cf80118f5564fc1e54cabb567f948fb /openbsc/src/libmgcp
parent9861c122dd50386f4b48bb65162f0a38f6d28785 (diff)
osmux: Allow to listen to a specific address
For a setup with multiple network interfaces be able to pick the one that osmux should be used/visible.
Diffstat (limited to 'openbsc/src/libmgcp')
-rw-r--r--openbsc/src/libmgcp/mgcp_osmux.c2
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c1
-rw-r--r--openbsc/src/libmgcp/mgcp_vty.c12
3 files changed, 14 insertions, 1 deletions
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index 2d39b2c5..be0db992 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -415,7 +415,7 @@ int osmux_init(int role, struct mgcp_config *cfg)
}
osmux_fd.data = cfg;
- ret = mgcp_create_bind("0.0.0.0", &osmux_fd, cfg->osmux_port);
+ ret = mgcp_create_bind(cfg->osmux_addr, &osmux_fd, cfg->osmux_port);
if (ret < 0) {
LOGP(DMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n");
return ret;
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index 42ce8bb2..1819ceaf 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -1193,6 +1193,7 @@ struct mgcp_config *mgcp_config_alloc(void)
cfg->source_port = 2427;
cfg->source_addr = talloc_strdup(cfg, "0.0.0.0");
+ cfg->osmux_addr = talloc_strdup(cfg, "0.0.0.0");
cfg->transcoder_remote_base = 4000;
diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c
index c478b0a7..13f66c50 100644
--- a/openbsc/src/libmgcp/mgcp_vty.c
+++ b/openbsc/src/libmgcp/mgcp_vty.c
@@ -153,6 +153,8 @@ static int config_write_mgcp(struct vty *vty)
break;
}
if (g_cfg->osmux) {
+ vty_out(vty, " osmux bind-ip %s%s",
+ g_cfg->osmux_addr, VTY_NEWLINE);
vty_out(vty, " osmux batch-factor %d%s",
g_cfg->osmux_batch, VTY_NEWLINE);
vty_out(vty, " osmux batch-size %u%s",
@@ -1282,6 +1284,15 @@ DEFUN(cfg_mgcp_osmux,
return CMD_SUCCESS;
}
+DEFUN(cfg_mgcp_osmux_ip,
+ cfg_mgcp_osmux_ip_cmd,
+ "osmux bind-ip A.B.C.D",
+ OSMUX_STR IP_STR "IPv4 Address to bind to\n")
+{
+ bsc_replace_string(g_cfg, &g_cfg->osmux_addr, argv[0]);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_mgcp_osmux_batch_factor,
cfg_mgcp_osmux_batch_factor_cmd,
"osmux batch-factor <1-8>",
@@ -1382,6 +1393,7 @@ int mgcp_vty_init(void)
install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_send_name_cmd);
install_element(MGCP_NODE, &cfg_mgcp_no_sdp_payload_send_name_cmd);
install_element(MGCP_NODE, &cfg_mgcp_osmux_cmd);
+ install_element(MGCP_NODE, &cfg_mgcp_osmux_ip_cmd);
install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_factor_cmd);
install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_size_cmd);
install_element(MGCP_NODE, &cfg_mgcp_osmux_port_cmd);