[asterisk-commits] oej: trunk r46629 - in /trunk: ./ channels/chan_sip.c configs/sip.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Oct 31 03:29:25 MST 2006


Author: oej
Date: Tue Oct 31 04:29:24 2006
New Revision: 46629

URL: http://svn.digium.com/view/asterisk?rev=46629&view=rev
Log:
Fix rport handling.

...where did the 1.2 properties come from, really? they're back.

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

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

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

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

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=46629&r1=46628&r2=46629&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Oct 31 04:29:24 2006
@@ -5330,7 +5330,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;
 
@@ -5347,9 +5348,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: trunk/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/sip.conf.sample?rev=46629&r1=46628&r2=46629&view=diff
==============================================================================
--- trunk/configs/sip.conf.sample (original)
+++ trunk/configs/sip.conf.sample Tue Oct 31 04:29:24 2006
@@ -255,7 +255,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