aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-31 00:16:28 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-31 00:16:28 +0000
commit2efdde182aed1cdcdf0541802f9c55b91b90af5f (patch)
treebf89f6c3c33136adcfbafc24af1e75194799e851
parent349e291e4b5da6f66b79daf2a94c07bf526d85a5 (diff)
First pass at handling RTP header extension bit
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3683 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xrtp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rtp.c b/rtp.c
index 51b500a96..02b30bc6f 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);