From 6a9d61dffdd357ce72dfb1d5fee7da81785daf93 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 10 Feb 2021 19:22:09 +0100 Subject: [PATCH] TT#108003 Check send() return code for DTMF UDP logging Log an error and continue anyway if the send() failed, this is just logging. Change-Id: I542385489f8e37e6e524b766371fed3ba558ff2f --- daemon/dtmf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/dtmf.c b/daemon/dtmf.c index 17b82811f..7a5df74e9 100644 --- a/daemon/dtmf.c +++ b/daemon/dtmf.c @@ -133,7 +133,10 @@ int dtmf_event(struct media_packet *mp, str *payload, int clockrate) { if (_log_facility_dtmf) dtmflog(buf); if (dtmf_log_sock.family) - send(dtmf_log_sock.fd, buf->str, buf->len, 0); + if (send(dtmf_log_sock.fd, buf->str, buf->len, 0) < 0) + ilog(LOG_ERR, "Error sending DTMF event info to UDP socket: %s", + strerror(errno)); + if (rtpe_config.dtmf_via_ng) dtmf_bencode_and_notify(mp, dtmf, clockrate); g_string_free(buf, TRUE);