aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-09 06:00:18 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-09 06:00:18 +0000
commita5b75bca3546f01dbcf717e036fb85da8a8a8a88 (patch)
tree55b729e56a44996fffed585a06617bfd8b0602ac /rtp.c
parentfe1433baf16899179f3c88d94b825af48b000880 (diff)
Sun Mar 9 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@636 f38db490-d61c-443f-a65b-d21fe96a405b
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]);