aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-19 17:00:58 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-19 17:00:58 +0000
commit364604e4ad11cde2597eb66f73222555b7452a1c (patch)
tree9d1442f4dac620ad26fb85db3a4573ad35f72467
parent3b437bc65697cf5cb041d616f2ec04559d240ac6 (diff)
Handle the CC field in the RTP header. (issue #9384 reported by DoodleHu)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@69992 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--rtp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rtp.c b/rtp.c
index 81cddd0c7..f0430b511 100644
--- a/rtp.c
+++ b/rtp.c
@@ -437,6 +437,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
int padding;
int mark;
int ext;
+ int cc;
int x;
char iabuf[INET_ADDRSTRLEN];
unsigned int ssrc;
@@ -497,6 +498,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
padding = seqno & (1 << 29);
mark = seqno & (1 << 23);
ext = seqno & (1 << 28);
+ cc = (seqno & 0xF000000) >> 24;
seqno &= 0xffff;
timestamp = ntohl(rtpheader[1]);
ssrc = ntohl(rtpheader[2]);
@@ -514,10 +516,15 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
res -= rtp->rawdata[AST_FRIENDLY_OFFSET + res - 1];
}
+ if (cc) {
+ /* CSRC fields present */
+ hdrlen += cc*4;
+ }
+
if (ext) {
/* RTP Extension present */
+ hdrlen += (ntohl(rtpheader[hdrlen/4]) & 0xffff) << 2;
hdrlen += 4;
- hdrlen += (ntohl(rtpheader[3]) & 0xffff) << 2;
}
if (res < hdrlen) {