当前位置:网站首页>Freeswitch uses Mod_ Shot module plays mp3
Freeswitch uses Mod_ Shot module plays mp3
2022-06-28 06:23:00 【Be realistic】
summary
freeswitch In the face of VOIP Voice call , Can pass playback Command play IVR Voice files .
By default ,freeswitch Support wav file , You can also play directly VOIP Common codec in G711 file 、G729 Documents, etc. , But yes. mp3 Is not supported .
By inquiring freeswitch Official documents of , Find out mod_shout The module can support MP3 File playback .
mod_shout Modules are not installed by default , You can decide whether to compile and install according to your needs .
Environmental Science
centos:CentOS release 7.0 (Final) Or above
freeswitch:v1.6.19
GCC:4.8.5
rely on
mod_shout Module installation requires third-party library support ,centos Of yum Please refer to the document for the source setting method “freeswitch Bring their own yum Source configuration mode ”.
sudo yum install libshout-devel lame-devel libmpg123-devel
install
go back to freeswitch Source root , To regenerate the makefile.
./bootstrap.sh -j
./configure
Compilation and installation mod_shout modular
cd src/mod/formats/mod_shout/
make
sudo make install
ll /usr/local/freeswitch/mod/mod_shout*
-rwxr-xr-x. 1 root root 1322 May 19 11:43 /usr/local/freeswitch/mod/mod_shout.la
-rwxr-xr-x. 1 root root 168560 May 19 11:43 /usr/local/freeswitch/mod/mod_shout.so
To configure
mod_shout After the module is installed , modify fs Configuration of .
Upload MP3 Playback file .
ll /usr/local/freeswitch/sounds/101-baidu-mp3.mp3
-rw-r--r--. 1 root root 12096 May 17 17:55 /usr/local/freeswitch/sounds/101-baidu-mp3.mp3
modify /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml file .
<load module="mod_shout"/>
modify /usr/local/freeswitch/conf/dialplan/test.xml file .
<include>
<context name="default">
<extension name="test" continue="false">
<condition field="destination_number" expression="^(\d+)$">
<action application="answer"/>
<action application="playback" data="/usr/local/freeswitch/sounds/101-baidu-mp3.mp3"/>
<action application="hangup" data="CALL_REJECTED"/>
</condition>
</extension>
</context>
</include>
After configuration , start-up freeswitch, And confirm mod_shout The module starts normally .
[email protected]> module_exists mod_shout
true
test
Use eyebeam register 1001 Account to fs, And initiate a call to 1002,1001 You can hear fs Of IVR Playback .
When we don't load mod_shout Module time , The log is as follows .
EXECUTE sofia/internal/[email protected] playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
2022-05-19 13:49:55.573314 [ERR] switch_core_file.c:272 Invalid file format [mp3] for [/usr/local/freeswitch/sounds/101-baidu-mp3.mp3]!
EXECUTE sofia/internal/[email protected] hangup(CALL_REJECTED)
Reload mod_shout modular , And initiate a call , Check the log below .
EXECUTE sofia/internal/[email protected] playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
2022-05-19 11:57:20.393239 [DEBUG] switch_ivr_play_say.c:1498 Codec Activated [email protected] 1 channels 20ms
2022-05-19 11:57:20.473273 [DEBUG] switch_rtp.c:7273 Correct audio ip/port confirmed.
2022-05-19 11:57:20.613239 [DEBUG] sofia.c:7084 Channel sofia/internal/[email protected] entering state [ready][200]
2022-05-19 11:57:26.433297 [DEBUG] switch_ivr_play_say.c:1942 done playing file /usr/local/freeswitch/sounds/101-baidu-mp3.mp3
EXECUTE sofia/internal/[email protected] hangup(CALL_REJECTED)
summary
MP3 The file is a compressed format , More than usual wav(pcm) Small 8 About times , It has great advantages in space occupation and transmission bandwidth .
We should have more different tools , Choose the most appropriate solution in different application scenarios .
Empty as usual
Be serious
边栏推荐
- Xcode13.3.1 项目执行pod install后报错
- Small ball playing
- Sharing tips for efficient scripting
- Difficulty calculation of Ethereum classic
- Teach you how to use UCOS
- Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance
- Mosaic data enhanced mosaic
- Idea automatically adds comments when creating classes
- sql及list去重操作
- 三极管驱动无刷电机
猜你喜欢
Unity packaging webgl uses IIS to solve the error
D3D11_ Chili_ Tutorial (3): design a bindable/drawable system
socke.io长连接实现推送、版本控制、实时活跃用户量统计
The custom cube UI pop-up dialog supports multiple and multiple types of input boxes
JSP
freeswitch使用mod_shout模块播放mp3
Install and manage multiple versions of PHP under mac
MySQL(一)——安装
ROS rviz_ Satellite function package visualizes GNSS track and uses satellite map
Promotion intégrale et ordre des octets de fin de taille
随机推荐
API learning of OpenGL (2006) glclientactivetexture
Difficulty calculation of Ethereum classic
What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?
AutoCAD C polyline self intersection detection
How to add live chat in your Shopify store?
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException:异常解决
图片按日期批量导入WPS表格
JQ picture amplifier
windows上安装redis并永久修改密码,及ssm框架集成redis
Differences between basic types and packaging classes
Yolact++ pytoch environment
ThreadLocal
Sklearn Feature Engineering (summary)
JSP
RN7302三相电量检测(基于STM32单片机)
Configure redis from 0
异常处理(一)——空指针和数组索引越界
AutoCAD C# 多段线自相交检测
Small ball playing
MR-WordCount