freeswitch使用mod_rtmp通过WebRTC进行音/视频通话以及mod_rtmp模块配置使用
如下你会用到<profile>
,你可以使用default
About
mod_rtmp是 FreeSWITCH 的RTMP(实时媒体协议)端点。Flash主要使用RTMP协议通过Internet传输音频,视频和数据。
Click here to expand Table of Contents
安装
FreeSWITCH
最新的git
已经包含了mod_rtmp
源代码。在编译之前,编辑modules.conf
。取消注释endpoints/ mod_rtmp
并保存文件。像平常一样运行FreeSWITCH
编译。
配置
RTMP配置文件,rtmp.conf.xml
请参阅 RTMP配置文件。
API
1、状态
要查看端点状态:
freeswitch> rtmp status
要查看配置文件的状态:
freeswitch> rtmp status profile <profile>
要查看个人资料上的会话:
freeswitch> rtmp status profile <profile> sessions
要查看个人资料上的注册:
freeswitch> rtmp status profile <profile> reg
# rtmp status profile default reg
Profiles
要开始,停止或重新启动配置文件:
freeswitch> rtmp profile <profile> start
freeswitch> rtmp profile <profile> stop
freeswitch> rtmp profile <profile> restart
重新扫描配置文件的配置:
freeswitch> rtmp profile <profile> rescan
Sessions
杀死session:
freeswitch> rtmp session <session> kill
要登录或注销会话:
freeswitch> rtmp session <session> login
freeswitch> rtmp session <session> logout
联系
To get a dialstring to call a registered user (optionally with nickname):
rtmp_contact profile/user@domain[/[!]nickname]
This can be used to bridge a call to the user:
<action application="bridge" data="${rtmp_contact($${rtmp_profile}/${dialed_ext}@$${domain})}"/>
Latency
如果您在通过Flash接收流式音频时遇到延迟,请首先检查延迟是否通过Flash与浏览器和音频系统的交互而产生。例如,在某些使用PulseAudio的Linux发行版中,您可能会发现在桌面终端窗口中执行以下命令对于减少当前会话的延迟有很大的影响::
export PULSE_LATENCY_MSEC=20
/usr/bin/firefox "$@"
Flex Client
There is also a sample flex client that works with mod_rtmp. The source is currently located right under the /usr/src/freeswitch/clients/flex. You need to copy those files and put it under a web server directory. Modify the freeswitch.html file and modify the following section:
var flashvars = {
rtmp_url: 'rtmp://my.ip.address.here/phone'
};
replace my.ip.address.here to your freeswitch server IP running the mod_rtmp module. Now open your browser and load the freeswitch.html page to see the client in action.
RTMP配置文件
1、简介
mod_rtmp允许你监听多个配置文件。每个配置文件绑定到一个唯一的IP:端口组合(类似于 Sofia 配置文件)。每个配置文件可以配置不同的设置。
这允许您监听多个地址/端口上的呼叫,或者根据他们连接的配置文件为不同的用户提供不同的连接设置。
2、基本设置
绑定地址
<param name="bind-address" value="0.0.0.0:1935" />
这将设置地址和端口绑定并监听连接。它可以绑定到0.0.0.0(即所有地址)。
上下文
<param name="context" value="public" />
这设置拨号计划上下文来处理呼叫。
拨号方案
<param name="dialplan" value="XML" />
这设置拨号计划提供商使用,通常是XML。
AUTH-电话
<param name="auth-calls" value="true" />
这控制是否允许未经身份验证的呼叫。如果设置为true,则只能进行已认证的呼叫。
缓冲-LEN
<param name="buffer-len" value="50" />miliseconds
这将控制将媒体缓冲到客户端的时间,以毫秒为单位。
CHUNKSIZE
<param name="chunksize" value="512" />
这将设置出站RTMP块的最大大小。
用户评论
更多相关好文
-
微信公众号文章/菜单添加小程序时路径如何获取? 2021-12-22
-
如何轻松获取微信小程序路径path? 2021-12-22
-
cannot import name 'CUDA_HOME' from 'mmcv.utils' 2021-12-05
-
vgg的loss一轮达到ln(1/n)阈值,如何解决 2021-11-21
-
如何下载使用utils库 2021-10-27
热门文章
-
微信公众号文章/菜单添加小程序时路径如何获取? 2021-12-22
-
如何轻松获取微信小程序路径path? 2021-12-22
-
python/MySQL分页查询方法与性能优化 2021-06-23
-
mitmproxy & python 忽略所有的https/ssl请求 2021-04-19
-
如何使用邮件/邮箱推广微信公众号/小程序? 2021-01-28
栏目最新文章
公告提示
- pytorch中文文档
- pytorch官方文档
提交评论