aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp/mgcp_network.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-19 18:25:54 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-01-16 13:20:49 +0100
commit34bdc9f8fe3862ce3213820d356a8ebbc45b7362 (patch)
tree60c55125e311c30ecf831a4811866812928abe54 /openbsc/src/libmgcp/mgcp_network.c
parent785e3c95d76d58e1a6a9559e197db5679edea721 (diff)
mgcp/rtp: Send dummy packet to the RTCP destination, too
Currently a dummy packet is only sent to the RTP port. This is not enough if RTCP must also cross the SNAT. This patch sends an additional dummy packet to the RTCP net destination if omit_rtcp is not set. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_network.c')
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 04e6cbef..0cc20416 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -129,9 +129,16 @@ static int mgcp_udp_send(int fd, struct in_addr *addr, int port, char *buf,
int mgcp_send_dummy(struct mgcp_endpoint *endp)
{
static char buf[] = { MGCP_DUMMY_LOAD };
+ int rc;
+
+ rc = mgcp_udp_send(endp->net_end.rtp.fd, &endp->net_end.addr,
+ endp->net_end.rtp_port, buf, 1);
+
+ if (rc == -1 || endp->tcfg->omit_rtcp)
+ return rc;
- return mgcp_udp_send(endp->net_end.rtp.fd, &endp->net_end.addr,
- endp->net_end.rtp_port, buf, 1);
+ return mgcp_udp_send(endp->net_end.rtcp.fd, &endp->net_end.addr,
+ endp->net_end.rtcp_port, buf, 1);
}
static int32_t compute_timestamp_aligment_error(struct mgcp_rtp_stream_state *sstate,