aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-29 23:41:16 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-29 23:41:16 +0000
commit1c3d04e2a896adab0b2ee5a818e627c87beb03de (patch)
tree9779edc6b553976e695a26b13f7853f919ef4a62 /main
parent1f3e9bf74650723b32991de17e26dc5f07dd88c4 (diff)
Move the direct bridge write to after the NAT handling code
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41285 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 4fdde194c..9e32ebd65 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1042,15 +1042,12 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
return &ast_null_frame;
}
- if (version != 2)
- return &ast_null_frame;
- /* Ignore if the other side hasn't been given an address
- yet. */
+ /* If we don't have the other side's address, then ignore this */
if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
return &ast_null_frame;
+ /* Send to whoever send to us if NAT is turned on */
if (rtp->nat) {
- /* Send to whoever sent to us */
if ((rtp->them.sin_addr.s_addr != sin.sin_addr.s_addr) ||
(rtp->them.sin_port != sin.sin_port)) {
rtp->them = sin;
@@ -1065,6 +1062,13 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
}
}
+ /* If we are bridged to another RTP stream, send direct */
+ if (rtp->bridged && !bridge_p2p_write(rtp, rtpheader, res, hdrlen))
+ return &ast_null_frame;
+
+ if (version != 2)
+ return &ast_null_frame;
+
payloadtype = (seqno & 0x7f0000) >> 16;
padding = seqno & (1 << 29);
mark = seqno & (1 << 23);