FreeSwitch录音功能默认是关闭的,需要修改配置开启录音功能。
在FreeSWITCH\conf\sip_profiles\external 目录下建立gw1.xml 内容如下:
<include>
<gateway name="gw1">
<param name="realm" value="47.99.243.202"/>
<param name="username" value="037155674740"/>
<param name="password" value="111111"/>
</gateway>
<gateway name="gw2">
<param name="realm" value="47.99.243.202"/>
<param name="username" value="037160209514"/>
<param name="password" value="111111"/>
</gateway>
</include>
路径 FreeSWITCH\conf\dialplan\default 。创建 call_out.xml
<include>
<extension name="call_out">
<condition field="destination_number" expression="^0(\d+)$">
<!-- 录音规则 -->
<action application="set" data="RECORD_ANSWER_REQ=true"/>
<action application="export" data="nolocal:absolute_codec_string=PCMA,PCMU"/>
<action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}"/>
<action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}"/>
<action application="set" data="RECORD_STEREO=false"/>
<action application="record_session" data="D:/call_center/${strftime(%Y)}/${strftime(%m)}/${strftime(%Y%m%d%H%M%S)}_${call_uuid}.wav"/>
<action application="set" data="media_bug_answer_req=false"/>
<action application="set" data="RECORD_MIN_SEC=3"/>
<!-- 网关 -->
<action application="bridge" data="sofia/gateway/gw1/$1"/>
</condition>
</extension>
</include>
表示拨打 0开头的号码都走外拨网关gw1的路由
加入配置后按F6重新加载配置即可生效。