mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-07 10:28:32 +00:00
Move the direct bridge write to after the NAT handling code
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
14
main/rtp.c
14
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);
|
||||
|
||||
Reference in New Issue
Block a user