免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 17522 | 回复: 8
打印 上一主题 下一主题

转 用Asterisk实现FAX功能 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-04-11 09:37 |只看该作者 |倒序浏览
15分钟前,刚成功测试了我们的asterisk的传真功能(三星的传真机直接发送传真给asterisk,asterisk将其存为一张tif的图片),基本没有遇到问题,好爽哦!说真的,遇到了问题我还真的不知道怎么去调试!

我相信这是林(花花)给我带来的好运,呵呵!刚给他打完电话,祝贺他终于可以去当飞行员了!狂聊了一通后,发送传真出奇得顺利!

我也不是牛人,基本是建立在前人的基础上做的,方法呢,在这里:
http://voip-info.org/tiki-index. ... sk+spandsp#comments

具体配置呢,在这里:
http://www.soft-switch.org/installing-spandsp.html
Building and installing the library
Make sure libtiff is installed on your machine. Versions 3.5.7, 3.6.0 and 3.7.1 seem to work OK. There have been several bugs related to FAX document handling in some recent versions of libtiff. Also, some people have had trouble using spandsp because they had more than one version of libtiff on their machine. Take care with this. You will also need libxml2 installed. The FAX facility does not use this, but some other parts of spandsp do. If you are using an RPM based system, such as RedHat or Fedora, you will need the libtiff, libtiff-devel, libxml2 and libxml2-devel RPMs installed.
Use the usual:
./configure
make
make install
process to build the spandsp library. Note that if you use configure in this way, the software will be installed in /usr/local. In this case make sure your /etc/ld.so.conf file has an entry for /usr/local/lib. If you wish the software to be installed in /usr, you should build it with the commands.
./configure --prefix=/usr
make
make install
Next, put app_rxfax.c, app_txfax.c and Makefile.patch in your Asterisk apps directory. Use the command:
patch
within the apps directory, to patch your make file so it will build the new application. If the patching process fails, don't be too surprised. The patch file was generated for a specific revision of Asterisk, and things change. It would be difficult to produce a completely generic patch. If you look through the patch, and the Makefile, I think most people should be able to work out what is needed. Now rebuild and install Asterisk (or rebuild and just copy the two new applcation .so files). Now if you put something like:
exten => 1234567,1,rxfax(/home/steveu/testfax.tif)
in your Asterisk extensions.conf file, a call to "1234567" should invoke the fax facility, to receive a fax to the file /home/steveu/testfax.tif. Alternatively:
exten => 1234567,1,txfax(/home/steveu/testfax.tif)
in your Asterisk extensions.conf file will cause a call to "1234567" to invoke the fax facility to send the file /home/steveu/testfax.tif to a calling fax machine. When sending a fax it is more likely you will be calling out to the remote FAX machine. In this case, make your Asterisk call the far FAX machine, and when it answers do:
exten => 1234567,1,txfax(/home/steveu/testfax.tif|caller)
The addition of "|caller" will make txfax act as a calling machine, rather than an answering machine.
Building the programming documentation
If you wish to build the programming documentation for spandsp, configure spandsp with:
./configure --enable-doc
You need doxygen installed on your machine.
Building the test suite
Most sections of the spandsp library have an accompanying test program in the test directory.
./configure --enable-tests
To build these you will need libaudiofile installed on your machine. To build the modem tests, with the GUI monitoring feature you will need Fltk 1.1.4 and the cartesian plotting module. Fltk may be obtained from http://www.fltk.org. The cartesian plotting module may be obtained from http://134.226.68.29/fltk. However, there is no suitable makefile supplied with that. You can find a version at ftp://ftp.spandsp.org/pub/Fl_Cartesian.tgz which will build as a Linux library. The actual code in both these versions is identical. You need to have Fltk 1.1.4 or 1.1.5 installed before building the plotting library.

论坛徽章:
0
2 [报告]
发表于 2007-04-17 20:15 |只看该作者
一般情况下,都是使用这个方式做fax的

论坛徽章:
0
3 [报告]
发表于 2010-05-20 12:10 |只看该作者
现在用1.6+spandsp实现比较好,直接用app_fax组件接收发送传真都没问题,rx和tx线路不好的情况经常出错

我正在写这个教程,回头发出来
搭建自己的VoIP服务器

论坛徽章:
0
4 [报告]
发表于 2010-07-06 15:29 |只看该作者
楼上的,app_fax 研究如何了。我也在看,不过使用后从 asterisk--->pstn,能听到“滴滴”声音。但发送失败。还请共同研究。

另外我使用  digium提供的免费通道是可以 实现的。

论坛徽章:
0
5 [报告]
发表于 2010-07-12 15:10 |只看该作者
我最近也在 看看!

asterisk 1.4 +opendsp ,
TDM400系列  FXO

PSTN => Asterisk   rxfax  ok,

SIP => txfax =>FXO 这个 遇到点问题!


[out-pstn]
exten => _X.,1,Set(FAXFILE=/tmp/fax/1.tif)
exten => _X.,2,txfax(${FAXFILE}|caller)
exten => _X.,3,Hangup()

=======================
Executing [88855888@out-pstn:1] Set("SIP/510-081de5c8", "FAXFILE=/tmp/fax/1.tif") in new stack
    -- Executing [88855888@out-pstn:2] TxFAX("SIP/510-081de5c8", "/tmp/fax/1.tif|caller") in new stack
=======================

论坛徽章:
0
6 [报告]
发表于 2010-07-27 14:38 |只看该作者
最近使用 两个方案均可以:
1、iaxmodem ,Hylafax,avantfax(web)--PSTN--FAXdevice
2、使用asterisk 1.6.2.6 +app_fax +spandsp---pstn--faxdevice
3、补充一个,1.6由diguim提供免费信道也可以。不过不能并发。而且fax参数不好设置。我使用的时候第三方转换的fax文件传输有问题。

方案1:比较通用,只要配置好了,就ok了。但没做过大容量并发测试,但这web部分帮你做了很多事情了。至于后台是用什么方式 (sip trunk,dahdi)转发都可以。
方案2:比较简单。有时候有运气成分。

论坛徽章:
0
7 [报告]
发表于 2010-08-22 08:32 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
8 [报告]
发表于 2010-12-03 14:30 |只看该作者
回复 5# hylinux


    我和你的情况一样

论坛徽章:
0
9 [报告]
发表于 2010-12-03 14:33 |只看该作者
具体怎么配置的啊 我的是asterisk1.4+spandsp
我现在有一台传真机已经可以打通了。我要怎么才能发送传真到这台传真机上呢?
求讲解,QQ:360808987
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP