From: Olle Johansson Date: Tue, 31 Oct 2006 09:49:46 +0000 (+0000) Subject: Another try to fix ;rport NAT traversal support (issue #7473) X-Git-Tag: 1.2.14~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a662fe33e3a17136a07493517c675bcfc8c88b9;p=thirdparty%2Fasterisk.git Another try to fix ;rport NAT traversal support (issue #7473) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46610 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2ec0cb3360..4dd1b931e5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3936,7 +3936,7 @@ static int copy_via_headers(struct sip_pvt *p, struct sip_request *req, struct s if (rport && *(rport+6) == '=') rport = NULL; /* We already have a parameter to rport */ - if (rport && (ast_test_flag(p, SIP_NAT) == SIP_NAT_ALWAYS)) { + if (rport && ((ast_test_flag(p, SIP_NAT) == SIP_NAT_ALWAYS) || (ast_test_flag(p, SIP_NAT) == SIP_NAT_RFC3581))) { /* We need to add received port - rport */ ast_copy_string(tmp, oh, sizeof(tmp)); diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index 889d959ea1..f080e149b4 100644 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -187,7 +187,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls ; ;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)