搭建一个小型的asterisk电话系统 (五、增加efax功能)

一、安装依赖包(libtiff & spandsp)

$ sudo apt-get install libtiff4 libtiff4-dev

$ mkdir ~/src/asterisk-complete/thirdparty
$ cd ~/src/asterisk-complete/thirdparty
$ wget http://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

$ sudo make install


二、把spandsp库放入libpath

$ sudo cat >> /etc/ld.so.conf.d/usrlocallib.conf
/usr/local/lib


通过$ sudo ldconfig使其生效


三、重新编译Asterisk添加spandsp支持

$ cd ~/src/asterisk-complete/asterisk/1.8/
$ ./configure
$ make menuselect

确保Resource Modules菜单下的res_fax_spandsp看起来像[*] res_fax_spandsp,保存并退出


$ make
$ make install


四、检查

重新启动asterisk,通过以下命令确认spandsp是否已经工作

*CLI> module show like res_fax_spandsp.so 

Module                         Description                              Use Count
res_fax_spandsp.so             Spandsp G.711 and T.38 FAX Technologies  0
1 modules loaded

如果看到如上结果,则表示spandsp可以工作了,也就是说SendFax() & ReceiveFax()可用在extensions拨号方案中了


五、配置拨号方案

收传真,

[fax-in]

exten => fax,1,Verbose(3,Incoming fax)
; folder where your incoming faxes will initially be stored
same => n,Set(FAXDEST=/var/spool/asterisk/fax)
same => n,Set(tempfax=${CALLEDFAX}/${UNIQUEID})
same => n,ReceiveFax(${FAXDEST}/${tempfax}.tif)
same => n,Verbose(3,- Fax receipt completed with status: ${FAXSTATUS})


发传真

[fax-out]

exten => s,1,Verbose(2,Set options and transmit fax)
; some folder where your outgoing faxes will be found
same => n,Set(faxlocation=/tmp)
; In production you would probably not want to hardcode the filename
same => n,Set(faxfile=faxfile.tif)
same => n,Set(FAXOPT(headerinfo)=Fax from xxxx.org)
same => n,Set(FAXOPT(localstationid=xxxxxx)
same => n,SendFax(${faxlocation}/${faxfile})






  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值