mgcp: Honor the rtp IP_TOS settings for Osmux
Honor the IP_TOS settings for Osmux as well. Re-use the RTP setting as it makes sense to classify the audio packets the same way. Fixes: OW#1369
This commit is contained in:
parent
d91934357f
commit
9be675ea52
|
@ -253,6 +253,8 @@ void mgcp_rtp_annex_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
|
||||||
const uint16_t seq, const int32_t transit,
|
const uint16_t seq, const int32_t transit,
|
||||||
const uint32_t ssrc);
|
const uint32_t ssrc);
|
||||||
|
|
||||||
|
int mgcp_set_ip_tos(int fd, int tos);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MGCP_DEST_NET = 0,
|
MGCP_DEST_NET = 0,
|
||||||
MGCP_DEST_BTS,
|
MGCP_DEST_BTS,
|
||||||
|
|
|
@ -901,7 +901,7 @@ int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_ip_tos(int fd, int tos)
|
int mgcp_set_ip_tos(int fd, int tos)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
ret = setsockopt(fd, IPPROTO_IP, IP_TOS,
|
ret = setsockopt(fd, IPPROTO_IP, IP_TOS,
|
||||||
|
@ -925,8 +925,8 @@ static int bind_rtp(struct mgcp_config *cfg, struct mgcp_rtp_end *rtp_end, int e
|
||||||
goto cleanup1;
|
goto cleanup1;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp);
|
mgcp_set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp);
|
||||||
set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp);
|
mgcp_set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp);
|
||||||
|
|
||||||
rtp_end->rtp.when = BSC_FD_READ;
|
rtp_end->rtp.when = BSC_FD_READ;
|
||||||
if (osmo_fd_register(&rtp_end->rtp) != 0) {
|
if (osmo_fd_register(&rtp_end->rtp) != 0) {
|
||||||
|
|
|
@ -420,6 +420,7 @@ int osmux_init(int role, struct mgcp_config *cfg)
|
||||||
LOGP(DMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n");
|
LOGP(DMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
mgcp_set_ip_tos(osmux_fd.fd, cfg->endp_dscp);
|
||||||
osmux_fd.when |= BSC_FD_READ;
|
osmux_fd.when |= BSC_FD_READ;
|
||||||
|
|
||||||
ret = osmo_fd_register(&osmux_fd);
|
ret = osmo_fd_register(&osmux_fd);
|
||||||
|
|
|
@ -378,7 +378,7 @@ DEFUN(cfg_mgcp_rtp_ip_dscp,
|
||||||
cfg_mgcp_rtp_ip_dscp_cmd,
|
cfg_mgcp_rtp_ip_dscp_cmd,
|
||||||
"rtp ip-dscp <0-255>",
|
"rtp ip-dscp <0-255>",
|
||||||
RTP_STR
|
RTP_STR
|
||||||
"Apply IP_TOS to the audio stream\n" "The DSCP value\n")
|
"Apply IP_TOS to the audio stream (including Osmux)\n" "The DSCP value\n")
|
||||||
{
|
{
|
||||||
int dscp = atoi(argv[0]);
|
int dscp = atoi(argv[0]);
|
||||||
g_cfg->endp_dscp = dscp;
|
g_cfg->endp_dscp = dscp;
|
||||||
|
|
Loading…
Reference in New Issue