相關套件

HylaFAX Prerequisets :

      libtiff – get it at http://www.remotesensing.org/libtiff/
                  LZW compression is not required. BSD needs at least version 3.5.6 to compile. Do not use an unpatched version 3.6.1.
      Ghostscript – get it at http://www.cs.wisc.edu/~ghost/
                  SGI IRIX users may use Impressario or DPS.
      zlib – usually available with libtiff or Ghostscript
                  awk, gawk, mawk, or nawk – get mawk at ftp://ftp.whidbey.net/pub/brennan/
                  Many distributions come with one of these already.
      sendmail or compatible SMTP – get it at http://www.sendmail.org/
                  Many distributions come with one.
      metamail, uuencode, or base64-encode
                  For optional use in fax-to-mail gateways.

      mgetty-voice

      ghostscript-fonts

 

[1.] 安裝套件
      yum
install ghostscript-fonts zlib Ghostscript libtiff

      cd /usr/share/ghostscript && ln -s /usr/share/fonts ./

 

      下載 tarball

         wget ftp://ftp.hylafax.org/source/hylafax-4.2.3.tar.gz

 

      編譯 ( RPM安裝參考下方的RPM安裝)

         tar zxvf hylafax-4.2.3.tar.gz

         cd hylafax-4.2.3

         ./configure

         make

         make install

 

[2.] 檢查 modem

         cu -l ttyS0

 

[3.] 設定fax,執行,/usr/local/sbin/faxsetup

      它會自動去跑/usr/local/sbin/faxaddmodem,接著跟著提示設定

      系統會自動判斷Modem的速度及Class,大部分依預設值即可,
      也可到/var/spool/hylafax/config下找各廠牌的Modem設定試試
      完成設定後的檔案為 /var/spool/hylafax/etc/hylafax.ttyS0

Update /var/spool/hylafax/status/any.info.

HylaFAX configuration parameters are:

[1] Init script starts faxq: yes
[2] Init script starts hfaxd yes
[3] Start old protocol: no
[4] Start paging protocol: no
Are these ok [yes]? yes

Modem support functions written to /var/spool/hylafax/etc/setup.modem.
Configuration parameters written to /var/spool/hylafax/etc/setup.cache.

No scheduler config file exists, creating one from scratch.
Country code [1]? 886
Area code []? 2
Long distance dialing prefix [1]? 0
International dialing prefix [011]? 002
Dial string rules file (relative to /var/spool/hylafax) ["etc/dialrules"]?
Tracing during normal server operation [1]?
Default tracing during send and receive sessions [0xffffffff]?
Continuation cover page (relative to /var/spool/hylafax) []?
Timeout when converting PostScript documents (secs) [180]?
Maximum number of concurrent jobs to a destination [1]?
Define a group of modems []?
Time of day restrictions for outbound jobs ["Any"]?
Pathname of destination controls file (relative to /var/spool/hylafax) []?
Timeout before purging a stale UUCP lock file (secs) [30]?
Max number of pages to permit in an outbound job [0xffffffff]?
Syslog facility name for ServerTracing messages [daemon]?

The non-default scheduler parameters are:

CountryCode: 886
AreaCode: 2
LongDistancePrefix: 0
InternationalPrefix: 002

Are these ok [yes]?

Creating new configuration file /var/spool/hylafax/etc/config…

Restarting HylaFAX server processes.
Should I restart the HylaFAX server processes [yes]?

/etc/rc.d/init.d/hylafax start
Starting HylaFAX queue manager (faxq): [ u8763u7b8fuffffuffff ]
Starting HylaFAX server (hfaxd): [ u8763u7b8fuffffuffff ]

You do not appear to have any modems configured for use. Modems are
configured for use with HylaFAX with the faxaddmodem(8C) command.
Do you want to run faxaddmodem to configure a modem [yes]?
Serial port that modem is connected to []? ttyS0

Ok, time to setup a configuration file for the modem. The manual
page config(5F) may be useful during this process. Also be aware
that at any time you can safely interrupt this procedure.

Reading scheduler config file /var/spool/hylafax/etc/config.

No existing configuration, let's do this from scratch.

Country code [1]? 886
Area code [415]? 2
Phone number of fax modem [+1.999.555.1212]? 26756733
Local identification string (for TSI/CIG) ["NothingSetup"]? ssorc
Long distance dialing prefix [1]? 0
International dialing prefix [011]? 002
Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]?
Tracing during normal server operation [1]?
Tracing during send and receive sessions [11]?
Protection mode for received facsimile [0600]? 0644
Protection mode for session logs [0600]? 0644
Protection mode for ttyS0 [0600]? 0644
Rings to wait before answering [1]?
Modem speaker volume [off]?
Command line arguments to getty program ["-h %l dx_%s"]?
Pathname of TSI access control list file (relative to /var/spool/hylafax) [""]?
Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [""]?
Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]?
Tag line format string ["From %%l|%c|Page %%P of %%T"]?
Time before purging a stale UUCP lock file (secs) [30]?
Hold UUCP lockfile during inbound data calls [Yes]?
Hold UUCP lockfile during inbound voice calls [Yes]?
Percent good lines to accept during copy quality checking [95]?
Max consecutive bad lines to accept during copy quality checking [5]?
Max number of pages to accept in a received facsimile [25]?
Syslog facility name for ServerTracing messages [daemon]?
Set UID to 0 to manipulate CLOCAL [""]?
Use available priority job scheduling mechanism [""]?

Your facsimile phone number (26756733) does not agree with your
country code (886) or area code (2). The number
should be a fully qualified international dialing number of the form:

+886 2 <local phone number>

Spaces, hyphens, and periods can be included for legibility. For example,

+886.2.555.1212

is a possible phone number (using your country and area codes).

The non-default server configuration parameters are:

CountryCode: 886
AreaCode: 2
FAXNumber: 26756733
LongDistancePrefix: 0
InternationalPrefix: 002
DialStringRules: etc/dialrules
SessionTracing: 11
RecvFileMode: 0644
LogFileMode: 0644
DeviceMode: 0644
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: ssorc
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxRecvPages: 25

Are these ok [yes]? yes

Now we are going to probe the tty port to figure out the type
of modem that is attached. This takes a few seconds, so be patient.
Note that if you do not have the modem cabled to the port, or the
modem is turned off, this may hang (just go and cable up the modem
or turn it on, or whatever).

Probing for best speed to talk to modem: 38400 OK.

About fax classes:

The difference between fax classes has to do with how HylaFAX interacts
with the modem and the fax protocol features that are used when sending
or receiving faxes. One class isn't inherently better than another;
however, one probably will suit a user's needs better than others.

Class 1 relies on HylaFAX to perform the bulk of the fax protocol.
Class 2 relies on the modem to perform the bulk of the fax protocol.
Class 2.0 is similar to Class 2 but may include more features.
Class 1.0 is similar to Class 1 but may add V.34-fax capability.
Class 2.1 is similar to Class 2.0 but adds V.34-fax capability.

HylaFAX generally will have more features when using Class 1/1.0 than
when using most modems' Class 2 or Class 2.0 implementations. Generally
any problems encountered in Class 1/1.0 can be resolved by modifications
to HylaFAX, but usually any problems encountered in Class 2/2.0/2.1 will
require the modem manufacturer to resolve it.

If you're unsure and your modem supports it, use Class 1.

This modem looks to have support for Class 1, 2 and 2.0.
How should it be configured [1]? 1

Hmm, this looks like a Class 1 modem.
Product code (ATI0) is "Venus K56FLEX V.90 kfav173 Serial s090799V".
Other information (ATI3) is "Venus K56FLEX V.90 kfav173 Serial s090799V".
DTE-DCE flow control scheme [default]?
Modem manufacturer is "Unknown".
Modem model is "Unknown".

Using prototype configuration file class1…

There is no prototype configuration file for your modem, so we will
have to fill in the appropriate parameters by hand. You will need the
manual for how to program your modem to do this task. In case you are
uncertain of the meaning of a configuration parameter you should
consult the config(5F) manual page for an explanation.

Note that modem commands must be specified exactly as they are to be
sent to the modem. Note also that quote marks (") will not be displayed
and will automatically be deleted. You can use this facility to supply
null parameters as "".

Finally, beware that the set of parameters is long. If you prefer to
use your favorite editor instead of this script you should fill things
in here as best you can and then edit the configuration file

"/var/spool/hylafax/etc/config.ttyS0"

after completing this procedure.

Command to enter Class 1 [AT+FCLASS=1]?
Command to stop and wait prior to sending PPM [AT+FTS=7]?
Command to stop and wait prior to sending TCF [AT+FTS=7]?
Command to stop and wait prior to sending EOP [AT+FTS=9]?
Extra bytes in a received HDLC frame [4]?
Maximum time to wait for OK after aborting a receive (ms) [200]?
Maximum wait for initial identification frame (ms) [40000]?
Delay after completing training (ms) [200]?
Command to ensure silence after receiving HDLC and before sending [AT+FRS=7]?
Delay after failed training (ms) [1500]?

The modem configuration parameters are:

Class1Cmd: AT+FCLASS=1
Class1PPMWaitCmd: AT+FTS=7
Class1TCFWaitCmd: AT+FTS=7
Class1EOPWaitCmd: AT+FTS=9
Class1FrameOverhead: 4
Class1RecvAbortOK: 200
Class1RecvIdentTimer: 40000
Class1SendMsgDelay: 200
Class1SwitchingCmd: AT+FRS=7
Class1TCFMaxNonZero: 10
Class1TCFMinRun: 1000
Class1TrainingRecovery: 1500

Are these ok [yes]? yes

Creating new configuration file /var/spool/hylafax/etc/config.ttyS0…
Creating fifo /var/spool/hylafax/FIFO.ttyS0 for faxgetty… done.
Done setting up the modem configuration.

Checking /var/spool/hylafax/etc/config for consistency…
…some parameters are different.

The non-default scheduler parameters are:

CountryCode: 886
AreaCode: 2
LongDistancePrefix: 0
InternationalPrefix: 002
DialStringRules: etc/dialrules

Are these ok [yes]? yes

Creating new configuration file /var/spool/hylafax/etc/config…
…saving current file as /var/spool/hylafax/etc/config.sav.

Don't forget to run faxmodem(8C) (if you have a send-only environment)
or configure init to run faxgetty on ttyS0.
Do you want to run faxaddmodem to configure another modem [yes]? no

You do not appear to be using faxgetty to notify the HylaFAX scheduler
about new modems and/or their status. This means that you must use the
faxmodem program to inform the new faxq process about the modems you
want to have scheduled by HylaFAX. Beware that if you have modems that
require non-default capabilities specified to faxmodem then you should
read faxmodem(8C) manual page and do this work yourself (since this
script is not intelligent enough to automatically figure out the modem
capabilities and supply the appropriate arguments).

Should I run faxmodem for each configured modem [yes]? yes
/usr/sbin/faxmodem ttyS0

Done verifying system setup.

faxsetup – configure a server
faxaddmodem – configure modems

[4.] hylafax的 收 / 送 傳真是分開設定

      設定接收傳真

         faxgetty  /dev/ttyS0

 

      開機時啟動

         vi /etc/inittab

S0:2345:respawn:/usr/local/sbin/faxgetty /dev/ttyS0

      設定傳送傳真

         faxmodem /dev/ttyS0

 

[5.] 設定給client端遠端存取

         /usr/local/sbin/hfaxd -i 4559 -o 4557 -s 444

                                       (port number)

                                                     (old protocol port number)

                                                                   (SNPP port number)

 

[6.] 設定當接收到傳真時,並將傳真以pdf型式email給cross

         vi /var/spool/hylafax/etc/FaxDispatch

SENDTO=cross;
# 或者
#SENDTO=cross@ssorc.tw;
# 或者
#SENDTO=cross@ssorc.tw,cross2@ssorc.tw;

FILETYPE=pdf;

# 沒裝metamail需要加一行,不過預設就已有了
MIMENCODE=bin/uuencode_it;

 

[7.] 檢查程序,ps axu | grep fax

uucp 2568 0.0 0.1 7356 1936 ? Ss Dec13 0:00 /usr/local/sbin/faxq
uucp 2570 0.0 0.1 4232 1552 ? Ss Dec13 0:00 /usr/local/sbin/hfaxd -i hylafax
uucp 2643 0.0 0.2 4624 2160 ? Ss Dec13 0:00 /usr/local/sbin/faxgetty /dev/ttyS0

[8.] 排程報告引用: 

0 * * * * /usr/local/sbin/faxqclean
0 0 * * * /usr/local/sbin/faxcron | mail -s "HylaFAX Usage Report" faxmaster

hylafax的檔案結構
    bin 這裡存放一些程式,如收傳真,及不同格式的轉換程式等
            faxrcvd  收到傳真所要做的動作(收到傳真內定會送給FAXMaster一封信內使用超連結(ftp)來取回傳真檔我們可以修改其收到傳真的方式,如將傳真以附件檔寄給你,或是送到印表機等
            notify,notify.awk    收送傳真的通知動作
            pdf2fax  將pdf檔轉為可傳真的格式tiff class F
            ps2fax 將ps檔轉為可傳真的格式tiff class F
            tiff2fax  將tiff傳為可傳真的格式tiff class F
    config    數據機的樣本設定檔
    etc    所有真正的設定檔
            config.*  你的連接埠的設定,config.連接埠的名稱,如config.ttyS0
            hosts.hfaxd  client存取傳真伺服器的設定檔
            lastrun  傳真伺服器最後收送的時間
            setup.modem    測試數據機的程式
            lutRS18.pcf  tag line的字型檔
            xferfaxlog    收送傳真的記錄檔
    pollq,docq,doneq,sendq,recvq    所有的queue
    log    記錄了每一筆的收送的交談內容
    info    記錄了每一台曾經收送的傳真機(有call id)的一些參數,以加速傳真不用再查詢一次
    status    傳真機的狀態檔
            any.info  你的hylafax的版本資料
            ttyS0    依你連接埠的名稱而有不同,內容為傳真伺服器的狀態
 

新增使用者 (/var/spool/hylafax/etc/hosts.hfaxd)
        faxadduser -p 123456 cross

        faxadduser cross

 

刪除使用者

        faxdeluser cross

 

查詢傳真機的狀態
        faxstat         查詢/var/spool/hylafax/status/ttyS0內容
        faxstat -r     查詢/var/spool/hylafax/recvq 收到的傳真
        faxstat -s     查詢/var/spool/hylafax/sendq 等待傳送的傳真
        faxstat -d    查詢/var/spool/hylafax/doneq 完成的傳真

 

查詢傳真的報表(本月以內)

它是依據/var/spool/hylafax/etc/xferfaxlog檔案來分析
        xferfaxstats

 

送傳真(snedfax),有中文必需使用bg5ps將其轉換ps檔,pdf檔,tiff檔
        sendfax -n [-d 傳真號碼] 檔案名稱                   (-n 不使用封面檔)
        sendfax -n -d 1234567 -d 2345678 mytestfile     (可指定多個傳真號碼)
        sendfax -n -d 1234567 -a 時間 mytestfile           (可以使用-a 排程)

 

移除尚未傳送的傳真(faxrm) ,傳真工作交付hylafax會傳回一個工作id ,根據工作id來刪除它

        faxrm  [ id ]

 

[Q:] 傳真上方TagLine變亂碼

[A:] vi /var/spool/hylafax/etc/config.ttyS0

#TagLineForm     "From %%l|%c|Page %%P of %%T"
TagLineForm       "From %%l|%F – %T %Z|Page %%P of %%T

將純文字檔轉換成 ps格式

        cat xxx.txt | bg5ps > xxx.ps

      或者

        bg5ps -s 12 -if xxx.txt -of xxx.ps

                (-s , 字體大小)

 

ref: http://phorum.study-area.net/viewtopic.php?t=18494&highlight=modem&sid=8d7951f01c8dfd003785842eee51db86

http://csc.ocean-pioneer.com/docum/csc_hylafax.html

http://www.hoyo.idv.tw/software/OpenSource/software/fax_server/fax_index.htm

http://csc.ocean-pioneer.com/docum/hylafax_client.html

http://fanqiang.chinaunix.net/a1/b1/20020111/08100047_b.html

  

RPM套件安裝

[1.] 下載,wget ftp://ftp.hylafax.org/binary/linux/redhat/RPMS/i386/hylafax-4.3.0-2rhel4.i386.rpm

 

[2.] 安裝

    yum install sharutils

    rpm -ivh hylafax-4.3.0-2rhel4.i386.rpm

 

[3.] 設定,/usr/sbin/faxsetup

 

[4.] 啟動,service hylafax start

 

    /usr/sbin/faxgetty -D /dev/ttyS0

 

[5.] 開機啟動設定

    chkconfig hylafax on

    echo "" >> /etc/rc.local

    echo "# hylafax" >> /etc/rc.local

    echo "/usr/sbin/faxgetty -D /dev/ttyS0" >> /etc/rc.local

Related posts 相關文章

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。