centos7.2安装freeswitch步骤
配置
第⼀部分:修改: /etc/l
1. 修改default_password
  <X-PRE-PROCESS cmd="set" data="default_password=密码"/>
2. 新增G729编码
  <X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8,G729"/>
  <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8,G729"/> 3. 修改 domain=公⽹IP
  <X-PRE-PROCESS cmd="set" data="domain=IP地址"/>
4. 修改 external_sip_ip=公⽹IP
  <X-PRE-PROCESS cmd="stun-set" data="external_rtp_ip=地址"/>
5. 修改 external_rtp_ip=公⽹IP
  <X-PRE-PROCESS cmd="stun-set" data="external_sip_ip=IP地址"/>
第⼆部分:修改⽇志级别
6.修改 /etc/l
  <X-PRE-PROCESS cmd="set" data="console_loglevel=warning"/>
centos vim命令7.修改 /etc/freeswitch/autoload_l
  <param name="loglevel" value="warning"/>
第三部分:配置sip账号
8.修改 /etc/freeswitch/l 更改拨号计划
<extension name="Local_Extension">
  <condition field="destination_number" expression="^([1-9][0-9]{3})$">
   <!-- 下⾯这⾏必须-->
    <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
  </condition>
</extension>
<extension name="Local_Extension_Skinny">
  <condition field="destination_number" expression="^([1-9][0-9]{3})$">
  </condition>
</extension>
9.创建脚本⽂件 /etc/freeswitch/directory/default/dialplan.sh
#!/bin/sh
for a in `seq 迭代次数`
do
i=`expr 初始值 + $a`
sed -e "s/1000/$i/" /etc/freeswitch/directory/l > $i.xml;
done
chmod a+x dialplan.sh
10:执⾏脚本创建sip账号
sh dialplan.sh
13 esl配置修改/etc/freeswitch/f
<configuration name="f" description="Socket Client">
  <settings>
    <param name="nat-map" value="false"/>
    <param name="listen-ip" value="内⽹IP"/>
    <param name="listen-port" value="8021"/>
    <param name="password" value="ClueCon"/>
    <param name="apply-inbound-acl" value="lan"/>
    <!--<param name="stop-on-bind-error" value="true"/>-->
  </settings>
</configuration>
14 配置防⽕墙
  firewall-cmd --zone=public --add-port=22/tcp --permanent
  firewall-cmd --zone=public --add-port=5060/udp --permanent
  firewall-cmd --zone=public --add-port=16384-65535/udp --permanent
  firewall-cmd --reload
  firewall-cmd --zone=public --list-ports
15.配置fail2ban
  vim /etc/fail2ban/jail.d/freeswitch.local
  [freeswitch]
  enabled = true
  # Ignore failures from our local internal network
  ignoreip = 127.0.0.0/8
  maxretry = 4 ; for a total of five failures
  findtime = 3600 ; based on empirical testing
  bantime = 1200 ; ban for 20m (which lets us pick up repeat offenders)
  # We do not use 5061 and it is not open to the outside world, so act on 5060 only
  port = 5060
  # we do not want mail, so remove that action from f freeswitch config
  action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
      %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
  # Add intrusion log, which contains special string for host (see freeswitch.local filter)
  logpath = /var/log/freeswitch/freeswitch.log
      /var/log/freeswitch/cdr-csv/intrusion.csv
16.启动freeswitch
  systemctl start freeswitch
  systemctl status freeswitch
17.启动fail2ban
  systemctl start fail2ban
  systemctl status fail2ban
  fail2ban-client status freeswitch
端⼝说明
参考

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。