• 2009年11月04日

    部署传真服务器hylafax - [CTI开发]

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://vontall.blogbus.com/logs/50163578.html

    本文系转贴,原文出自:http://blog.chinaunix.net/u/12199/showart_303843.html

    部署传真服务器hylafax
    Last update:2007.5.26 by Wang Xiantong
    Email:xiantong at gmail.com

    1、概述
    hylafax是一个企业级的传真服务器软件,功能强大。我们这里利用它来代替传真机收发传真。比传真机的优点主要体现在:
    1、收发传真更方便,利用软件收发
    2、节约纸张,无必要不需要打印出来
    3、备份传真更容易,方便文档化工作
    4、成本低廉,一个200块的MODEM接在现有的LINUX服务器上即可(如果没有LINUX服务器,可以找个退休的二手电脑)
    5、提高工作效率
    2、服务器安装
    2.1、硬件环境
    联想旧PC一台,硬盘:10G,CPU:Celeron 700,内存:128M+64M,8139网卡一块,网达COM口MODEM一个。
    2.2、操作系统安装
    最小化安装debian etch,分区如下:
    /boot 100M(ext3)
    swap 256M
    / 4G(ext3)
    /var 5.6G(ext3)
    注意:两行*之间的步骤,是因为我的实际情况(光驱损坏,原有98系统),而采取的安装方法(硬盘引导,网络安装)
    *************************************************************************************
    a.进入98系统,下载wingrub,并安装
    https://sourceforge.net/projects/grub4dos
    b.下载debian 4.0(etch)网络安装文件
    http://ftp2.de.debian.org/debian/dists/etch/main/installer-i386/current/images/netboot/debian-installer/i386/linux
    http://ftp2.de.debian.org/debian/dists/etch/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz
    c.修改wingrub的配置文件
    添加以下内容:
    title install debian etch
    kernel (hd0,0) /linux root=/dev/ram ramdisk_size=12000
    initrd (hd0,0) /initrd.gz
    d.重启系统,选install debian etch安装
    *************************************************************************************
    2.3、配置网络环境
    网卡设定文件是/etc/network/interface,根据情况修改
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
    address 192.168.0.49
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 61.177.7.1
    2.4、安装ssh,hylafax
    >#apt-get install ssh hylafax-server hylafax-client hylafax-doc
    >#faxsetup 设置相关参数
    >#faxaddmodem 添加一个modem
    注意在ModemFlowControl时设定成rtscts
    或完成后在/var/spool/hylafax/etc/config.ttyS1中修改
    ModemFlowControl: rtscts
    编辑/etc/inittab在末属添加
    S1:23:respawn:/usr/local/faxgetty ttyS1
    >#kill -HUP 1
    注意:两行*之前是源代码安装hylafax应注意的问题
    *************************************************************************************
    a.>#apt-get install gcc make libstdc++6-dbg
    b.>#apt-get install gs gsfonts libtiff libtiff-dev
    c.解压编译安装
    d.如果首次运行faxsetup出现ghostscript错误
    >#make /usr/local/lib/ghostscript
    >#cd /usr/local/lib/ghostscript/
    >#ln -s /usr/share/fonts/type1/gsfonts ./fonts
    >#ln -s /usr/share/gs/8.15 ./8.15
    >#ln -s /usr/bin/gs /usr/local/bin/gs
    e.在/etc/ld.so.conf末添加/usr/local/lib,然后运行ldconfig
    f.把末尾/etc/inittabS1:23:respawn:/usr/sbin/faxgetty ttyS1 改成S1:23:respawn:/usr/local/sbin/faxgetty ttyS1
    g.设定/etc/profile中的$PATH变量export PATH=/usr/local/bin:/usr/local/sbin:$PATH
    >#source /etc/profile
    *************************************************************************************
    2.5、验证modem
    >#cu -l ttyS1
      Connected
      at+fclass=?
      0,1,8
      OK
      ~[faxserver].
      Disconnected
    表示modem通讯良好,并且知道MODEM是class 1标准
    >#cu -l ttyS1
    Connected
    at+fclass=1
    OK
    at+ftm=?
    24,48,72,73,74,96,97,98,121,122,145,146
    OK
    检验到modem的工作速度,2400 bps (24), 4800 bps (48), 7200 bps (72,73,74), and 9600 bps (96,97,98)
    2.6、hylafax的基本使用
    >#faxadduser abc #添加abc传真用户,可直接修改/var/spool/hylafax/etc/hosts.hlfaxd
    >#faxserver:/var/spool/hylafax/etc# telnet localhost hylafax
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 faxserver server (HylaFAX (tm) Version 4.3.3) ready.
    user abc
    230 User abc logged in.
    stat
    211-faxserver HylaFAX server status:
    HylaFAX (tm) Version 4.3.3
    Connected to localhost (127.0.0.1)
    Logged in as user wxt (uid 60002)
    "/" is the current directory
    Current job: (default)
    Time values are handled in GMT
    Idle timeout set to 900 seconds
    Using long replies
    No server down time currently scheduled
    HylaFAX scheduler reached at /FIFO (not connected)
    Server FIFO is /client/2557 (open)
    File cache: 15 lookups, 0 hits (0.0%), 1.1 avg probes
    15 entries (1.6 KB), 0 entries displaced, 0 entries flushed
    TYPE: ASCII; STRU: File; MODE: Stream; FORM: PS
    No client data connection
    211 End of status
    quit
    221 Goodbye.
    Connection closed by foreign host.
    >#sendfax -n -d 223344 1.txt #发送传真给223344,n指不发送封面
    >#faxstat -s #正在发送的传真任务
    >#faxstat -r #已经接收到传真
    >#faxstat -d #已经完成的传真任务

    3、客户端
    3.1、安装Frog FaxMail客户端http://www.frogfax.com/uploads/spxdownloads/frogfull.exe
    3.2、可以用adobe acrobat 5.0另存为的方法制作ps或tiff格式的文件用于传真,特别注意避免中文乱码,另存PS文档的时候,在设置中把字体纳入改为全部
    3.3、可以使用gsview查看ps格式的文件,另行下载安装gs,ghostgum
    3.4、利用samba共享收到的传真
    >#apt-get install samba
    >#vi /etc/samba/smb.conf,在[globe]全局域更改或添加以下几条
    workgroup = abc.com
    wins server = 192.168.1.101
    security = domain
    password server = 192.168.1.101
    添加[fax]域
    [fax]
    comment = fax
    path = /var/spool/hylafax/recvq/
    browseable = yes
    public = yes
    >#/etc/init.d/samba restart
    ># net rpc join -S 192.168.1.101 -Uwxt
    Password:
    Joined domain ABC.COM.
    现在在网上邻居//faxserver/fax下就可以看到有没有传真。


    收藏到:Del.icio.us