summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2016-07-18 12:13:25 +0200
committerAlexander Traud <pabstraud@compuserve.com>2016-07-18 12:19:56 +0200
commitcb5e3445be6c55517c8d05aca601b648341f8ae9 (patch)
tree96e6483af0d6190f74f9fdb337fe1950dfb527c9 /res/res_rtp_asterisk.c
parent26b47608080c6b0f8a41471859560630bf04a7a0 (diff)
res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets.
With this change, the initial RTP sequence number is randomly chosen not between 0 and 65535 (0xffff) but 0 and 32767 (0x7fff). This assures, the roll-over counter (ROC) synchronization is not lost for sRTP, when the very first RTP packets get lost; see http://srtp.sourceforge.net/faq.html#Q6 ASTERISK-26207 #close Change-Id: I9a527e3aa3ce8f3becc5131d7ba32b57b5845464
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index c8d7f4630..6cf69ef0d 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -2592,7 +2592,7 @@ static int ast_rtp_new(struct ast_rtp_instance *instance,
/* Set default parameters on the newly created RTP structure */
rtp->ssrc = ast_random();
- rtp->seqno = ast_random() & 0xffff;
+ rtp->seqno = ast_random() & 0x7fff;
rtp->strict_rtp_state = (strictrtp ? STRICT_RTP_LEARN : STRICT_RTP_OPEN);
if (strictrtp) {
rtp_learning_seq_init(&rtp->rtp_source_learn, (uint16_t)rtp->seqno);