aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp/mgcp_network.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-08 19:15:41 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-08 19:15:41 +0200
commitb3cbd9aa3b8e80060ff38b975e297a5b4a850fec (patch)
tree55335d2cbe54c9e3178dd9755d52fa33df21974c /openbsc/src/libmgcp/mgcp_network.c
parent0e62e595a697eb6075349b586ed264bdb9462cd0 (diff)
mgcp: Indicate where the sending failed
The log message does not help and says where the data is being sent to. This is because we have both a RTP and RTCP port. Remember if we failed with RTCP or RTP and improve the log message. I was searching a case where the port was bound to a local address (e.g. 127.0.0.1) and tried to send the data to a public one (e.g. 8.8.8.8).
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_network.c')
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index c39b627..abce6e4 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -94,6 +94,7 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp)
{
static char buf[] = { MGCP_DUMMY_LOAD };
int rc;
+ int was_rtcp = 0;
rc = mgcp_udp_send(endp->net_end.rtp.fd, &endp->net_end.addr,
endp->net_end.rtp_port, buf, 1);
@@ -104,6 +105,7 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp)
if (endp->tcfg->omit_rtcp)
return rc;
+ was_rtcp = 1;
rc = mgcp_udp_send(endp->net_end.rtcp.fd, &endp->net_end.addr,
endp->net_end.rtcp_port, buf, 1);
@@ -112,8 +114,10 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp)
failed:
LOGP(DMGCP, LOGL_ERROR,
- "Failed to send dummy packet: %s on: 0x%x to %s\n",
- strerror(errno), ENDPOINT_NUMBER(endp), inet_ntoa(endp->net_end.addr));
+ "Failed to send dummy %s packet: %s on: 0x%x to %s:%d\n",
+ was_rtcp ? "RTCP" : "RTP",
+ strerror(errno), ENDPOINT_NUMBER(endp), inet_ntoa(endp->net_end.addr),
+ was_rtcp ? endp->net_end.rtcp_port : endp->net_end.rtp_port);
return -1;
}