[Asterisk-cvs] asterisk rtp.c,1.85,1.86

markster at lists.digium.com markster at lists.digium.com
Mon Aug 30 20:12:58 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv27576

Modified Files:
	rtp.c 
Log Message:
First pass at handling RTP header extension bit


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- rtp.c	26 Aug 2004 04:56:26 -0000	1.85
+++ rtp.c	31 Aug 2004 00:16:28 -0000	1.86
@@ -396,6 +396,7 @@
 	int payloadtype;
 	int hdrlen = 12;
 	int mark;
+	int ext;
 	char iabuf[INET_ADDRSTRLEN];
 	unsigned int timestamp;
 	unsigned int *rtpheader;
@@ -442,8 +443,14 @@
 	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);




More information about the svn-commits mailing list