HOW TO SET NAT=NO GLOBALLY

Dikic

Joined
Aug 18, 2010
Messages
31
Likes
0
Points
0
#1
Hi,

i have a problem with nat, my phone (cisco 7941) want registe unless nat = no is set on extensions settings.

Is there any way to set this up globally because i have around 500 extensions :D


THX
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#2
I suggest you locate download and install "bulk-extensions" an add-on for FreePBX you will be able to use in the unembedded FreePBX, to download edit and re-upload them all.

dicko
 

Dikic

Joined
Aug 18, 2010
Messages
31
Likes
0
Points
0
#3
Thanks but this module is not working as it should, it has the same problem like the Batch Of Extensions inside Elastix, the bug which i reported one week ago, the bug is fixed now in Elastix but not in freePBX.

Im still looking for option to set nat = no globally without have to editing all 500 extensions :))
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#4
If I wanted to do that, then:

If I was using Elastix 2.0 something like:-

mysql -uroot -p`cat /etc/elastix.conf |grep mysqlrootpwd|cut -d "=" -f 2` -D asterisk -e ' update sip set data = "no" where keyword = "nat"' ;/var/www/html/admin/modules/framework/bin/retrieve_conf

if using an earlier version then :-

mysql -uroot -peLaStIx.2oo7 -D asterisk -e ' update sip set data = "no" where keyword = "nat"' ; /var/www/html/admin/modules/framework/bin/retrieve_conf

as always make a backup first, I might be wrong, and unfortunately it doesn't satisfy your request as it just sets all of them to "no", new ones by default will still come up by default as "yes"

dicko
 

Dikic

Joined
Aug 18, 2010
Messages
31
Likes
0
Points
0
#5
Thanks, its working form what i can see, but, this is the output, is this ok?

Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf ..OK
Bootstrapping /etc/amportal.conf ..OK
Parsing /etc/amportal.conf ..OK
Parsing /etc/asterisk/asterisk.conf ..OK
Connecting to database..OK
PHP Warning: Missing argument 1 for connectdirs::create(), called in /var/www/html/admin/modules/framework/bin/retrieve_conf on line 441 and defined in /var/www/html/admin/modules/framework/bin/retrieve_conf on line 13
Connecting to Asterisk manager interface..OK
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib64/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = elastix456
Added to globals: AMPDBENGINE = mysql
Added to globals: AMPDBHOST = localhost
Added to globals: AMPDBNAME = asterisk
Added to globals: AMPDBUSER = asteriskuser
Added to globals: AMPDBPASS = eLaStIx.asteriskuser.2oo7
[ERROR] error running retrieve_op_conf_from_mysql.php
Please update your modules and reload Asterisk by browsing to your server.
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#6
Then press the reload button instead of doing the

;/var/www/html/admin/modules/framework/bin/retrieve_conf
 

Dikic

Joined
Aug 18, 2010
Messages
31
Likes
0
Points
0
#7
THANKS!!!
 

cyrusbyte

Joined
Nov 20, 2012
Messages
6
Likes
0
Points
0
#8
I have a similar problem, but when i create new extensions it automatically sets them to nat=yes, not a huge problem just have to remember each time a create a single extension that i have to change it. Is there a way to set it so that when creating a extensions from the gui that it will make nat=no by default?
 

Bob

Joined
Nov 4, 2007
Messages
2,400
Likes
1
Points
36
#9
cyrusbyte,

It has been a question that has been raised a few times....

The Freepbx developers do not recognise that there are some instances where this is necessary.

http://www.freepbx.org/forum/freepbx/us ... d-behavior

It can be changed, however as it is a core component of Freepbx, any update of the core component will overwrite the change. As to where....a nice weekend project for you, but as a starter possibly in the /var/www/html/admin/functions.inc.php or at least one of the files in this particular area.

Regards

Bob
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top