summaryrefslogtreecommitdiff
path: root/rtp.c
diff options
context:
space:
mode:
authorMatteo Brancaleoni <mbrancaleoni@espia.it>2003-03-09 06:00:18 +0000
committerMatteo Brancaleoni <mbrancaleoni@espia.it>2003-03-09 06:00:18 +0000
commit32b4c314f95fc51e6ed65e7f646b35affd1a2eb8 (patch)
tree55b729e56a44996fffed585a06617bfd8b0602ac /rtp.c
parentd50ea0e9d465ea8eaf09844660d597f4291cab7c (diff)
Sun Mar 9 07:00:01 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rtp.c b/rtp.c
index 54b7e945b..fb3ea671f 100755
--- a/rtp.c
+++ b/rtp.c
@@ -282,7 +282,11 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
}
if (rtp->nat) {
/* Send to whoever sent to us */
- memcpy(&rtp->them, &sin, sizeof(rtp->them));
+ if ((rtp->them.sin_addr.s_addr != sin.sin_addr.s_addr) ||
+ (rtp->them.sin_port != sin.sin_port)) {
+ memcpy(&rtp->them, &sin, sizeof(rtp->them));
+ ast_log(LOG_DEBUG, "RTP NAT: Using address %s:%d\n", inet_ntoa(rtp->them.sin_addr), ntohs(rtp->them.sin_port));
+ }
}
/* Get fields */
seqno = ntohl(rtpheader[0]);