1.安装Postfix
yum install postfix
2.安装hylafax依赖包
yum install ghostscript sharutils mgetty libtiff libtiff-devel
ln -s /share/fonts/default/ghostscript/ /usr/share/ghostscript/fonts
3.安装iaxmodem
rpm -ivh spandsp-0.0.6-0.1.pre12.el5.i386.rpm
rpm -ivh spandsp-devel-0.0.6-0.1.pre12.el5.i386.rpm
rpm -ivh --nodeps iaxmodem-1.2.0-1.1.i386.rpm
4.新建iax2用户
在asterisk中新建IAX2用户1000密码1000将端口改为4570,如下:
[1000]
type=friend
accountcode=1000
secret=1000
context=dahdi
host=dynamic
port=4569
transfer=no
callgroup=
pickupgroup=
requirecalltoken=auto
qualify=yes
5. 创建iaxmodem:ttyIAX0的配置文件:
mkdir /var/log/iaxmodem
vi /etc/iaxmodem/iaxmodem-cfg.ttyIAX0 内容如下
device /dev/ttyIAX0
owner uucp:uucp
mode 660
port 4570
refresh 60
server 127.0.0.1
peername 1000
secret 1000
codec alaw
6.安装hylafax:
rpm –ivh hylafax-4.3.9-0rhel5.i386.rpm
7.设置hylafax:
可用faxsetup初始设置hylafax(参考:http://blog.csdn.net/seven407/archive/2011/05/17/6427066.aspx)
或faxaddmodem在/var/spool/hylafax/etc/下新建配置文件config.ttyIAX0,如下:
CountryCode: 086
AreaCode: 0311
FAXNumber: 1000
LongDistancePrefix: 0
InternationalPrefix: 0311
DialStringRules: etc/dialrules
ServerTracing: 0xFFF
SessionTracing: 0xFFF
RecvFileMode: 0777
LogFileMode: 0777
DeviceMode: 0777
RingsBeforeAnswer: 2
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: Tykj.Net
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxRecvPages: 25
# Modem-related stuff: should reflect modem command interface
# and hardware connection/cabling (e.g. flow control).
#
ModemType: Class1 # use this to supply a hint
#
# The modem is taken off-hook during initialization, and then
# placed back on-hook when done to prevent glare.
#
#ModemResetCmds: "ATH1\nAT+VCID=1" # enables CallID display
#ModemReadyCmds: ATH0
#ModemDialCmd: ATX3DP%s
Class1AdaptRecvCmd: AT+FAR=1
Class1TMConnectDelay: 400 # counteract quick CONNECT response
Class1RMQueryCmd: "!24,48,72,96" # V.17 fast-train recv doesn't work well
CallIDPattern: "NMBR="
CallIDPattern: "NAME="
CallIDPattern: "ANID="
CallIDPattern: "NDID="
# Uncomment these if you really want them, but you probably don't.
#CallIDPattern: "DATE="
#CallIDPattern: "TIME="
############################################################
iaxmodem iaxmodem-cfg.ttyIAX0
配置完成后运行faxsetup
8.在/etc/inittab末尾添加:
IAX0:23:respawn:/usr/sbin/iaxmodem iaxmodem-cfg.ttyIAX0
t0:23:respawn:/usr/sbin/faxgetty ttyIAX0
IAX1:23:respawn:/usr/sbin/iaxmodem iaxmodem-cfg.ttyIAX1
t1:23:respawn:/usr/sbin/faxgetty ttyIAX1
9.重启 reboot
10.在/dev/里有ttyIAX0、ttyIAX1说明iaxmodem加载成功
在asterisk终端中:
iax2 show peers
Name/Username Host Mask Port Status
1000 127.0.0.1 (D) 255.255.255.255 4570 OK (3 ms)
说明iaxmodem注册成功
注册其他用户拨打1000或2000会听到传真的滴滴声。
11. 测试HylaFAX服务器运行情况包括测试"接收传真、发送传真"
使用传真测试时,需要知道外线的号码如249---89290800,243---85283515
需要设置拨入规则,即绑定分机号和外线号码
1.使用命令行来送传真sendfax
可以直接使用的档有文本文件(不支持中文),如果要有中文必需使用相关软件将其转换才成ps文件、pdf文件、tiff文件、 tif文件可以正常传真:
# sendfax -n -d 85905318 files.tif #发送传真给85905318,n指不发送封面
txt转pdf: cat test.txt | a2ps -o - | ps2pdf - myfilename.pdf
2.显示当前等待发送的文件:
# faxstat -s
3.从发送队列中删除传真任务: faxrm JobID
# faxrm 2
4.查询传真机的状态 :
# faxstat
5.查询/var/spool/hylafax/recvq 收到的传真
# faxstat -r
6.查询/var/spool/hylafax/doneq 完成的传真
# faxstat -d
7.查询正在发送的传真
# faxstat -s
8.清除缓冲池
# faxqclean
9.显示统计结果
# faxcron
10.打开收到传真文件(HylaFAX服务器收到的传真文件通常存放在/var/spool/hylafax/recvq目录中):
出现 No Local Dialtone 错误请检查1000的是否能正常呼出。