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).
This commit is contained in:
Holger Hans Peter Freyther 2015-10-08 19:15:41 +02:00
parent 0e62e595a6
commit b3cbd9aa3b
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}