From: Mark Spencer Date: Tue, 31 Aug 2004 00:16:28 +0000 (+0000) Subject: First pass at handling RTP header extension bit X-Git-Tag: 1.0.0~143 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b48987922cbc1732af7990675b1b899739efaf92;p=thirdparty%2Fasterisk.git First pass at handling RTP header extension bit git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3683 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/rtp.c b/rtp.c index 51b500a961..02b30bc6fd 100755 --- a/rtp.c +++ b/rtp.c @@ -396,6 +396,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) int payloadtype; int hdrlen = 12; int mark; + int ext; char iabuf[INET_ADDRSTRLEN]; unsigned int timestamp; unsigned int *rtpheader; @@ -442,8 +443,14 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) seqno = ntohl(rtpheader[0]); payloadtype = (seqno & 0x7f0000) >> 16; mark = seqno & (1 << 23); + ext = seqno & (1 << 28); seqno &= 0xffff; timestamp = ntohl(rtpheader[1]); + if (ext) { + /* RTP Extension present */ + hdrlen += 4; + hdrlen += (rtpheader[3] & 0xffff) << 2; + } #if 0 printf("Got RTP packet from %s:%d (type %d, seq %d, ts %d, len = %d)\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp,res - hdrlen);