HOW TO SET NAT=NO GLOBALLY

Discussion in 'General' started by Dikic, Aug 29, 2010.

  1. Dikic

    Joined:
    Aug 18, 2010
    Messages:
    31
    Likes Received:
    0
    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
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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
     
  3. Dikic

    Joined:
    Aug 18, 2010
    Messages:
    31
    Likes Received:
    0
    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 :))
     
  4. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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
     
  5. Dikic

    Joined:
    Aug 18, 2010
    Messages:
    31
    Likes Received:
    0
    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.
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Then press the reload button instead of doing the

    ;/var/www/html/admin/modules/framework/bin/retrieve_conf
     
  7. Dikic

    Joined:
    Aug 18, 2010
    Messages:
    31
    Likes Received:
    0
    THANKS!!!
     
  8. cyrusbyte

    Joined:
    Nov 20, 2012
    Messages:
    6
    Likes Received:
    0
    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?
     
  9. Bob

    Bob

    Joined:
    Nov 4, 2007
    Messages:
    2,400
    Likes Received:
    1
    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
     

Share This Page