0
点赞
收藏
分享

微信扫一扫

5-FreeSwitch-freeswitch开启录音和使用

小黑Neo 2022-10-31 阅读 156


文章目录

  • ​​一、开启/usr/local/freeswitch/conf/dialplan 后面的default添加配置​​
  • ​​二、在freeswitch重新加载(F6)或者 reloadxml​​
  • ​​三、使用录音​​
  • ​​3.1单腿录音​​
  • ​​方法一:API​​
  • ​​方法二:拨号计划​​
  • ​​3.2两条腿录音API​​
  • ​​3.2.1 方法一:API​​
  • ​​3.2.2 方法二:拨号计划(241)​​
  • ​​3.2.3 两条混为一条声道 -c 1​​
  • ​​四、立体声​​
  • ​​4.1.1 方法一:API​​
  • ​​4.1.2 方法二:拨号计划(设置通道变量)​​
  • ​​五、录音相关变量(242)​​

一、开启/usr/local/freeswitch/conf/dialplan 后面的default添加配置

freeswitch开启录音(FreeSwitch录音功能默认是关闭的,需要修改配置开启录音功能。)

5-FreeSwitch-freeswitch开启录音和使用_freeswitch

<extension name="Local_Extension">
<condition field="destination_number" expression="^(10[01][0-9])$">
<!-- 添加-->

5-FreeSwitch-freeswitch开启录音和使用_xml_02

<action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}"/>
<action application="set" data="RECORD_COPYRIGHT=(c) 2011"/>
<action application="set" data="RECORD_SOFTWARE=FreeSWITCH"/>
<action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
<action application="set" data="RECORD_COMMENT=FreeSWITCH"/>
<action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}"/>
<action application="set" data="RECORD_STEREO=true"/>
<action application="record_session" data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>

二、在freeswitch重新加载(F6)或者 reloadxml

5-FreeSwitch-freeswitch开启录音和使用_freeswitch_03

三、使用录音

3.1单腿录音

方法一:API

originate user/1000 &record (位置/名称.wav)

方法二:拨号计划

<action application="record" data="位置/名称.wav">

3.2两条腿录音API

3.2.1 方法一:API

开始
uuid_record <channel_uuid> start 位置/名称.wav
停止
uuid_record <channel_uuid> stop 位置/名称.wav

停止所有
stop all

3.2.2 方法二:拨号计划(241)

<action application="record_session" data="位置/名称.wav">

3.2.3 两条混为一条声道 -c 1

sox 位置/名称.wav -c 1 位置/名称2.wav

四、立体声

4.1.1 方法一:API

uuid_setvar <channel_uuid>  RECORD_STEREO true

4.1.2 方法二:拨号计划(设置通道变量)

<action application="set" data="RECORD_STEREO=true">
<action application="record_session" data="位置/名称.wav">

五、录音相关变量(242)


举报

相关推荐

0 条评论