Freeswitch(三):常用配置
# 数据库修改为postgresql
安装完odbc以及pgsql的驱动之后,在数据库相关配置文件修改dsn配置:
全局配置表
<X-PRE-PROCESS cmd="set" data="odbc_dsn=pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=postgres password=123456"/>
<param name="odbc-dsn" value="$${odbc_dsn}"/>
需要修改的配置文件:
switch.conf.xml //核心表
cdr_pg_csv.conf.xml //通话记录
db.conf.xml //核心表
voicemail.conf.xml //留言相关的表
internal.xml // 内部呼叫配置表
fifo.conf.xml //fifo相关的表
callcenter.conf.xml //callcenter程序相关的表。
# 录音:
1.在/usr/local/freeswitch/conf/dialplan/default.xml文件里,<extension name="Local_Extension">节下面添加如下内容,可在FreeSwitch内部分机之间拨打录音。
<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) 2020"/>
<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="set" data="enable_file_write_buffering=false"/>
<action application="set" data="media_bug_answer_req=true"/>
<action application="record_session" data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
其中,
media_bug_answer_req:设置为true接通后录音
enable_file_write_buffering:FreeSWITCH默认的录音参数配置是开启缓冲的(可能是内核缓存),即RTP流大小到达65536字节写一次文件,想更接近实时流,关闭缓冲区设置为false即可。
呼叫中心的录音可以在callcenter.conf.xml里面设置,也可以在default设置。
# 录音文件路径写入数据库:
1..dialpanl/default.xml中添加一行,定义录音文件路径
<action application="set" data="recording_file=$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
2.再在autoload_configs/cdr_pg_csv.conf.xml的字段定义中添加一行
<field var="recording_file"/>
3.最后在数据库表中添加一个字段
recording_file