]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: RTT miscalculation in RTCP 90/4490/1
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 16:15:25 +0000 (11:15 -0500)
commitf8f197a6ee66a359d93a5d870b51e075a6cd6e76
treed2bebec13bd60db1052cc649f216e0c85105cd4b
parentbba4204fa1290cf9ccea46c215f0dc981cc0bde5
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