freeswitch默认录音是wav的,但是wav占用体积较大,我们可以直接录成mp3格式减少体积:
1. yum install -y libshout-devel lame-devel libmpg123-devel
2. 在freeswitch源码目录编辑 modules.conf , 去掉 formats/mod_shout 前面的#号,保存。
3. 在源码根目录,执行./configure. 在/src/mod/formats/mod_shout目录下 执行 make && make install, 执行完后,会在freeswitch\mod目录中产生mod_shout.so文件。
4. 编辑 /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml ,<load module="mod_shout"/> 注释去掉,然后重启freeswitch
5. 在呼叫时增加 execute_on_answer='record_session /data/1.mp3' ,即可产生mp3录音。比如:
bgapi originate {ignore_early_media=false}[leg_direction=A]user/1000 &bridge({execute_on_answer='record_session /data/1.mp3'}[leg_direction=B]user/1001) &echo