summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2017-12-21 13:19:04 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 18:59:29 +0100
commit5410a4a500f25c3c91d2a5ab55b11d6def1e5b71 (patch)
tree2a210a19d7cd09173f16c3a765ca1ee5a16b6a6d
parentd85a7b0f3e3c93505c522d197dc2d0012906f59d (diff)
libmgcp: Add separate option for osmux DSCP
-rw-r--r--openbsc/include/openbsc/mgcp.h2
-rw-r--r--openbsc/src/libmgcp/mgcp_osmux.c2
-rw-r--r--openbsc/src/libmgcp/mgcp_vty.c17
3 files changed, 19 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index f98020fa0..162323241 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -186,6 +186,8 @@ struct osmux_config {
int osmux_batch_size;
/* osmux port */
uint16_t osmux_port;
+ /* IP dscp */
+ int osmux_dscp;
/* Pad circuit with dummy messages until we see the first voice
* message.
*/
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index 79b5fefb4..5b5e6dd7e 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -427,7 +427,7 @@ int osmux_init(int role, struct osmux_config *cfg)
LOGP(DMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n");
return ret;
}
- mgcp_set_ip_tos(osmux_fd.fd, cfg->endp_dscp);
+ mgcp_set_ip_tos(osmux_fd.fd, cfg->osmux_dscp);
osmux_fd.when |= BSC_FD_READ;
ret = osmo_fd_register(&osmux_fd);
diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c
index 8c8abef91..677278ea2 100644
--- a/openbsc/src/libmgcp/mgcp_vty.c
+++ b/openbsc/src/libmgcp/mgcp_vty.c
@@ -95,6 +95,8 @@ static void config_write_osmux(struct vty *vty)
osmux_cfg.osmux_port, VTY_NEWLINE);
vty_out(vty, " dummy %s%s",
osmux_cfg.osmux_dummy ? "on" : "off", VTY_NEWLINE);
+ vty_out(vty, " ip-dscp %d%s",
+ osmux_cfg.osmux_dscp, VTY_NEWLINE);
}
}
@@ -548,7 +550,7 @@ DEFUN(cfg_mgcp_rtp_ip_dscp,
cfg_mgcp_rtp_ip_dscp_cmd,
"rtp ip-dscp <0-255>",
RTP_STR
- "Apply IP_TOS to the audio stream (including Osmux)\n" "The DSCP value\n")
+ "Apply IP_TOS to the audio stream\n" "The DSCP value\n")
{
struct mgcp_config *cfg = vty->index;
@@ -1549,6 +1551,18 @@ DEFUN(cfg_osmux_dummy,
return CMD_SUCCESS;
}
+DEFUN(cfg_osmux_ip_dscp,
+ cfg_osmux_ip_dscp_cmd,
+ "ip-dscp <0-255>",
+ "Apply IP_TOS to the Osmux stream\n" "The DSCP value\n")
+{
+ struct osmux_config *cfg = vty->index;
+
+ int dscp = atoi(argv[0]);
+ cfg->osmux_dscp = dscp;
+ return CMD_SUCCESS;
+}
+
int mgcp_vty_init(void)
{
install_element_ve(&show_mgcp_cmd);
@@ -1568,6 +1582,7 @@ int mgcp_vty_init(void)
install_element(OSMUX_NODE, &cfg_osmux_batch_size_cmd);
install_element(OSMUX_NODE, &cfg_osmux_port_cmd);
install_element(OSMUX_NODE, &cfg_osmux_dummy_cmd);
+ install_element(OSMUX_NODE, &cfg_osmux_ip_dscp_cmd);
install_element(CONFIG_NODE, &cfg_mgcp_cmd);
install_node(&mgcp_node, config_write_mgcp);