freeswitch默認錄音是wav的玉转,但是wav占用體積較大,我們可以直接錄成mp3格式減少體積:
1. yum install -y libshout-devel lame-devel libmpg123-devel
2. 在freeswitch源碼目錄編輯 modules.conf , 去掉??formats/mod_shout 前面的#號元践,保存。
3. 在源碼根目錄芥被,執(zhí)行./configure.? ?在/src/mod/formats/mod_shout目錄下 執(zhí)行 make && make install, 執(zhí)行完后葫笼,會在freeswitch\mod目錄中產(chǎn)生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'? 罕模,即可產(chǎn)生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