freeswitch保存录音自定义文件名称

freeswitch保存录音自定义文件名称
通过拨号计划,自定义录音名称,并将录音保存到指定位置

环境

版本:freeswitch1.10.5
位置:/opt/freeswitch

1修改拨号计划

<!--call_out-->
<extension name="call_out">
    <condition field="destination_number" expression="^\d{8}|\d{10}|\d{11}|\d{12}|10009$"/>
    <condition field="caller_id_number" expression="^1\d{10}$">


        <action application="record_session" data="/data/recordings/${call_uuid}_${caller_id_number}_${destination_number}_${strftime(%Y%m%d%H%M%S)}.wav"/>
                          <!--record_session:录音保存位置,${}为获取的变量,分别为uuid、主叫、被叫、时间-->

        <action application="bridge" data="{absolute_codec_string='PCMA'}sofia/mobil/${destination_number}@127.0.0.1:62019"/>

        <action application="hangup"/>
    </condition>
</extension>

2优化

为避免磁盘io占用过高,将录音暂时放置在内存中,内存需要足够大

创建软连接
  ln -s /dev/shm/recordings/ /data/recordings

3重启freeswitch


4测试

呼叫一次,然后在/data/recordings下查看是否有新的录音文件
  #录音文件名称将会按照${call_uuid}_${caller_id_number}_${destination_number}_${strftime(%Y%m%d%H%M%S)}.wav格式命名
posted @ 2022-04-13 11:27  tangshow  阅读(543)  评论(0编辑  收藏  举报