FreeSwitch在centOS 7上安装与运行

版权声明: https://blog.csdn.net/smileyan9/article/details/86108695

1. 重要提醒,请参考官网教程。

官网地址: https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7

以下内容主要来自官网,只做了一点点补充。

2.安装

无论是使用虚拟就或者直接使用云服务器只要不是自己电脑就是CentOS7,都最好使用putty这样的工具进行。因为粘贴命令可能方便一些。

yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
yum install -y freeswitch-config-vanilla freeswitch-lang-* freeswitch-sounds-*

大概需要几分钟,即可安装好。
特别注意!暂时不要运行官网推荐安装的第三条语句,因为那样我们不能立即看到效果,如果已经运行了,请再次运行下面语句取消。

systemctl disable freeswitch

3.运行

a.请跳转到freeswitch相关的第一个地方:/var/run/freeswitch/,然后查看是否有文件。

cd /var/run/freeswitch
ls

如果看到已经存在一个pid文件(freeswitch.pid),删除这个文件。即

rm -rf freeswitch.pid

b.运行freeswitch。跳转到/usr/bin,然后运行freeswitch。

cd /usr/bin
freeswitch 

效果如下:

在这里插入图片描述

即表示运行成功,但是仍然有些其他的事情等着去做。

4.常见问题

  • socket error could not listen on :: 8021 即freeswitch 不能监听8021
    关闭服务即可
    systemctl disable freeswitch
    
    关闭后查看8021端口是否被占用
     netstat -tunlp 
    
    即解决了这个端口占用的问题。
  • cannot lock pid file /var/run/freeswitch/freeswitch.pid
    删除这个文件夹中freeswitch.pid文件即可。
    rm -rf /var/run/freeswitch/freeswitch.pid
    
  • 别忘了关闭防火墙
    systemctl stop firewalld.service            #停止firewall
    systemctl disable firewalld.service        #禁止firewall开机启动
    

5.重要补充

如果检测安装后,最好使用官网推荐的方式,让freeswitch在后台运行。
即输入命令:

systemctl enable freeswitch

6.云服务器上运行

本人使用了腾讯云和阿里云的服务器,这次例子是以阿里云服务器为例,同样是centOS7的系统。
跟上面内容一模一样,但是一直连接不上。
原因是安全组的问题,我傻傻地打开了8021端口,还是连接失败。
解决方法
打开所有相关的端口请参考这位大佬的文章:https://www.jianshu.com/p/47d43f1299e0
也可以先打开很多端口:比如2000~10000
测试无误后再做修改。

Smileyan 2019年1月10日0:07

猜你喜欢

转载自blog.csdn.net/smileyan9/article/details/86108695
今日推荐