测试 FreeSWITCH 的 mod_loopback

bgapi originate loopback/answer,park/default/inline park inline

show channels as xml

show calls as xml

有 2 个 channels

有 2 个 calls

比较有意思

在 loopback-a 是播放 wav

在 loopback-b 上可以录音

这就是回环

有什么用呢?

除了做测试,还有 niao 用

对了,官方文档是这样描述 loopback 的呼叫字符串的

loopback/<exten\>[/context[/dialplan]]

某个大神写个一篇文章,很好

《使用FreeSWITCH检测声音文件中的DTMF信息》


按照大神的提示,如下:

-- dtmf.lua

function onInputCBF(s, type, obj, arg)

if (type == "dtmf") then

freeswitch.consoleLog("INFO", "Got DTMF: " .. obj.digit .. " Duration: " .. obj.duration .. "\n")

end

return ''

end

session:answer()

session:execute("start_dtmf", "")

session:setInputCallback('onInputCBF', '')

session:streamFile("local_stream://moh")

<!--dialplan-->

<extension name="dtmf">

<condition field="destination_number" expression="dtmf">

<action application="answer" data=""/>

<action application="playback" data="tone_stream://v=-2;1234567890"/>

<action application="sleep" data="3000"/>

</condition>

</extension>

originate loopback/dtmf &lua(dtmf.lua)

一条腿播放带内DTMF,另外一条腿识别带内DTMF

发现效果不太好,有丢码

改了下 dtmf.lua, 如下:

function onInputCBF(s, type, obj, arg)

if (type == "dtmf") then

freeswitch.consoleLog("INFO", "Got DTMF: " .. obj.digit .. " Duration: " .. obj.duration .. "\n")

end

return ''

end

session:answer()

session:execute("spandsp_start_dtmf", "")

session:setInputCallback('onInputCBF', '')

session:streamFile("local_stream://moh")

这样就没问题了,不丢一个,不多一个

有兴趣的可以试试,如果结果不一样,一定要告诉我

相关推荐
liulilittle20 小时前
HTTP/3.0:网络通信的技术革新与性能飞跃
网络·网络协议·http·https·quic·流媒体·通信
liulilittle2 天前
IP校验和算法:从网络协议到SIMD深度优化
网络·c++·网络协议·tcp/ip·算法·ip·通信
liulilittle2 天前
OPENPPP2 —— IP标准校验和算法深度剖析:从原理到SSE2优化实现
网络·c++·网络协议·tcp/ip·算法·ip·通信
我爱C编程1 个月前
基于FPGA的8PSK+卷积编码Viterbi译码通信系统,包含帧同步,信道,误码统计,可设置SNR
fpga开发·通信·8psk·帧同步·snr·卷积编码·维特比译码
小徐不徐说1 个月前
RTSP协议详解与C++实现实例
开发语言·c++·qt·通信·rtsp
asdfg12589632 个月前
路由器SDH POS接口
网络·计算机网络·智能路由器·通信·网络运维
小徐不徐说2 个月前
QT技巧之快速搭建串口收发平台
开发语言·c++·qt·串口·软件构建·个人开发·通信
shinelord明2 个月前
【计算机网络架构】环型架构简介
计算机网络·架构·计算机科学·通信·计算机技术
liulilittle2 个月前
SNIProxy 轻量级匿名CDN代理架构与实现
开发语言·网络·c++·网关·架构·cdn·通信
liulilittle2 个月前
深度剖析:OPENPPP2 libtcpip 实现原理与架构设计
开发语言·网络·c++·tcp/ip·智能路由器·tcp·通信