找回密码
 注册

QQ登录

只需一步,快速开始

BCM 门户 IT世界 系统管理 查看内容

FreePBX Install Guide (CentOS v5.x, Asterisk v1.6.x, FreePBX)

2011-11-6 17:50| 发布者: Test| 查看: 4716| 评论: 0|来自: PowerPBX.org

摘要: UPDATED for Asterisk v1.6.2 and FreePBX v2.8 Includes every detail in the form of step by step instructions from bare metal to a running VoIP PBX in about 2 hours. When installing Linux, do NOT inst ...

Prioritize Asterisk Process

You can experiment with different values and see what works best.  I wouldn't go too high as it could cause other problems.  From the command 'top' the PR column shows absolute priority and NI column is the relative number we add here.  Default is 0 which gives Asterisk about the same default priority as httpd and mysql.  5-10 should give top priority without crippling critical background tasks.  I believe this setting can go as high as 20.  This is only a prioritization recommendation setting.  The linux process scheduler still has ultimate authority so actual priority will vary from system to system depending on what else is installed.
nano +22 /usr/sbin/safe_asterisk
PRIORITY=10

Firewall/Router configuration

The following ports needed to be forwarded to the asterisk server for various remote access

Port 80 (Freepbx web access)
Port 4445 (Flash Operator Panel web access)
Port 4569 (IAX remote phone clients)
Port 5059-5061 (registration and proxy server access, default is 5060)
Port 10000-20000 (ports reserved for RTP voice packets for SIP phone conversations by Asterisk)

NOTE: The RTP ports 10000-xxxxx forwarded in the firewall/router need to match the setting in /etc/asterisk/rtp.conf


External SIP extensions

nano /etc/asterisk/sip_nat.conf
nat=yes
externip=<your fixed external IP> or
;externhost=yourdns.com
localnet=192.168.1.0/255.255.255.0
externrefresh=10

(Ctrl-X>y>ENTER)

Also, when adding the external SIP extension in FreePBX, make sure to change the nat=never default in the configuration to nat=yes for the extension that will be external.


Logger.conf setup

By default, Asterisk/Freepbx installs with full (debug and verbose) logging enabled.  This generates a significant amount of extra write activity to the hard drives and creates a very large "var/log/asterisk/full" log file in a short amount of time.  After the initial settling in period when debug logging is no longer required it is a good idea to disable this to reduce the stress on the drives and extend their life.

nano /etc/asterisk/logger.conf

change
full => notice,warning,error,debug,verbose
to
full => notice,warning,error,verbose

you will need to restart Asterisk or type LOGGER ROTATE at the CLI to get this change to take effect (reload doesn't do it apparently).


Logrotate setup

Asterisk/FreePBX does not set up a configuration to automatically rotate the log files for some reason.  Kind of suprising.  I only noticed because the /var/log/asterisk/full log file got to 300MB after only a month.  It would probably crash the system after awhile.  Create  the following file.

nano /etc/logrotate.d/asterisk

Now add the following  to make sure the asterisk log files are rotated weekly along with all the other log files.

/var/log/asterisk/messages /var/log/asterisk/*log /var/log/asterisk/full {
   missingok
   notifempty
   sharedscripts
   create 0640 asterisk asterisk
   postrotate
   /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
   endscript
}


Sendmail configuration

Edit /etc/aliases file  and add a “root: username_to_forward_to” to forward all ‘root’ messages to your personal email address.  Put in the full email address if it is not on the asterisk system itself.
Then run  
/usr/bin/newaliases
to restart the service.

If emails are not received you must set up masquerading in sendmail.  These still may be rejected if the email server requires the source of the email to also resolve to the same DNS that sendmail is masquerading as.
To enable this, add the following lines to the /etc/mail/sendmail.mc file:
MASQUERADE_AS(domain.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(domain.com)dnl
 

Put a “dnl” in front of the line ”EXPOSED_USER (`root’) dnl”.  This enables host masquerading for root as well which is disabled by default.
Update the Sendmail configuration files using the m4 macro processor to generate a new sendmail.cf file by executing the following command:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
To get the Sendmail macro file, the sendmail-cf package must be installed on the system.
After creating a new /etc/mail/sendmail.cf file, restart Sendmail for the changes to take effect. To do this, use the following command:
# service sendmail restart
 
nano /etc/asterisk/vm_general.inc
 
change serveremail=vm@asterisk to whom ever you want it to appear voicemail emails are coming from.

NOTE: If you are installing on a LAN or do not have a domain resolving to the IP of the VPS, Sendmail will hang for a couple minutes everytime you reboot.  To prevent this your VPS hostname should end with .local or .localhost.  So, for example, instead of naming the VPS hostname 'powerpbx' it should be named 'powerpbx.local'.  The manual method is to edit your /etc/hosts file.  There should be 2 lines.
127.0.0.1 localhost.localdomain localhost
yourIPaddress yourhostname.local yourhostname yourhostname





鲜花

握手

雷人

路过

鸡蛋

相关阅读

最新评论

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )

GMT-8, 2026-4-11 09:10 , Processed in 0.024539 second(s), 18 queries .

Supported by Weloment Group X3.5

© 2008-2026 Best Deal Online

返回顶部