# 數據庫修改為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