]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: RTT miscalculation in RTCP 97/4397/2
authorgestoip2 <gestoip2@ull.edu.es>
Fri, 11 Nov 2016 14:16:50 +0000 (14:16 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 23 Nov 2016 03:20:17 +0000 (21:20 -0600)
commit8756ce64b7874dbcc0cd9a47aa09fc21cb4f9f81
tree1f091339bd4b09a3b4632629c2e0fe2b1e8cd1d2
parent425da14927f10205911f5db6d6b193b22203c224
res_rtp_asterisk: RTT miscalculation in RTCP

When retrieving RTCP stats for PJSIP channels, RTT values are unreliable.
RTT calculation is correct, but the data representation isn't.  RTT is
represented by a 32-bit fixed-point number with the integer part in the
first 16 bits and the fractional part in the last 16 bits.  In order to
get the RTT value, the fractional part is miscalculated, there is an
unnecessary 16 bit shift that causes overflow.  Besides this there is
another mistake, when transforming the integer value to the fixed point
fractional part via bitwise operation, that loses precision.

* RTT fractional part is no longer shifted, avoiding overflow.

* RTT fractional part is transformed to its fixed-point value more
precisely.

* Fixed timeval2ntp() and ntp2timeval() second fraction conversions.

* Fixed NTP timestamp report logging.  The usec was inexplicably
multiplied by 4096.

ASTERISK-26566 #close
Reported by Hector Royo Concepcion

Change-Id: Ie09bdabfee75afb3f1b8ddfd963e5219ada3b96f
main/rtp_engine.c
res/res_rtp_asterisk.c