[PATCH 9/9] Fixed problem of mute audio on some calls

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Andreas Eversberg jolly at eversberg.eu
Fri Mar 16 07:14:23 UTC 2012


When reading from RTP socket, the first read() may fail right after
connecting to remote socket. Subsequent read() will work as it should.

If the remote socket does not open fast enough, the transmitted RTP
payload can cause an ICMP (connection refused) packet reply. This causes
the read to fail with errno=111. In all other error cases, the errno is
logged at debug level. In all error cases, reading is not disabled.
---
 openbsc/src/libtrau/rtp_proxy.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c
index 88753b6..bb158e8 100644
--- a/openbsc/src/libtrau/rtp_proxy.c
+++ b/openbsc/src/libtrau/rtp_proxy.c
@@ -503,9 +503,16 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss)
 		return -ENOMEM;
 
 	rc = read(rss->bfd.fd, msg->data, RTP_ALLOC_SIZE);
+	if (rc == 0)
+		goto out_free;
 	if (rc <= 0) {
-		rss->bfd.when &= ~BSC_FD_READ;
-		return rc;
+		/* Ignore "connection refused". this happens, If we open the
+		 * socket faster than the remove side. */
+		if (errno == 111)
+			return 0;
+		DEBUGPC(DLMUX, "Read of RTP socket (%p) failed (errno %d)\n",
+			rs, errno);
+		goto out_free;
 	}
 
 	msgb_put(msg, rc);
-- 
1.8.1.5


--------------050303020108080701030307--




More information about the OpenBSC mailing list