From 84ea0a22d6463da34d4ac08abe5149b8c6c471fa Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 6 Oct 2007 17:26:33 +0000 Subject: [PATCH] Changed RTP initial sequence number to be within 15bit number, as required by RFC 3711 (SRTP) git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1481 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia/rtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pjmedia/src/pjmedia/rtp.c b/pjmedia/src/pjmedia/rtp.c index 6dc11fd79..9658a1c4c 100644 --- a/pjmedia/src/pjmedia/rtp.c +++ b/pjmedia/src/pjmedia/rtp.c @@ -63,7 +63,8 @@ PJ_DEF(pj_status_t) pjmedia_rtp_session_init( pjmedia_rtp_session *ses, pj_bzero(ses, sizeof(*ses)); /* Initial sequence number SHOULD be random, according to RFC 3550. */ - ses->out_extseq = pj_rand(); + /* According to RFC 3711, it should be random within 2^15 bit */ + ses->out_extseq = pj_rand() & 0x7FFF; ses->peer_ssrc = 0; /* Build default header for outgoing RTP packet. */