FreeSwitch开启shout模块
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# 安装依赖包
yum install -y libshout-devel lame-devel libmpg123-devel
# 进入fs源码目录
cd /usr/local/src/freeswitch-1.8.1/
# 去掉 modules.conf 文件中`#formats/mod_shout` 的#号
sed -i 's%#formats/mod_shout%formats/mod_shout%' modules.conf
# 重新配置 编译安装环境
./configure
#安装模块
make mod_shout-install
# 切换到FreeSwitch目录
cd /usr/local/freeswitch
# 可选 修改默认密码为12345
# sed -i 's$<X-PRE-PROCESS cmd="set" data="default_password=1234"/>$<X-PRE-PROCESS cmd="set" data="default_password=12345"/>$' conf/vars.xml
# 设置启动加载 mod_shout
sed -i 's$<!--<load module="mod_shout"/>-->$<load module="mod_shout"/>$' conf/autoload_configs/modules.conf.xml
# 后台启动FreeSwitch
freeswitch -nc
|
安装 icecast
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# icecast不能使用root启动 所以要创建用户
useradd icecast
# 修改用户密码
passwd icecast
# 安装依赖
yum install -y libxml2-devel libxslt-devel
cd /usr/local/src
wget http://downloads.xiph.org/releases/icecast/icecast-2.4.4.tar.gz
# 解压
tar zxf icecast-2.4.4.tar.gz
# 进入目录
cd icecast-2.4.4
# 安装到家目录的icecast
./configure --prefix=/home/icecast/icecast
make
make install
# 修改配置文件 在/home/icecast/icecast/etc目录下,例如:
<logdir>/home/icecast/icecast/log</logdir>
<webroot>/home/icecast/icecast/share/icecast/web</webroot>
<adminroot>/home/icecast/icecast/share/icecast/admin</adminroot>
# 创建日志目录,并保证有权限读写
mkdir -p /home/icecast/icecast/log
# 启动icecast
cd /home/icecast/icecast
./bin/icecast -c etc/icecast.xml
|
使用示例
浏览器访问 服务器的8000端口 http://10.10.10.10:8000/admin/
默认用户名/密码: admin/hackme
在拨号方案中配置
<action application="record" data="shout://source:pass@10.10.10.10:8000/stream.mp3"/>
或者在fs_cli中对正在通话中的channel进行使用(测试使用)
uuid_record channel-uuid start shout://source:pass@10.10.10.10:8000/stream.mp3
默认的pass为: hackme
参考资料
FreeSwitch mod_shout文档
参考博客
Icecast官方网站