From a3ad8b28e6fcb515741e13c927818ffdb73f2398 Mon Sep 17 00:00:00 2001 From: "Michael L. Young" Date: Fri, 1 Mar 2013 04:32:01 +0000 Subject: Fix / Clean Up Some Items To Handle The New auto_* NAT Options The original report had to do with a realtime peer behind NAT being pruned and the peer's private address being used instead of its external address. Upon debugging, it was discovered that this was being caused by the addition of the auto_force_rport and auto_comedia settings. This patch does the following: * Adds a missing note to the CHANGES file indicating that the default global nat setting is auto_force_rport * Constify the 'req' parameter for check_via() * Add calls to check_via() in a couple of places in order for the auto_* settings to do their job in attempting to determine if NAT is involved * Set the flags SIP_NAT_FORCE_RPORT and SIP_PAGE2_SYMMETRICRTP if the auto_* settings are in use where it was needed * Moves the copying of peer flags up in build_peer() to before they are used; this fixes the realtime prune issue * Update the contrib/realtime schemas to allow the nat column to handle the different nat setting combinations we have This patch received a review and "Ship It!" on the issue itself. (closes issue ASTERISK-20904) Reported by: JoshE Tested by: JoshE, Michael L. Young Patches: asterisk-20904-nat-auto-and-rt-peersv2.diff Michael L. Young (license 5026) ........ Merged revisions 382322 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382323 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- contrib/realtime/mysql/sippeers.sql | 2 +- contrib/realtime/postgresql/realtime.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/realtime') diff --git a/contrib/realtime/mysql/sippeers.sql b/contrib/realtime/mysql/sippeers.sql index 5c58df7ea..e0dbe1a43 100644 --- a/contrib/realtime/mysql/sippeers.sql +++ b/contrib/realtime/mysql/sippeers.sql @@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS `sippeers` ( `transport` enum('udp','tcp','udp,tcp','tcp,udp') DEFAULT NULL, `dtmfmode` enum('rfc2833','info','shortinfo','inband','auto') DEFAULT NULL, `directmedia` enum('yes','no','nonat','update') DEFAULT NULL, - `nat` enum('yes','no','never','route') DEFAULT NULL, + `nat` varchar(29) DEFAULT NULL, `callgroup` varchar(40) DEFAULT NULL, `pickupgroup` varchar(40) DEFAULT NULL, `language` varchar(40) DEFAULT NULL, diff --git a/contrib/realtime/postgresql/realtime.sql b/contrib/realtime/postgresql/realtime.sql index abcadd2fd..cba8d3895 100644 --- a/contrib/realtime/postgresql/realtime.sql +++ b/contrib/realtime/postgresql/realtime.sql @@ -48,7 +48,7 @@ insecure character varying(4), "language" character varying(2), mailbox character varying(50), md5secret character varying(80), -nat character varying(5) DEFAULT 'no' NOT NULL, +nat character varying(29) DEFAULT '' NOT NULL, permit character varying(95), deny character varying(95), mask character varying(95), -- cgit v1.2.3