Created by upper, last modified by wiki_admin on 2021 一月 18
测试时间:2021.01.13
环境介绍:
服务器A
IP地址:172.16.80.26
linux版本:CentOS Linux release 7.6.1810 (AltArch)
软件版本:Asterisk 15.7.3 DAHDI Version: 3.0.0(openvox版本)spandsp-0.0.6
板卡:A400(全FXS模块)
服务器B
IP地址:172.16.80.133
linux版本:CentOS Linux release 7.9.2009 (Core)
软件版本:Asterisk 15.7.3 DAHDI Version: 3.0.0(openvox版本)spandsp-0.0.6
板卡:A400(3FXO模块+1FXS模块)
连接拓扑图:
服务器A和B安装软件Asterisk 及其dahdi驱动的步骤略过;
服务器A配置文件:
/etc/asterisk/dahdi-channels.conf
; Span 1: WCTDM/4 "Wildcard TDM400P REV E/F Board 5" (MASTER)
;;; line="1 WCTDM/4/0"
signalling=fxo_ls
callerid="Channel 1" <4001>
mailbox=4001
group=5
context=from-modem /此处conext用作从笔记本A发送过来的传真呼叫均走此extensions.conf中拨号规则
channel => 1
callerid=
mailbox=
group=
context=default
;;; line="2 WCTDM/4/1"
signalling=fxo_ls
callerid="Channel 2" <4002>
mailbox=4002
group=5
context=from-133 /此处conext用作从服务器B送过来的传真呼叫均走此extensions.conf中拨号规则
channel => 2
callerid=
mailbox=
group=
context=default
;;; line="3 WCTDM/4/2"
signalling=fxo_ls
callerid="Channel 3" <4003>
mailbox=4003
group=5
context=from-internal
channel => 3
callerid=
mailbox=
group=
context=default
;;; line="4 WCTDM/4/3"
signalling=fxo_ls
callerid="Channel 4" <4004>
mailbox=4004
group=5
context=from-internal
channel => 4
callerid=
mailbox=
group=
context=default
/etc/asterisk/chan_dahdi.conf
faxdetect=both /打开此参数,默认是关闭的;
/etc/asterisk/extensions.conf
[from-modem]
exten => _X.,1,Dial(DAHDI/2/${EXTEN})
exten => _X.,n,Hangup()
[from-133]
exten => _X.,1,Answer()
exten => _X.,n,Set(FAXOPT(gateway)=yes)
exten => _X.,n,Wait(3)
exten => _X.,n,Dial(DAHDI/1)
exten => _X.,n,Hangup()
额外内容:若服务器A没有Acer的modem连接线用于收发传真,可以按如下设置将来自服务器B的传真保存于服务器A上:
[from-133]
exten => _X,1,Answer()
exten => _X,n,Set(FAXOPT(gateway)=no)
exten => _X,n,Wait(6)
exten => _X,n,Set(tiff_file=/etc/asterisk/fax/inbox/${CALLERID(number)}-FaxIN-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.tif)
exten => _X,n,ReceiveFAX(${tiff_file},F)
exten => _X,n,Hangup()
服务器B配置文件:
/etc/asterisk/dahdi-channels.conf
; Span 1: WCTDM/4 "Wildcard TDM400P REV E/F Board 5" (MASTER)
;;; line="1 WCTDM/4/0"
signalling=fxs_ls
callerid=asreceived
group=0
context=from-26
channel => 1
callerid=
group=
context=default
;;; line="2 WCTDM/4/1"
signalling=fxs_ls
callerid=asreceived
group=0
context=from-pstn
channel => 2
callerid=
group=
context=default
;;; line="3 WCTDM/4/2"
signalling=fxs_ls
callerid=asreceived
group=0
context=from-pstn
channel => 3
callerid=
group=
context=default
;;; line="4 WCTDM/4/3"
signalling=fxo_ls
callerid="Channel 4" <4004>
mailbox=4004
group=5
context=from-modem
channel => 4
callerid=
mailbox=
group=
context=default
/etc/asterisk/chan_dahdi.conf
faxdetect=both /打开此参数,默认是关闭的;
/etc/asterisk/extensions.conf
[from-modem]
exten => _X.,1,Dial(DAHDI/1/${EXTEN})
exten => _X.,n,Hangup()
[from-26]
exten => s,1,Answer()
exten => s,n,Set(FAXOPT(gateway)=no)
exten => s,n,Wait(6)
exten => s,n,Dial(DAHDI/4)
exten => s,n,Hangup()
完成上述配置后,即可按如下流程测试:
1.笔记本A上的Windows自带的传真和扫描工具发送传真通过modem相连的端口1的FXS走from-modem的拨号规则将传真呼叫送到了端口2的FXS上,通过RJ11的双绞线将传真呼叫送到了服务器B上,服务器B上的端口1的FXO收到后走拨号规则from-26将传真呼叫送到了端口4的FXS所接的笔记本B上的传真扫描工具上;开始接收传真;
2.笔记本B上的Windows自带的传真和扫描工具发送传真通过modem相连的端口4的FXS走from-modem的拨号规则将传真呼叫送到了端口1的FXO上,通过RJ11的双绞线将传真呼叫送到了服务器A上,服务器A上的端口2的FXS收到后走拨号规则from-133将传真呼叫送到了端口1的FXS所接的笔记本A上的传真扫描工具上;开始接收传真;
附1
插上Acer Modem,系统会自动安装驱动。下图表示驱动安装成功;
windows传真与扫描,传真设置里选择传真设备为LSI USB 2.0 Soft Modem即可。
附2
下载安装spandsp的链接 https://www.soft-switch.org/downloads/spandsp/spandsp-0.0.6pre21.tgz
安装步骤:
wget https://www.soft-switch.org/downloads/spandsp/spandsp-0.0.6pre21.tgz
tar -zxvf spandsp-0.0.6pre21.tgz
cd spandsp-0.0.6/
./configure
make && make install
附3
安装Asterisk的时候要确保res_fax_spandsp.so选中;
附4
asterisk安装完成后要检查确保spandsp是否正常加载,正常加载下:
若出现module load res_fax_spandsp.so failed的错误,可命令行执行:
ln /usr/local/lib/libspandsp.so.2.0.0 /lib/libspandsp.so.2
在尝试重新加载;
附5
测试收发件箱如图: