]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Cache local RTCP address. 46/3446/1
authorMark Michelson <mmichelson@digium.com>
Tue, 9 Aug 2016 21:19:34 +0000 (16:19 -0500)
committerMark Michelson <mmichelson@digium.com>
Tue, 9 Aug 2016 21:22:47 +0000 (16:22 -0500)
commit5c203c6ca3d6aa4d00f8dd2301913eca686f7afa
tree94557b70436d18f778e6564318c62afaa809b682
parent028171f4654e86d403b3b7b168923606f80e8cb8
res_rtp_asterisk: Cache local RTCP address.

When an RTCP packet is sent or received, res_rtp_asterisk generates a
Stasis event that contains the RTCP report as well as the local and
remote addresses that the report pertains to.

The addresses are determined using ast_find_ourip(). For the local
address, this will typically result in a lookup of the hostname of the
server, and then a DNS lookup of that hostname. If you do not have the
host in /etc/hosts, then this results in a full DNS lookup, which can
potentially block for some time.

This is especially problematic when performing RTCP reads, since those
are done on the same thread responsible for reading and writing media.

This patch addresses the issue by performing a lookup of the local
address when RTCP is allocated. We then use this cached local address
for the Stasis events when necessary.

ASTERISK-26280 #close
Reported by Mark Michelson

Change-Id: I3dd61882c2e57036f09f0c390cf38f7c87e9b556
res/res_rtp_asterisk.c