CentOS安装FreeSWITCH

一、安装步骤

安装方法有多种,可以从Git仓库中安装,可以源码安装,如下我们使用源码安装

#安装依赖
yum install -y autoconf automake libtool gcc-c++ ncurses-devel make zlib-devel libjpeg-devel
yum install -y openssl-devel e2fsprogs-devel curl-devel pcre-devel speex-devel sqlite-devel

#下载主程序包,解压并编译安装
wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.4.0.beta6.tar.bz2
tar xvjf freeswitch-1.4.0.beta6.tar.bz2
cd freeswitch-1.4.0
./configure
make install

#安装声音文件
make sounds-install
make moh-install

#启动文件
cp build/freeswitch.init.redhat /etc/init.d/freeswitch
chmod +x /etc/init.d/freeswitch

#至此FreeSWITCH就已经安装完成,在UNIX类操作系统上,默认的安装位置是/usr/local/freeswitch/,有两个常用
#的命令 freeswitch 和 fs_cli 位于/usr/local/freeswitch/bin/目录下,为了方便使用,建议做一下软链接,如下
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/

#建立软连接后,执行 freeswitch 命令即可启动了,如果你想后台运行执行命令 freeswitc -nc(即no console)
#关闭FreeSWITCH,使用命令 freeswitch -stop 或者通过命令fs_cli命令连接FreeSWITCH后,使用命令 shutdown
#也可关闭,退出fs_cli控制台使用 /exit 或者按 Ctrl + D 组合键

#FreeSWITCH在启动时默认会启用uPnP或NAT-PMP协议,试图查找你的路由器是否支持并在你的路由器上“打洞”,如果你的
#路由器不支持该协议,这一步可能耗时交久,会影响启动速度,所以如果你只是在内网测试,建议关闭此选项,如下
freeswitch -nc -nonat

 

二、报错处理

configure: error: You need to either install libldns-dev or disable mod_enum in modules.conf
#libldns-dev在centos上对应的是ldns-devel,安装这个包得先安装epel-release源
yum install -y epel-release
yum install -y ldns-devel


configure: error: You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support
yum install -y libedit-devel

 

三、FreeSWITCH的启动参数详解

一般来说,FreeSWITCH不需要任何命令参数就可以启动,但在某些情况下,你需要以一些特殊的参数启动

[root@localhost /]# freeswitch -help
Usage: freeswitch [OPTIONS]

These are the optional arguments you can pass to freeswitch:
        -nf                    -- no forking 不允许fork新进程
        -u [user]              -- specify user to switch to 启动后以非root用户 user 身份运行
        -g [group]             -- specify group to switch to 启动后以非root用户 group 身份运行
        -core                  -- dump cores 出错时进行内核转存
        -help                  -- this message
        -version               -- print the version and exit
        -rp                    -- enable high(realtime) priority settings 开启高优先级(实时)设置
        -lp                    -- enable low priority settings 开启低优先级设置
        -np                    -- enable normal priority settings (system defaults) 普通优先级
        -vg                    -- run under valgrind 在valgrind下运行,调试内存泄露时使用
        -nosql                 -- disable internal sql scoreboard 不使用SQL,show channels类的命令
                                  将不能显示结果

        -heavy-timer           -- Heavy Timer, possibly more accurate but at a cost 更精确的时钟
                                  可能会更精确但对系统要求高

        -nonat                 -- disable auto nat detection 如果路由器支持uPnP或NAP-PMP,则FreeSWITCH
                                  可以自动解决NAT穿越问题,如果路由器不支持则该选项可以使启动更快

        -nonatmap              -- disable auto nat port mapping
        -nocal                 -- disable clock calibration 关闭时钟核准,FreeSWITCH理想的运行环境是
                                  1000Hz的内核时钟,如果你的内核时钟小于1000Hz或在虚拟机上,可以使用该选项

        -nort                  -- disable clock clock_realtime 关闭实时时钟
        -stop                  -- stop freeswitch 关闭FreeSWITCH,它会在run目录中查找PID文件
        -nc                    -- do not output to a console and background 启动到后台模式,没有控制台
        -ncwait                -- do not output to a console and background but wait until the
                                  system is ready before exiting (implies -nc) 后台模式,等待系统完全
                                  初始化完毕之后,在退出父进程,隐含“-nc”选项

        -c                     -- output to a console and stay in the foreground 启动到控制台,默认

        Options to control locations of files:
        -base [basedir]         -- alternate prefix directory 指定其他的基准目录,在配置文件中使用$${base}
        -cfgname [filename]     -- alternate filename for FreeSWITCH main configuration file
        -conf [confdir]         -- alternate directory for FreeSWITCH configuration files 指定其他
                                   的配置文件所在目录,需与 -log 和 -db 合用

        -log [logdir]           -- alternate directory for logfiles 指定其它日志目录
        -run [rundir]           -- alternate directory for runtime files 指定其他存放PID文件运行目录
        -db [dbdir]             -- alternate directory for the internal database 指定其他数据库目录
        -mod [moddir]           -- alternate directory for modules 指定其他模块目录
        -htdocs [htdocsdir]     -- alternate directory for htdocs 指定其他HTTP根目录
        -scripts [scriptsdir]   -- alternate directory for scripts 指定其他脚本目录
        -temp [directory]       -- alternate directory for temporary files 指定其他临时文件目录
        -grammar [directory]    -- alternate directory for grammar files 指定其他语法目录
        -recordings [directory] -- alternate directory for recordings 指定其他录音目录
        -storage [directory]    -- alternate directory for voicemail storage 指定其他存储目录
                                  如语音信箱等

        -sounds [directory]     -- alternate directory for sound files 指定其他声音文件目录

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 7上安装FreeSWITCH的步骤如下: 1. 下载FreeSWITCH的源码包。可以使用以下命令从官方仓库下载源码: ``` git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch ``` 2. 进入源码目录并进行配置。使用以下命令进入源码目录并运行配置脚本: ``` cd freeswitch-1.6.10 ./configure --enable-core-pgsql-support ``` 3. 安装FreeSWITCH的运行库和必要的模块。根据需要,您可以使用适当的包管理器安装所需的库和模块。 4. 安装声音文件。您可以使用适当的命令或脚本安装FreeSWITCH所需的声音文件。 请注意,以上步骤假设您已经在CentOS 7上安装了必要的依赖项和运行环境。如果还没有安装CentOS 7,请先参考相关资料进行安装。 <span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [在CentOS 7上部署FreeSWITCH的过程](https://blog.csdn.net/chenshun87/article/details/98648619)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [centos7下安装Freeswitch](https://blog.csdn.net/qq_36695734/article/details/118488952)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值