FreeSwitch SIP(1):linux下编译安装v1.4
本文,原文连接: http://blog.csdn.net/freewebsys/article/details/46546205 ,转载请注明出处!
1,关于FreeSwitch
FreeSWITCH 是一个电话的软交换解决方案,包括一个软电话和软交换机用以提供语音和聊天的产品驱动。FreeSWITCH 可以用作交换机引擎、PBX、多媒体网关以及多媒体服务器等。
FreeSWITCH 支持多种通讯技术标准,包括 SIP, H.323, IAX2 以及 GoogleTalk ,可以方便的与其他开源的PBX系统进行对接,例如 sipX, OpenPBX, Bayonne, YATE 或者 Asterisk.
FreeSWITCH 支持许多高级的 SIP 特性,例如 presence/BLF/SLA 、TCP TLS 和 sRTP,它还可以用来作为类似于 SBC (Session Border Controller) 的透明代理。
参考:http://www.oschina.net/p/freeswitch
2,安装
代码迁移过,不在github了。操作系统式centos6,(centos7 操作系统也类似)
https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse
centos6 安装
https://freeswitch.org/confluence/display/FREESWITCH/CentOS+6
首先安装依赖:
yum install git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre-devel speex-devel ldns-devel libedit-devel
这里遇到一个问题,不能直接下载master代码,编译不过去,依赖一个libyuv库。使用1.4版本进行编译。
git clone -b v1.4 https://freeswitch.org/stash/scm/fs/freeswitch.git
# The -j argument spawns multiple threads to speed the build process
./bootstrap.sh -j
./configure -C
make && make install
make sounds-install
make moh-install
安装成功:
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/freeswitch/mod
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR‘
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH‘ environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH‘ environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR‘ linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf‘
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[5]: Leaving directory `/data/freeswitch/src/mod/xml_int/mod_xml_scgi‘
make[4]: Leaving directory `/data/freeswitch/src/mod/xml_int/mod_xml_scgi‘
make[3]: Leaving directory `/data/freeswitch/src/mod‘
make[3]: Entering directory `/data/freeswitch/src‘
make[4]: Entering directory `/data/freeswitch/src‘
make[4]: Nothing to be done for `install-exec-am‘.
make[4]: Nothing to be done for `install-data-am‘.
make[4]: Leaving directory `/data/freeswitch/src‘
make[3]: Leaving directory `/data/freeswitch/src‘
make[2]: Leaving directory `/data/freeswitch/src‘
Making install in build
make[2]: Entering directory `/data/freeswitch/build‘
+---------- FreeSWITCH install Complete ----------+
+ FreeSWITCH has been successfully installed. +
+ +
+ Install sounds: +
+ (uhd-sounds includes hd-sounds, sounds) +
+ (hd-sounds includes sounds) +
+ ------------------------------------ +
+ make cd-sounds-install +
+ make cd-moh-install +
+ +
+ make uhd-sounds-install +
+ make uhd-moh-install +
+ +
+ make hd-sounds-install +
+ make hd-moh-install +
+ +
+ make sounds-install +
+ make moh-install +
+ +
+ Install non english sounds: +
+ replace XX with language +
+ (ru : Russian) +
+ (fr : French) +
+ ------------------------------------ +
+ make cd-sounds-XX-install +
+ make uhd-sounds-XX-install +
+ make hd-sounds-XX-install +
+ make sounds-XX-install +
+ +
+ Upgrade to latest: +
+ ---------------------------------- +
+ make current +
+ +
+ Rebuild all: +
+ ---------------------------------- +
+ make sure +
+ +
+ Install/Re-install default config: +
+ ---------------------------------- +
+ make samples +
+ +
+ +
+ Additional resources: +
+ ---------------------------------- +
+ https://www.freeswitch.org +
+ https://freeswitch.org/confluence +
+ https://freeswitch.org/jira +
+ http://lists.freeswitch.org +
+ +
+ irc.freenode.net / #freeswitch +
+ +
+ Register For ClueCon: +
+ ---------------------------------- +
+ https://www.cluecon.com +
+ +
+-------------------------------------------------+
.=======================================================================================================.
| ____ _ ____ |
| / ___| |_ _ ___ / ___|___ _ __ |
| | | | | | | |/ _ \ | / _ \| ‘_ \ |
| | |___| | |_| | __/ |__| (_) | | | | |
| \____|_|\__,_|\___|\____\___/|_| |_| |
| |
| _____ _ _ ____ __ |
| |_ _|__| | ___ _ __ | |__ ___ _ __ _ _ / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ |
| | |/ _ \ |/ _ \ ‘_ \| ‘_ \ / _ \| ‘_ \| | | | | | / _ \| ‘_ \| |_ / _ \ ‘__/ _ \ ‘_ \ / __/ _ \ |
| | | __/ | __/ |_) | | | | (_) | | | | |_| | | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ |
| |_|\___|_|\___| .__/|_| |_|\___/|_| |_|\__, | \____\___/|_| |_|_| \___|_| \___|_| |_|\___\___| |
| |_| |___/ |
| _____ _ _ |
| | ____|_ _____ _ __ _ _ / \ _ _ __ _ _ _ ___| |_ |
| | _| \ \ / / _ \ ‘__| | | | / _ \| | | |/ _` | | | / __| __| |
| | |___ \ V / __/ | | |_| | / ___ \ |_| | (_| | |_| \__ \ |_ |
| |_____| \_/ \___|_| \__, | /_/ \_\__,_|\__, |\__,_|___/\__| |
| |___/ |___/ |
| ____ _ ____ |
| __ ____ ____ __ / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ |
| \ \ /\ / /\ \ /\ / /\ \ /\ / / | | | | | | |/ _ \ | / _ \| ‘_ \ / __/ _ \| ‘_ ` _ \ |
| \ V V / \ V V / \ V V / _ | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | |
| \_/\_/ \_/\_/ \_/\_/ (_) \____|_|\__,_|\___|\____\___/|_| |_| (_) \___\___/|_| |_| |_| |
| |
.=======================================================================================================.
Checking module integrity in target [/usr/local/freeswitch/mod]
make[2]: Leaving directory `/data/freeswitch/build‘
make[1]: Leaving directory `/data/freeswitch‘
3,增加系统服务,启动服务
增加系统服务,并启动
#拷贝centos6 服务文件
cp build/freeswitch.init.redhat /etc/init.d/freeswitch
chmod 750 /etc/init.d/freeswitch
chkconfig --add freeswitch
chkconfig --levels 35 freeswitch on
#增加用户
useradd --system --home-dir /usr/local/freeswitch -G daemon freeswitch
#设置权限
chown -R freeswitch:daemon /usr/local/freeswitch/
chmod -R 770 /usr/local/freeswitch/
chmod -R 750 /usr/local/freeswitch/bin/*
#创建run目录
mkdir /var/run/freeswitch
chown -R freeswitch:daemon v1.4
#配置二进制文件
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/
#启动服务
service freeswitch start
4,安装客户端
客户端使用x-lite。下载地址:
http://www.counterpath.com/x-lite-download/
启动后配置下服务器,freeswitch默认注册了20个账号,从1000-1019,默认密码都是1234。
配置信息,假设服务器地址是 192.168.1.100。
同样在另外一个电脑注册1001,然后就可以进行拨号了。
5,总结
本文,原文连接: http://blog.csdn.net/freewebsys/article/details/46546205 ,转载请注明出处!
freeSwitch还是非常好用的,只需要编译下,配置服务就行。
开源的需要研究透彻,主要的代码是用c写的,支持lua扩展,freeswitch支持很多功能还需要仔细研究。
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。