[asterisk-commits] oej: branch 1.4 r46628 - in /branches/1.4: ./ channels/ configs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Oct 31 03:26:17 MST 2006


Author: oej
Date: Tue Oct 31 04:26:16 2006
New Revision: 46628

URL: http://svn.digium.com/view/asterisk?rev=46628&view=rev
Log:
Support ;rport when we're supposed to support ;rport. Issue #7473.

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_sip.c
    branches/1.4/configs/sip.conf.sample

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?rev=46628&r1=46627&r2=46628&view=diff
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Tue Oct 31 04:26:16 2006
@@ -5265,7 +5265,8 @@
 			if (rport && *(rport+6) == '=') 
 				rport = NULL;		/* We already have a parameter to rport */
 
-			if (rport && ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) {
+			/* Check rport if NAT=yes or NAT=rfc3581 (which is the default setting)  */
+			if (rport && ((ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) || (ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_RFC3581))) {
 				/* We need to add received port - rport */
 				char tmp[256], *end;
 
@@ -5282,9 +5283,6 @@
 				}
 
 				/* Add rport to first VIA header if requested */
-				/* Whoo hoo!  Now we can indicate port address translation too!  Just
-				   another RFC (RFC3581). I'll leave the original comments in for
-				   posterity.  */
 				snprintf(new, sizeof(new), "%s;received=%s;rport=%d",
 					tmp, ast_inet_ntoa(p->recv.sin_addr),
 					ntohs(p->recv.sin_port));

Modified: branches/1.4/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.4/configs/sip.conf.sample?rev=46628&r1=46627&r2=46628&view=diff
==============================================================================
--- branches/1.4/configs/sip.conf.sample (original)
+++ branches/1.4/configs/sip.conf.sample Tue Oct 31 04:26:16 2006
@@ -243,7 +243,7 @@
 ;
 ;nat=no				; Global NAT settings  (Affects all peers and users)
                                 ; yes = Always ignore info and assume NAT
-                                ; no = Use NAT mode only according to RFC3581 
+                                ; no = Use NAT mode only according to RFC3581 (;rport)
                                 ; never = Never attempt NAT mode or RFC3581 support
 				; route = Assume NAT, don't send rport 
 				; (work around more UNIDEN bugs)



More information about the asterisk-commits mailing list