summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-09-28 22:32:18 +0000
committerMatthew Jordan <mjordan@digium.com>2013-09-28 22:32:18 +0000
commitc4b5c549fd0afb5b9657e64ff0e9beb0fa79a74d (patch)
tree0efdfa038d3806f277b7adfc6947d9cacea26d3c /res
parent8ddd829b8b92968d1d9c2f7609e6bd2b2bcc04ed (diff)
res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
RTCP's calculation of the number of lost packets in an RTP stream is based on that stream's sequence number count, the number of received packets, and how many packets we expect to receive. When the SSRC for an RTP stream changes, there can - and almost always will be - a large jump in the next packet's timestamp and sequence number. If we don't reset the number of received packets, sequence number count, and other metrics used by RTCP, the next RR/SR report will use the previous SSRC's values to calculate the lost packet count for the new SSRC - resulting in a very large number of lost packets. This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it will reset the various values used by the RTCP calculations. From the perspective of RTCP, this appears as a new media stream - which is what it is. Review: https://reviewboard.asterisk.org/r/2886/ (closes issue AST-1174) Reported by: Thomas Arimont ........ Merged revisions 400089 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400093 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 400108 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_rtp_asterisk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index a5990c60f..c2b8453c4 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3689,6 +3689,12 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
f = ast_frisolate(&srcupdate);
AST_LIST_INSERT_TAIL(&frames, f, frame_list);
+ rtp->seedrxseqno = 0;
+ rtp->rxcount = 0;
+ rtp->cycles = 0;
+ rtp->lastrxseqno = 0;
+ rtp->rtcp->expected_prior = 0;
+ rtp->rtcp->received_prior = 0;
rtp->last_seqno = 0;
rtp->last_end_timestamp = 0;
}