]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Cache local RTCP address. 48/3448/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:23:11 +0000 (16:23 -0500)
commit13b950f4beb23bf1a8f8b69a0237e746f21d1014
treeaea08f38667bc8c1b70b2f229cbe5dd8d94a327c
parentacf021cdec4d45f56aeb9bc87c08a00870f8a6a8
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