设为首页 收藏本站
查看: 2434|回复: 0

[经验分享] 基于freeswitch的ASTPP计费系统的安装 CentOS7篇

[复制链接]

尚未签到

发表于 2019-2-16 07:24:32 | 显示全部楼层 |阅读模式
我只是个搬运工和测试员,怕有一天国外网站挂了,才转载到这里。
  原帖在https://www.powerpbx.org/content/astpp-voip-billing-v36-centos-v7-freeswitch-v16-apachev24-install-guide-v1
  与官方文档的安装方法相比较,本文对细节的处理更细致合理,各种脚本比如启动脚本,防火墙脚本都很完善,无需改动既可使用。推荐有兴趣的朋友用此方式安装。欢迎大家加我的联系方式一起讨论,学习。
  QQ and Wechat 541634268。
  This guide covers the installation of the ASTPP VoIP billing and Freeswitch applications.  ASTPP is installed manually from source.  Freeswitch is installed from RPMs.
  Tested using the following software:
  CentOS v7 minimal install
  Freeswitch v1.6
  ASTPP v3.6
  Apache v2.4
  PHP v7.1
  MariaDB v5.5
  Prerequisites
  yum -y install epel-release && yum -y update
  yum -y install git nano httpd unixODBC mysql-connector-odbc ghostscript libtiff-devel libtiff-tools at mariadb mariadb-server postfix
  PHP
  yum -y install https://centos7.iuscommunity.org/ius-release.rpm
  yum -y install yum-plugin-replace
This updates any existing default version PHP files
  yum replace php-common --replace-with php71u-common
  yum -y install php71u php71u-common php71u-pdo php71u-soap php71u-xml php71u-xmlrpc php71u-cli php71u-imap php71u-mcrypt php71u-gd php71u-opcache php71u-json php71u-mysqlnd php71u-odbc pear1u
  Disable Selinux
  Check status
  sestatus
  If not disabled, set SELINUX=disabled in /etc/selinux/config.  Requires reboot for changes to take effect.
  sed -i 's/(^SELINUX=).*/\SELINUX=disabled/' /etc/selinux/config
Disable Firewall
  It is sometimes helpful to disable the firewall during installation.
  systemctl disable firewalld
  systemctl disable iptables
  systemctl stop firewalld
  systemctl stop iptables
  Timezone
FIND YOUR TIMEZONE
  tzselect
SET TIMEZONE EXAMPLE
  timedatectl set-timezone America/Vancouver
CHECK TIMEZONE
  ​timedatectl status
  Install
  Freeswitch
  rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm
  yum -y install freeswitch-config-vanilla freeswitch-sounds freeswitch-lang freeswitch-lua freeswitch-xml-cdr freeswitch-application-curl freeswitch-xml-curl freeswitch-event-json-cdr
  ASTPP
Set ${password} variable.  This is used muliple times in this section.
  password=somepassword
  cd /usr/src
  git clone -b v3.6 https://github.com/iNextrix/ASTPP.git
  systemctl enable mariadb
  systemctl restart mariadb
  mysql -e "CREATE DATABASE astpp CHARACTER SET utf8 COLLATE utf8_general_ci;"

  mysql -e "CREATE USER 'astppuser'@'localhost'>  mysql -e "GRANT ALL PRIVILEGES ON astpp.* TO 'astppuser'@'localhost' WITH GRANT OPTION;"
  mysql -e "FLUSH PRIVILEGES;"
  mysql astpp < ASTPP/database/astpp-3.0.sql
  mysql astpp < ASTPP/database/astpp-upgrade-3.5.sql
  mysql astpp < ASTPP/database/astpp-upgrade-3.6.sql
  ODBC
  cat >> /etc/odbc.ini Ownership
  chown -R freeswitch.daemon /etc/freeswitch /var/lib/freeswitch \
  /var/log/freeswitch /usr/share/freeswitch /var/www/html
  #Directory permissions to 770 (u=rwx,g=rwx,o='')
  find /etc/freeswitch -type d -exec chmod 770 {} \;
  find /var/lib/freeswitch -type d -exec chmod 770 {} \;
  find /var/log/freeswitch -type d -exec chmod 770 {} \;
  find /usr/share/freeswitch -type d -exec chmod 770 {} \;
  find /var/www/html -type d -exec chmod 770 {} \;
  #File permissions to 664 (u=rw,g=rw,o=r)
  find /etc/freeswitch -type f -exec chmod 664 {} \;
  find /var/lib/freeswitch -type f -exec chmod 664 {} \;
  find /var/log/freeswitch -type f -exec chmod 664 {} \;
  find /usr/share/freeswitch -type f -exec chmod 664 {} \;
  find /var/www/html -type f -exec chmod 664 {} \;
  Systemd config
  nano /etc/systemd/system/freeswitch.service
  [Unit]
  Description=FreeSWITCH
  Wants=network-online.target
  After=syslog.target network-online.target
  After=mariadb.service httpd.service
  [Service]
  Type=forking
  User=freeswitch
  ExecStartPre=/usr/bin/mkdir -m 0750 -p /run/freeswitch
  ExecStartPre=/usr/bin/chown freeswitch:daemon /run/freeswitch
  WorkingDirectory=/run/freeswitch
  PIDFile=/run/freeswitch/freeswitch.pid
  EnvironmentFile=-/etc/sysconfig/freeswitch
  ExecStart=/usr/bin/freeswitch -ncwait -nonat $FREESWITCH_PARAMS
  ExecReload=/usr/bin/kill -HUP $MAINPID
  [Install]
  WantedBy=multi-user.target
  Configure php.ini
  sed -i &quot;s#short_open_tag = Off#short_open_tag = On#g&quot; /etc/php.ini
  sed -i &quot;s#;cgi.fix_pathinfo=1#cgi.fix_pathinfo=1#g&quot; /etc/php.ini
  sed -i &quot;s/max_execution_time = 30/max_execution_time = 3000/&quot; /etc/php.ini
  sed -i &quot;s/upload_max_filesize = 2M/upload_max_filesize = 20M/&quot; /etc/php.ini
  sed -i &quot;s/post_max_size = 8M/post_max_size = 20M/&quot; /etc/php.ini
  sed -i &quot;s/memory_limit = 128M/memory_limit = 512M/&quot; /etc/php.ini
  Lock down the database server
  mysql_secure_installation
  systemctl restart mariadb
  Answer Y to everything.
  Configure firewall
  yum -y install firewalld
  systemctl enable firewalld
  systemctl start firewalld
  firewall-cmd --permanent --zone=public --add-service={http,https}
  firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081,8081}/tcp
  firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/udp
  firewall-cmd --permanent --zone=public --add-port=16384-32768/udp
  firewall-cmd --reload
  firewall-cmd --list-all
  Enable services
  systemctl daemon-reload
  systemctl enable mariadb
  systemctl enable httpd
  systemctl enable freeswitch
  systemctl restart httpd
  systemctl restart freeswitch
  systemctl disable sendmail
  systemctl stop sendmail
  systemctl enable postfix
  systemctl restart postfix
  Test Freeswitch console
  If fs_cli command is not working change the following line.
  nano +4 /etc/freeswitch/autoload_configs/event_socket.conf.xml
  
  systemctl restart freeswitch
  Browse to control panel
  http://x.x.x.x:8081
  username: admin
  password: admin
  The 8081 port can be changed at /var/lib/astpp/astpp-config.conf and  /etc/httpd/conf.d/astpp.conf. Remember to change the port on the firewall as well.


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-672840-1-1.html 上篇帖子: CentOS系列更改时区步骤 下篇帖子: CentOS 6与CentOS 7区别
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表