当前位置:网站首页>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
边栏推荐
- ImportError: cannot import name 'ensure_dir_exists'的可解决办法
- Oracle condition, circular statement
- death_ satan/hyperf-validate
- RN7302三相电量检测(基于STM32单片机)
- 【Paper Reading-3D Detection】Fully Convolutional One-Stage 3D Object Detection on LiDAR Range Images
- Yolact++ Pytorch环境
- Yygh-6-wechat login
- FPGA - 7 Series FPGA selectio -07- iserdese2 of advanced logic resources
- 创建格式化时间,格式化时区的gson对象。json解析时间格式化 ZonedDateTime
- High quality domestic stereo codec cjc8988, pin to pin replaces wm8988
猜你喜欢
随机推荐
Using pytorch and tensorflow to calculate the confusion matrix of classification model
4. use MySQL shell to install and deploy Mgr clusters | explain Mgr in simple terms
链表(二)——设计链表
重载,重写的区别,抽象类,接口的区别
How the third-party libraries in cocoapod reference local header files
MySQL(二)——基本操作
4~20mA输入/0~5V输出的I/V转换电路
Apple MDM Bypass 免越狱绕过MDM配置锁 免费
easyui 重置多条件查询
Oracle fundamentals summary
Scripting and programming languages
sql及list去重操作
The custom cube UI pop-up dialog supports multiple and multiple types of input boxes
Oracle condition, circular statement
No one can only use foreach to traverse arrays, right?
浮动与定位
Parsing ng template with let total in NZ Pagination
Select trigger event from easyUI drop-down box
Error reporting - resolve core JS / modules / es error. cause. JS error
Linked list (I) - remove linked list elements








