]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Cache local RTCP address. 45/3445/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:19:34 +0000 (16:19 -0500)
commita119bab6a66bd38243b242bb724b2ce874b89dae
tree8b6a94d3895abd03e178dd2cf0cb340c2eb47bd3
parent829b4ba8b3a5f74f9568adefc41d3ca2ac9876c5
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