freeswitch 播放远程文件的流程

freeswitch中既可以播放本地文件,也可以播放远程文件,如

loop_playback(+1 https://xxxxxx/filename.wav)

即文件名以https:// 或者 http:// 开头。

流程图如下:

如何根据文件找对应的open回调函数呢:

用命令:show interfaces

file,wav,mod_sndfile wav的接口在mod_sndfile中。

file,http,mod_httapi http在mod_httapi 中

file,https,mod_httapi https在mod_httapi 中

file,mp3,mod_shout mp3在mod_shout中

总结:播放远程文件时,是先用curl下载到本地一个缓存文件中,再来播放。

如果缓存文件已经存在,就不需要再次下载了。

容易出的问题:

如果这个要下载的文件很大,或者网络不好,那么下载这个文件要很久,就会导致播放失败。

重要的日志:(出错的时候)

cpp 复制代码
loop_playback(+2 https://file/xxxx.wav)
[WARNING] mod_sndfile.c:281 Error Opening File [xxx/storage/http_file_cache/fcache1.wav] [System error : No such file or directory.]
[ERR] mod_httapi.c:3022 Invalid cache file xxx/storage/http_file_cache/fcache1.wav opening url wav Discarding file.

隔了26秒后才打印这个:
[DEBUG] mod_httapi.c:2666 caching: url:https://file/xxxx.wav to xxx/storage/http_file_cache/fcache1.wav (xxx bytes)
相关推荐
ControlRookie11 小时前
第04篇_把 HTTP 放进 PLC:扫描周期、缓冲区、状态机和能力边界
http·codesys·plc通信
記億揺晃着的那天12 小时前
HTTPS 页面内网直连 NAS:解决 Mixed Content 与公网带宽瓶颈
网络协议·http·https·nas
GitLqr1 天前
别再盲目复制了:彻底搞懂 CORS 的本质与那些“神坑”
安全·http·面试
IPdodo_1 天前
Codex 一直显示 Thinking 怎么办?区分任务运行、界面卡住与会话恢复
http·网络调试
Kina_C2 天前
Apache HTTP Server 安装、配置与高级功能详解
linux·http·apache
chexus2 天前
21. 深入 Nginx HTTP 缓存源码:CDN功能
nginx·http·缓存
张小姐的猫2 天前
【Linux】网络编程 —— HTTP协议(上)
linux·运维·服务器·网络·http·单例模式·策略模式
2501_916007472 天前
深入理解HTTPS对称与非对称加密机制及Charles抓包实践
网络协议·http·ios·小程序·https·uni-app·iphone
2501_916008893 天前
HTTPS 抓包遇到证书绑定怎么办,使用 TraceEagle 解除 App 证书校验
网络协议·计算机网络·http·网络安全·ios·adb·https
猫头_3 天前
AI 流式传输工程指南:有了 EventSource 为何还要 Fetch?
javascript·http·llm