efax

Autres langues

Langue: ko

Version: 100132 (fedora - 25/11/07)

Section: 1 (Commandes utilisateur)

이름

efax - 클래스 1 또는 2 모뎀을 사용하여 팩스를 주고 받는다

개요

efax [ 옵션 ] [ -t 번호 [ 화일... ] ]

옵션

옵션의 의미는 다음과 같다:

-a 명령
전화를 받을 때 AT명령을 사용한다. 기본값은 "A"이다.
-c caps
지역 모뎀 기능(capabilities)을 설정한다. caps의 형식과 의미에 대해서는 기능 섹션을 보라. 기본값은 1,3,0,2,0,0,0,0.
-d dev
dev 장치에 연결된 팩스 모뎀을 사용한다. 기본값은 /dev/fax이다.
-f fnt
헤더 생성시 fnt 폰트 화일을 사용한다. 기본값은 내장 8x16 폰트이다. 폰트 화일 형식에 대해서는 efix(1)을 보라.
-g cmd
CONNECT (또는 DATA) 신호가 감지되고 자료가 수신되면 /bin/sh 쉘을 불러 cmd 명령으로 exec(2)한다. cmdprintf(3) 형식으로서 최근의 CONNECT 메세지에서 표시된 보드율로 교체되는 %d 이스케이프 시퀀스 6 개까지 허용한다. cmd는 대부분 getty(8)를 exec한다.
-h 헤더
각 페이지 상단에 `헤더' 문자열을 넣는다. `헤더'의 첫번째 %d는 페이지 번호로 치환되고 두번째 %d가 있을 경우 전송되고 있는 화일 갯수로 치환된다.
-i 문자열
-j 문자열
-k 문자열
모뎀을 초기화하기 위하여 AT문자열 명령을 보낸다. -i 명령은 모뎀이 팩스 모드에 진입하기 전에 보내지며, -j 명령은 모댐이 팩스 모드로 진입하고 나서 실행되고, -k 명령은 efax가 종료할 때 보내진다. 기본행위는 -k 옵션이 주어지지 않았을 때, 종료 전에 끊기 신호(ATH) 명령을 보내는 것이다.
-l id
id에 지역적 구별 문자열을 설정한다. id는 국제적인 형태로 표현하는 지역 전화 번호여야 한다. ( 예를 들어 "+1 800 555 1212" ) 이 값은 원격 팩스 머신에 전달된다. 일부 팩스 머신은 숫자, 공백, '+'를 제외한 다른 문자를 받지 않기도 한다. 이 값은 또한 폴링 ID로도 사용된다.
-o opt
비표준 팩스 모뎀을 조절하기 위하여 opt을 사용한다. 자세한 사항은 모뎀 요구사항 섹션을 보라. opt은 다음과 같다:

    1
클래스 1 팩스 모뎀 명령을 사용한다. 모뎀이 이를 지원해야 한다. 기본값은 클래스 2 명령이다.

    0
클래스 2.0 팩스 모뎀 명령을 사용한다.

    a
use software adaptive answer method. If the first attempt to 소프트웨어적 적응 답신 방법을 사용한다. 만약 전화수신에 대한 첫 응답이 15 초 이내에 자료 모드로 접속되지 않으면 전화를 잠시 끊고 다시 팩스 모드로 답신한다. ( 아래 "팩스와 자료 요청 둘 다 응답하기"를 보라 )

    e 
모뎀 초기화 명령의 에러를 무시하라.

    f
"가상 흐름 제어"를 사용한다. efax는 모뎀 전송 버퍼에 남아있는 바이트 수를 추정하여 버퍼가 넘치지 않도록 잠시 기다린다. 모뎀 버퍼는 최소한 96 바이트를 보관할 수 있다고 가정한다. 이 기능은 각 스캔라인에 대하여 채움 바이트를 추가하는 클래스 2 모뎀과 제대로 작동하지 않는다. 흐름 제어 설정에 문제가 있을 때만 사용하라.

    l
다른 프로그램이 작업을 마치길 기다리는 동안 잠금 화일을 확인하는 시간을 반으로 줄인다. 기본값은 8 초이다. 예를 들어 -olll은 시간간격을 1초로 줄인다.

    n
페이지 재전송 요구를 무시한다. 받은 팩스의 화질에 크게 신경쓰지 않거나 팩스 머신 자체가 아주 세밀한 기계라면 이 옵션을 사용하라. 그렇지 않은 경우 각 페이지는 3 번까지 재전송될 수 있다.

    r
클래스 2 모뎀으로 자료를 전송받을 때 비트 순서를 바꾸지 않는다. 이 옵션의 의미는 이번 버전과 정반대가 되었다. 이 옵션을 사용해야 하는 클래스 2 모뎀은 얼마 없다.

    x
자료 수신 시작시 DC2 대신 XON (DC1)을 보낸다. 클래스 2 에만 해당.

    z
모뎀이 초기화되거나 재설정될 때마다 100 밀리초를 더 지연한다. 초기 지연값은 100 밀리초이다. 예를 들어 -ozzz는 400 밀리초를 지연한다. 명령을 빠르게 전달되면 잘 인식하지 못하는 모뎀에 사용한다.
-q 횟수
각 페이지에 대하여 횟수 이상의 수신 에러 발생시 재전송을 요구한다. 기본값은 10 이다.
-r pat
수신된 각 페이지를 별도의 화일로 저장한다. 화일명은 pat를 이용하여 strftime(3) 형식의 문자열로 지어진다. 페이지 번호는 .001, .002, ... 등이 화일명에 붙어 표시된다. 만약 pat가 공백 문자열("")이거나 -r 옵션이 사용되지 않을 때는 "%m%d%H%M%S" 문자열이 사용된다.
-s
모뎀 초기화 후 잠금 화일을 제거한다. 이렇게 하면 efax가 수신을 기다리는 도중에 밖으로 전화를 걸 수 있다. 만약 모뎀의 작동이 감지되면 다시 장치를 잠근다. 모뎀이 다른 프로그램에 의해 잠겨 있다면 efax는 종료하면서 1을 반환한다. (``busy''를 의미) 보통 새로운 efax 프로세스가 init(8)에 의해 시작된다. 새로운 efax 프로세스는 보통 주기적으로 잠금 화일이 사라질 때까지 점검한다. 그리고 나서 모뎀을 재초기화한다.
-t 전화번호 [화일...]
전화번호로 전화를 걸고 화일... 팩스 이미지를 전송한다. 이 옵션을 사용하려면 꼭 마지막에 적어주어야 한다. 전화번호는 예를 들어 톤 다이얼링을 위한 T 접두사 또는 지연 시간을 위한 콤마 문자 등 모뎀이 지원하는 문자를 포함할 수 있다. 만약 화일명이 주어지지 않으면 원격 팩스 머신에게 기회가 넘겨진다. -t 인수가 사용되지 않으면 efax는 전화를 받고 팩스를 수신받는다.
-v 문자열
출력될 메세지 유형을 선택한다. 문자열 내의 각 소문자는 한 종류의 메세지를 선택한다:
e - 에러
w - 경고
i - 세션 진행 정보
n - 기능 협상 정보
c - 모뎀 (AT) 명령과 반응
h - HDLC 프레임 자료( 클래스 1 에만 해당 )
m - 모뎀 출력
a - 프로그램 인수
r - 수신 에러 세부사항
t - 전송 세부사항
f - 이미지 화일 세부사항
x - 잠금 화일 처리
-v 옵션은 2 개까지 사용가능한다. 첫번째는 메세지를 표준 에러로 보내도록 하며 두번째는 표준 출력으로 보내도록 한다. 기본값은 표준 에러로 "ewin"이다.
-w
팩스를 받기 위하여 답신 (ATA) 명령을 사용하지 않고 OK 또는 CONNECT 프롬프트를 기다린다. 이 옵션은 모뎀이 자동 답신 (S0=n) 상태에 있거나 이미 다른 프로그램이 걸려온 전화를 받고 있을 때 사용한다.
-x lkf
장치를 열기 전에 잠금 화일로서 UUCP 스타일의 lkf 화일을 사용한다. 장치가 잠겨 있으면 efax는 매 15 초마다 점검한다. 같은 장치에 대하여 여러 이름이 존재할 때는 16 개까지 -x 옵션을 사용할 수 있다. 화일명 앞에 `#'을 붙이면 HDB 스타일의 텍스트 잠금 화일을 생성한다.

팩스 화일 형식

전송될 페이지는 각각 그룹 3 (G3) 압축을 사용하는 TIFF 형식으로 변환되어야 한다. 수신된 페이지 또한 이 형식으로 저장된다. 아래의 예제 섹션에서는 이 화일을 만들고 보고 출력하기 위하여 efix 또는 다른 프로그램을 어떻게 사용하는지 보여줄 것이다.

efax는 텍스트, T.4 (그룹 3), PBM, TIFF( G3 또는 비압축 상태 )등 efix(1)가 받아들이는 화일 형식을 읽는다. efax는 화일의 내용을 보고 화일 형태를 자동으로 판별한다. TIFF는 이미지 해상도에 대한 정보를 가지고 있으므로 권장한다. 텍스트 또는 멀티 페이지 TIFF를 보낼 때는 헤더의 페이지 번호가 틀릴 수 있다. 왜냐하면 페이지 번호는 화일명의 갯수로 처리되기 때문이다.

운영체제 요구사항

운영체제는 프로토콜 타임아웃을 피하기 위해 짧은 반응 시간을 제공할 수 있어야 한다. 클래스 2 모뎀의 경우 지연시간이 1, 2 초를 넘어선 안된다.

클래스 1 모뎀을 사용하는 경우 프로그램은 어떤 이벤트에 대하여 55 밀리 초 이내로 반응해야 한다. 이보다 긴 지연이 발생하면 팩스 프로토콜이 실패할 수 있다. ( DCS와 TCF 또는 RTC와 MPS 사이에서 ) 따라서 클래스 1 은 수신 자료에 대하여 55 밀리초 이내에 반응할 수 없는 시스템에서는 사용할 수 없다. 특히 몇몇 지능형 시리얼 카드 또는 터미널 서버의 경우 클래스 1 작동에 지장을 줄 만한 지연을 유발하기도 한다.

운영체제는 일정한 (보통 9600 bps) 전송률로 끊김없이 모뎀으로부터 디스크 화일로 저장할 수 있도록 충분한 저수준 버퍼링을 지원해야 한다. 팩스 프로토콜은 양자 간의 흐름 제어를 제공하지 않기 때문에 수신 중의 흐름 제어 성능은 모뎀의 버퍼량에 의해 제한된다. 이는 100 바이트 미만일 수 있다. Efax는 수신 중 흐름 제어를 사용하지 않는다.

모뎀 그룹, 클래스 요구사항

"그룹"이란 팩스 머신 또는 팩스 모뎀 사이에 팩스를 전송하는데 사용하는 프로토콜을 말한다. Efax는 표준 그룹 3 프로토콜을 지원한다. "클래스"란 컴퓨터가 팩스 모뎀을 제어할 때 사용하는 프로토콜을 말한다. Efax는 클래스 1, 2 팩스 모뎀을 지원한다. 클래스 2.0 지원은 아직 테스트되지 않았다.

대부분의 팩스 모뎀은 팩스 모드의 경우 XON/XOFF 흐름 제어를 사용한다. 이런 형태의 흐름 제어는 팩스의 경우 거의 부하를 주지 않는다. 많은 모뎀들은 팩스 모드에서 믿음직하지 못한 하드웨어 (RTS/CTS) 제어를 지원한다. efax는 XON/XOFF와 하드웨어 흐름 제어 모두 지원한다.

몇몇 모뎀은 약 1k 바이트의 시리얼 버퍼를 갖고 있는 경우도 있으나 많은 저가형 모뎀은 약 100 바이트 정도의 버퍼를 가지고 있을 뿐이며 팩스 전송시 오버런이 일어날 가능성을 갖는다.

몇몇 모뎀은 각각의 명령 사이에 efax가 사용하는 기본값인 100 밀리초 이상의 지연 시간을 필요로 한다. 만약 지연시간이 너무 짧다면 명령이 제대로 반향되지 않거나 타임아웃 또는 제대로 반응하지 않는다. 한 번 이상의 -oz 옵션을 사용하여 모뎀 초기화 명령 사이의 지연시간을 늘리고 모뎀 명령의 반향을 없애기 위해 E0 모뎀 초기화 명령을 사용하라.

기본적으로 efax는 클래스 2 모뎀으로부터 팩스를 받을 때 모뎀의 자료 전송 시작에 대하여 DC2 를 전송한다. 몇몇 구식 모뎀은 대신 XON 을 필요로 하기도 한다. 이런 모뎀의 경우 DC2 신호는 에러 메세지를 내거나 프로그램의 타임아웃을 유발한다. 이 때는 -ox 옵션을 사용하라.

몇몇 구식 클래스 2 모뎀 ( 예를 들어 몇 가지 인텔 모델 )은 팩스를 전송할 때 모뎀에게 자료 전달을 시작하도록 하기 위해 DC2 또는 XON을 보내지 않는다. 2 초 후 efax는 경고 메세지를 출력하고 어찌 되었든 전송을 시작한다.

극소수의 클래스 2 모뎀은 자료를 전송받을 때 비트 순서 (MSB에서 LSB로)를 바꾸지 않는다. 이런 경우 수신된 화일을 보거나 출력하면 엉뚱한 결과를 얻게 될 것이다. 이 때는 -or 옵션을 사용하라.

몇몇 저가 "9600 bps" 팩스 모뎀은 오로지 9600 bps로만 전송하고 수신 속도는 4800 bps로 제한하고 있다.

다음과 같은 클래스 1 모뎀이 efax와 잘 작동한다고 알려져 있다: AT&T DataPort, Cardinal Digital Fax Modem (14400), Digicom Scout+, Motorola Lifestyle 28.8, Motorola Power 28.8, QuickComm Spirit II, Smartlink 9614AV-Modem, Supra Faxmodem 144LC, USR Courier V.32bis Terbo, USR Sportster (V.32 and V.34), Zoom AFC 2.400, Zoom VFX14.4V.

다음과 같은 클래스 2 모뎀이 efax와 잘 작동한다고 알려져 있다: 14k4 Amigo Communion fax/modem, Adtech Micro Systems 14.4 Fax/modem, askey modem type 1414VQE, AT&T DataPort, ATT/Paradyne, AT&T Paradyne PCMCIA, Boca modem, BOCA M1440E, Crosslink 9614FH faxmodem, FuryCard DNE 5005, GVC 14.4k internal, Intel 14.4 fax modem, Megahertz 14.4, ,Microcom DeskPorte FAST ES 28.8, Motorola UDS FasTalk II, MultiTech 1432MU, Practical Peripherals PM14400FXMT, Supra V32bis, Telebit Worldblazer, TKR DM-24VF+, Twincom 144/DFi, ViVa 14.4/Fax modem, Vobis Fax-Modem (BZT-approved), Zoom VFX14.4V, ZyXEL U-1496E[+], ZyXEL Elite 2864I.

모뎀 초기화 옵션

필수적인 모뎀 초기화 명령은 efax에 의해 이뤄진다. 추가 명령은 명령행 인수로 주어질 수 있다. 모뎀은 자세한( 텍스트 형식으로 ) 결과 코드를 출력하도록 설정되어야 한다. 다음 명령이 그런 설정과 관련되어 있으며 모뎀 초기화시 efax에 의해 보내진다.

Q0V1
명령에 대하여 자세한 결과 코드로 답한다.

다음 명령이 유용할 수 있다:

X3
전화걸기 전 다이어 톤을 기다리지 않는다. 이미 수동으로 다이얼을 한 상태에서 팩스를 보낼 때 사용할 수 있다. 이 때 -t 명령의 인수로 빈 문자열 ("")을 사용한다. X4(기본값)은 모든 결과 코드를 가능 설정한다.
M2
다이얼하는 동안 진행 상황을 알리는 스피커를 켜놓는다. (끄려면 M0를 사용한다)
L0
스피커의 볼륨을 최소로 설정한다. ( 최대는 L3을 사용한다 )
E0
모뎀 명령의 방향을 금지한다. 문제 해결 섹션을 참고하라.
&D2
DTR 신호가 떨어지면 모뎀을 명령 모드로 전환한다. 모뎀 명령으로부터 반응을 얻지 못하면 프로그램은 다이얼 시작, 종료시 DTR을 떨어뜨린다. DTR이 떨어지면 모뎀을 재설정하기 위하여 &D3을 사용할 수 있다.
S7=120
캐리어 감지를 위해 2 분 ( 120 초 )까지 기다린다. 수신하는 팩스 머신이 핸드웨이킹 동작을 시작하는데 오랜 시간을 필요로 하는 경우 사용한다. (예를 들어 긴 안내 메세지를 갖는 팩스/자동응답 머신의 경우)

기능

지역 하드웨어, 소프트웨어의 기능은 콤마로 구분하는 8 개의 숫자로 된 문자열로 설정한다:

vr,br,wd,ln,df,ec,bf,st

설명은 다음과 같다:

vr (수직 해상도) =
0 인치 당 98 행
1 인치 당 196 행 ( 196 lpi )
br (전송률) =
0 2400 bps
1 4800
2 7200
3 9600
4 12000 (V.17)
5 14400 (V.17)
wd (폭) =
0 페이지 폭 8.5 인치 (8.5") (21.5 cm)
1 10" (25.5 cm)
2 12" (30.3 cm)
ln (길이) =
0 페이지 길이 11" (A4: 29.7 cm)
1 14" (B4: 36.4 cm)
2 페이지 길이 제한 없음
df (자료 형식) =
0 1-D 코딩
1 2-D 코딩 (아직 지원하지 않음)
ec (에러 검증) =
0 에러 검증 없음
bf (바이너리 화일) =
0 바이너리 화일 전송 아님
st (최소 스캔 시간) =
0 행 간 지연시간 없음
1 5 ms
3 10 ms
5 20 ms
7 40 ms

적절한 기능 문자열이 제시되어야 한다는 사실이 중요하다.

팩스를 수신할 때는 vr, wd, ln 과 기능 문자열 필드를 여러분의 디스플레이 소프트웨어가 지원하는 최대치로 놓아야한다.

팩스를 송신할 때는 efax가 이미지 화일 헤더로부터 vr를 결정하고 wdln 필드는 이미지 화일의 포맷을 보여줘야 한다.

수신 팩스 머신이 고해상도를 지원하지 않으면(vr=1) efax는 스캔 라인을 합쳐 해상도를 줄인다. 수신 팩스 머신이 이미지 폭을 지원하지 않으면 알맞게 크기를 채우거나 잘라낸다. 대부분의 팩스 머신은 ln를 2 까지 지원한다. wd값이 0 아닌 값을 지원하는 팩스는 거의 없다.

헤더

efax는 전송 시 각 이미지의 위에 빈 스캔 줄을 추가한다. 이 부분은 페이지 헤더를 위한 공간이지만 이미지의 크기를 늘리게 된다. ( 기본값으로 약 0.1 인치 또는 2.5 mm의 빈 줄이 추가된다 )

헤더는 페이지 꼭대기의 처음 스캔 줄에 찍힌다. 보통 날짜, 시간, 송신인, 수신인 ID, 페이지 번호와 장수를 포함한다. 헤더를 없앨 수는 없고 빈 줄로 할 수 있다.

헤더를 생성하는 기본 폰트는 12x24 픽셀로 조정되는 내장 8x16 픽셀 폰트이다. ( 약 9 포인트 크기 )

efax와 efix는 폰트를 지정하는 -f 옵션을 가지고 있다는 것을 기억하라. efIx는 텍스트-팩스 전환 시 텍스트 출력을 위해 폰트를 사용한다. ( "팩스 생성" 과정) 반면 efAx는 헤더 출력을 위해 사용한다. ( "팩스 전송" 과정 )

세션 기록

세션 기록은 표춘 에러에 쓰여진다. 그 화면은 -v 옵션으로 선택된 프로그램의 메세지이다. 총 소요시간과 분, 초가 각 메세지 앞에 출력된다. 모뎀 반응과 함께 출력되는 시간은 밀리초 단위이다.

반환값

다음과 같은 에러 코드를 반환한다:

0
팩스가 성공적으로 송신되거나 수신되었음.
1
통화 중이거나 모뎀 장치가 사용 중이다. 좀 있다가 다시 시도하라.
2
무엇인가 실패함( 예. 화일이 없거나 디스크가 다 참 ) 재시도하지 말라. 자세한 것은 세션 기록을 점검하라.
3
모뎀 프로토콜 에러. 프로그램이 모뎀으로부터 기대하던 반응을 얻을 수 없었음. 모뎀이 제대로 초기화되지 않았거나 -o이 올바로 사용되지 않았거나 또는 버그 보고가 작동 중이다. 자세한 것은 세션 기록을 참고하라.
4
모뎀이 반응하지 않음. 점검하라. 모뎀이 켜져 있는지 알맞는 포트에 연결되어 있는지 점검하라.
5
프로그램이 시그널을 받아 종료함.

예제

팩스 (G3) 화일 만들기

텍스트 화일을 TIFF-G3 형식으로 변환할 때는 efix 프로그램을 사용하면 된다. 예를 들어 다음 명령은 letter라는 텍스트 화일을 letter.001, letter.002 등의 화일로 변환한다:

 efix -nletter.%03d <letter
 

efix 프로그램은 서두나 서명 등을 생성하기 위하여 이미지에 비트맵을 삽입할 수 있도록 해준다.

고스트스크립트의 tiffg3 드라이버를 가지고 포스트스크립트 화일로부터 TIFF-G3 형식의 팩스 화일을 만들 수 있다. 예를 들면 다음과 같다:

 gs -q -sDEVICE=tiffg3 -dNOPAUSE \
         -sOutputFile=letter.%03d letter.ps </dev/null
 

letter.ps 라는 포스트스크립트 화일을 고해상도(vr=1) G3 팩스 이미지 화일 letter.001, letter.002, ... 로 변환한다.

The images should have margins of at least 1/2 inch (1 cm) since 이미지는 최소한 1/2 인치( 1 cm )의 테두리를 가져야 하는데 팩스 표준에서는 폭 196.6 mm, 높이 281.5 mm ( 폭 7.7 인치, 높이 11.1 인치 )의 중앙부를 출력하기 때문이다.

팩스 화일 출력하기

HP-PCL 프린터 또는 포스트스크립트 장치에 출력하기 위해서는 efix를 사용한다. 예를 들어 수신된 팩스를 300 dpi로 포스트스크립트 프린터에 출력하려면 다음과 같이 명령한다:

 efix -ops -r300 -s1.5 <reply.001 | lpr
 

수많은 이미지 형식 간의 변환을 위해서는 Portable Bit Map (pbm) 꾸러미를 사용하기도 한다. 예를 들어 수신된 이미지, reply.001 을 약 2/3 크기로 HP 레이져젯에서 출력하려면 다음과 같이 한다:

 efix -opbm reply.001 | pbmtolj -resolution 300 | lpr
 

팩스 화일 보내기

다음 예는 톤 다이얼링으로 222-2222에 전화를 걸고 TIFF/G3 화일 letter.001과 letter.002, 2 페이지를 /dev/cua1 장치에 연결된 클래스 1 팩스모뎀을 통해 팩스 전송한다.

 efax -d /dev/cua1 -o1 \
      -t T222-2222 letter.001 letter.002
 

수동 수신

efax로 하여금 즉시 전화를 받고 팩스 수신을 하도록 할 수 있다. 팩스인지 음성인지 수동으로 답신해야 할 필요가 있을 때 사용한다.

예를 들어 다음 명령은 /dev/ttyS1 장치에 연결된 클래스 2 팩스 모뎀으로 하여금 전화를 받고 팩스를 수신하도록 한다. 수신된 팩스는 reply.001, reply.002, ... 등의 화일명으로 저장된다. 모뎀은 자기 자신을 "555 1212" 라고 알리며 14.4 kbps (br=5)로 고 또는 저해상도로 팩스를 수신한다.

 efax -d /dev/ttyS1 -or -l "555 1212" \
    -c 1,5 -r reply
 

자동 수신

-w 옵션은 팩스 수신을 시작하기 전에 모뎀으로부터 문자가 전달되기를 기다리게 만든다( 즉 팩스 송신이 오는 상태 ) n 회 전화벨이 울리고 나서 통화에 응하려면 -w 옵션과 -iS0=n 옵션을 사용하라. 다음 예는 4 번 벨이 울리면 팩스 모드에서 전화를 받도록 하며 수신된 팩스를 수신 날짜와 시간에 맞는 화일명으로 저장하게 한다.

 efax -d /dev/ttyb -or -w -iS0=4 2>&1 >> fax.in.log
 

모뎀을 전화걸기와 함께 사용하기

모뎀 장치는 UUCP 장치 잠금 프로토콜을 사용하는 프로그램들 사이에 공유될 수 있다. ( 커밋, uucico, efax, cu 등 )

efax는 -x 옵션을 통해 하나 이상의 UUCP 잠금 화일명이 주어지면 모뎀 장치를 열기 전에 모뎀을 잠근다. 잠금 화일명은 보통 /usr/spool/uucp/LCK..dev인데 dev은 잠그고자 하는 /dev 디렉토리 장치화일명이다. ( 역자 주 : 리눅스에서는 /var/spool/uucp/LCK..dev )

-s (공유) 옵션이 사용되면 다른 프로그램이 그 동안 사용할 수 있도록 전화를 기다리는 동안은 잠금 화일을 지운다.

efax는 팩스를 기다리는 동안 다른 프로그램이 모뎀이 사용하고 있음을 감지하면 종료 코드값을 1을 가지고 종료한다. 그 다음 efax 프로세스는 모뎀을 초기화하고 다시 팩스를 기다리기 시작하기 전에 다른 프로그램이 종료하기를 기다린다.

UUCP 잠금 화일이 아닌 다른 방식의 장치 잠금 기법을 사용하는 프로그램은 이러한 무작위 방식을 이용할 수 없다. 왜냐하면 그 장치는 efax에게 그대로 열릴 수 있기 때문이다. 이런 경우 다른 프로그램을 실행하기에 앞서 efax 프로세스를 죽여야 한다. ( 즉 "팩스 종료" )

efax가 팩스를 기다리는 동안 모뎀은 팩스 모드에서 수신 대기하도록 해두면서 잠금 화일을 제거한다. SLIP이나 PPP 프로그램이 자신의 잠금화일을 설정하면서 모뎀 포트를 차지하면 efax는 더 이상 모뎀에 명령을 보낼 수 없다. 물론 재설정도 불가능하다. 다라서 다른 프로그램들은 시작시 자료 모드로 돌아가기 위해 모뎀을 재설정해야 한다. 여러분의 SLIP, PPP 채트 스크립트 앞에 재설정 명령을 추가하라. (send ATZ expect OK)

팩스와 데이터 요청을 받아들이기

많은 모뎀들은 -j+FAE=1 ( 클래스 1 의 경우 ) 또는 -jFAA=1( 클래스 2.[0]의 경우 ) 초기화 문자열을 사용함으로써 자동 데이터/팩스 응답 모드를 가질 수 있다. 이런 응답 기능 ( 데이터 또는 팩스 )은 모뎀의 반응을 보고 알 수 있다.

몇몇 모뎀들은 제한된 자동 응답 기능( 예. 특정 보드율에서만 작동하거나 클래스 2 모드에서만 작동 )을 갖거나 아예 갖고 있지 않다. 이 경우 우선 데이타 모드로 응답하기 위하여 -i+FCLASS=0 초기화 문자열을 사용하고 첫번째 시도가 실패하면 끊기를 위해 -oa를 사용한 후 다시 팩스 모드를 시도한다. 이 방법은 여러분의 전화 시스템이 걸려오는 전화를 끊기 전에 여러분이 끊기를 시도한 후 몇 초 기다리는 경우에만 될 것이다.

-g 옵션이 사용되면 옵션 인수가 데이터 접속 요청이 감지되었을 때 쉘 명령으로 실행될 것이다. 보통 이 명령은 getty(8)를 실행한다. 이 프로그램은 회선 끊기를 행하거나 잠금 화일을 만들지 않도록 모뎀이 이미 받기 상태이며 잠금 화일이 있다는 것을 예상할 수 있어야 한다. 주의할 것은 모뎀이 DCE-DCE ( 모뎀-모뎀, 예를 들어 CONNECT 14400 )속도를 보고하지 않고 DCE-DTE (모뎀-컴퓨터, 예를 들어 CONNECT 38400 ) 속도를 보고하도록 설정되어 있어야 한다. 많은 모뎀의 경우 -iW0 옵션을 사용하면 된다.

다음 명령은 efax로 하여금 두번째 벨이 울리면 /dev/cua1으로 걸려온 전화에 응답하도록 한다. 이 장치는 두 개의 서로 다른 장치 화일로 잠겨질 것이지만

/dev/cua1 on the second ring. This device will be locked using two different lock files but these lock files will be removed while waiting for incoming calls (-s). If a data call is detected, the getty program will be run to initialize the terminal driver and start a login(1) process. Received fax files will be stored using names like Dec02-12.32.33.001, in the /usr/spool/fax/incoming directory and the log file will be appended to /usr/spool/fax/faxlog.cua1.

 efax -d /dev/cua1  -j '+FAA=1' \
    -x /var/spool/uucp/LCK..cua1 \
    -x /var/spool/uucp/LCK..ttyS1 \
    -g "exec /sbin/getty -h /dev/cua1 %d" \
    -iS0=2 -w -s \
    -r "/var/spool/fax/incoming/%b%d-%H.%I.%S" \
    >> /var/spool/fax/faxlog.cua1 2>&1
 

Note that adaptive answer of either type will not work for all callers. For some data calls the duration of the initial data-mode answer may be too short for the initial handshaking to complete. In other cases this duration may be so long that incoming fax calls will time out before efax switches to fax mode. In addition, some calling fax modems mistake data-mode answering tones for fax signaling tones and initiate fax negotiation too soon. If you use software adaptive answer you can reduce the value of the initial data-mode answer (set by TO_DATAF in efax.c) to get more reliable fax handshaking or increase it for more reliable data handshaking. However, if you need to provide reliable fax and data service to all callers you should use separate phone numbers for the two types of calls.

When a call is answered the modem goes on-line with the computer-to-modem baud rate fixed at the speed used for the most recent AT command. When efax is waiting for a fax or data call it sets the interface speed to 19200 bps since this is the speed required for fax operation. This prevents full use of 28.8kbps modem capabilities.

init를 사용하여 efax 실행하기

efax can answer all incoming calls if you place an entry for efax in /etc/inittab (for SysV-like systems) or /etc/ttytab (for BSD-like systems). The init(8) process will run a new copy of efax when the system boots up and whenever the previous process terminates. The inittab or ttytab entry should invoke efax by running the fax script with an answer argument.

For example, placing the following line in /etc/inittab (and running "kill -1 1") will make init run the fax script with argument answer every time previous process terminates (and init is in runlevel 4 or 5).

 s1:45:respawn:/bin/sh /usr/bin/fax answer
 

For BSD-like systems, a line such as the following in /etc/ttytab will have the same effect:

 ttya "/usr/local/bin/fax answer" unknown off
 

You should protect the fax script and configuration files against tampering since init will execute them as a privileged (root) process. If you will be allowing data calls via getty and login you should ensure that your system is reasonably secure (e.g. that all user id's have secure passwords).

If efax exec()'s getty properly but you get a garbled login prompt then there is probably a mismatch between the two ends of the serial link between the modem and the computer. First, check the efax log file to make sure the modem's CONNECT response reported the serial port speed (e.g. 19200), not the modem-modem speed (e.g. 14400). Next, check the getty options and/or configuration files (e.g. /etc/gettydefs) for that particular baud rate. Then run getty manually with the same arguments and verify the port settings using ``stty </dev/XXX''. Note that you'll probably want to enable hardware flow control for data connections (-h for agetty, CRTSCTS for getty_ps).

A few programs won't work properly when efax is set up to answer calls because they don't create lock files. You can put the shell script ``wrapper'' below around such programs to make them work properly. Change BIN and LOCKF to suit.

 #!/bin/sh
 BIN=/bin/badprogram
 LOCKF=/var/spool/uucp/LCK..cua1
 if [ -f $LOCKF ]
 then
         echo lock file $LOCKF exists
         exit 1
 else
         printf "%10d $$ >$LOCKF
         $BIN $*
         rm $LOCKF
 fi
 

프린터 스풀러를 통하여 팩스 보내기

You can add a "fax" printer to the lpr print spooler that will fax out a document using efax instead of printing it. This allows a network server running efax to send faxes on behalf of other machines, including non-Unix clients. In the following steps use the directories specified in the fax script if they are different than /usr/bin and /var/spool/fax (FAXDIR). To set up a fax printer:

(1) Create a link to the fax script called ``faxlpr'' so the fax script can determine when it is being invoked from the print spooler:

ln -s /usr/bin/fax /usr/bin/faxlpr

(2) Edit /etc/printcap and add an entry such as:

 fax:lp=/dev/null:sd=/var/spool/fax:if=/usr/bin/faxlpr
 

to define a printer called "fax". Print files will be spooled to the /var/spool/fax (sd=) directory and then piped to the /usr/bin/faxlpr filter (if=).

(3) Create and/or set the permissions on the fax spool directory. For example:

 mkdir /var/spool/fax
 chmod ugo=rwx /var/spool/fax
 

You should now be able to send a fax using the lpr interface by using a command such as:

 lpr -P fax -J "555 1212" file.ps
 

where the -J option is used to specify the phone number or alias to be dialed.

Note that if more than one file is given on the command line they will be concatenated before being passed to "fax send". TIFF-G3, Postscript or PBM files must therefore be sent one file at a time although the TIFF and Postscript file may contain multiple pages. Only multiple text files can be sent in one command. Page breaks in text files can be marked with form-feed characters. Files will be converted and sent at the default (high) resolution.

You can use lpq(1) to check the fax queue, lprm(1) to remove fax jobs and lpc(8) to control the spooler. In each case use the -Pfax option to specify the fax ``printer.'' A log file will be mailed to the user when the fax is sent.

You should also be able to send a fax from any networked computer that has lpr-compatible remote printing software and that allows you to set the job name (-J option) to an arbitrary string. Such software is available for most computers.

See the lpd(8) and printcap(5) man pages for information on the print spooler and for restricting access by host name (/etc/host.lpd) or by user group (the `rg' printcap entry).

문제 해결

Double check the configuration setup in the first part of the fax script.

Run the "fax test" script to check the modem's responses to various commands. The results will be displayed at the end of the test. Some ERROR responses from the modem should be expected since most modems don't implement all the possible commands.

If efax hangs when trying to open the modem device (typically ttyX), the device is either already in use by another process (e.g. getty) or it requires the carrier detect line to be true before it can be opened. Many systems define an alternate device name for the same physical device (typically cuaX) that can be opened even if carrier is not present or other programs are already using it.

If modem responses are being lost or generated at random, another processes (e.g. getty or an efax auto-answer process) may be trying to use the same device at the same time. Using lock files (-x options) can often resolve this problem.

Check the response to the "AT+FCLASS=?" command to make sure your modem supports the Class (1, 2 or 2.0) that you have selected. If you have a Class 1 modem, check the response to the "AT+FRM=?" command to verify the speeds supported (e.g. a response of "24,48" would mean only 2400 and 4800 bps are supported). For Class 2 modems check the response to the "AT+FDCC=?" command to make sure the modem supports the capabilities you have selected (see CAPABILITIES above).

Attempt to send a fax. Check that the modem starts making the calling signal (CNG, a 0.5 second beep every 3 seconds) as soon as it's finished dialing. This shows the modem is in fax mode. You may need to use the option -iM2L3 to monitor the phone line (see the SPKR string in the fax script).

Listen to the answering fax machine and check that it sends the answering signal (CED, a 3 second beep) when it answers followed by "warbling" sounds (DIS frames) every 3 seconds. If you hear a continuous signal instead (tones or noise), then you've connected to a data modem instead.

Your modem should now send back another warble (DCS frame) immediately followed by 1.5 seconds of noise (a channel check). If everything is OK, the receiving end will send another warble (CFR frame) and your modem will start to send data. If you have an external modem check its LEDs. If flow control is working properly the modem's send data (SD) LED will turn off periodically while the fax data is sent.

When the transmission completes, check the message showing the line count and the average bit rate.

Low line counts (under 1000 for a letter size image) or the warning "fax output buffer overflow" when sending indicate that the image data format is incorrect. Check the file being sent using the "fax view" command.

If you get the error message ``flow control did not work'' then flow control was not active. This usually results in a garbled transmission and the receiving machine may reject the page, abort the call, print a distorted or blank image and/or hang up.

Most modems enable XON/XOFF flow control when fax mode is enabled. Check the output of the fax test command for the flow control settings in fax mode (typically &K4 or \Q1). If they are incorrect you can use -j commands to enable flow control.

The warning "characters received while sending" or an <XOFF> character appearing after the transmission means that the operating system ignored the modem's XOFF flow control character. Ensure that you are not running other programs such as getty or pppd at the same time as efax since they will turn off xon/xoff flow control.

If you cannot get flow control to work properly then enable ``virtual flow control'' with the -of option.

Check that the remote machine confirms reception with a +FTPS:1 response (Class 2) or an MCF frame (Class 1).

For Class 2 modems, the error message "abnormal call termination (code nn)" indicates that the modem detected an error and hung up. The modem's manual may give an explanation for the error number nn.

Many companies advertise services that will fax back information on their products. These can be useful for testing fax reception.

The message "run length buffer overflow" when receiving indicates an error with the image data format -- make sure you are using the -or option with Class 2 modems.

If efax should display the message "can't happen (<details>)" please send a bug report to the author.

Finally, don't play "option bingo," if you can't resolve the problem save the output of the fax test command to a file (e.g. fax test >test.out) and send it along with a verbose log of the failed session to the address below. If you don't get a response in a reasonable time try the mailing list described below.

메일링 리스트

A mailing list has been set up to support users of efax and related software. To subscribe, send e-mail to efax-request@renaissoft.com with the word "subscribe" in the subject field. After subscribing you can post to the mailing list by sending your post to efax@renaissoft.com.

FTP 사이트

Wimsey Information Services provides an anonymous FTP site for efax at ftp://ftp.wimsey.com/pub/efax/. Bug reports and patches will be posted here.

관련 소프트웨어

For Linux Systems

An independent package, Qfax, uses efax to provide fax services for multiuser Linux systems through a mail-to-fax gateway. It is available by anonymous ftp from sunsite.unc.edu as /pub/Linux/apps/comm/fax/qfax1.0.tar.gz. Another program, g3vga, can be used to provide fax preview with VGA displays. Also available from sunsite.unc.edu.

For Amiga Systems

A port of an early version of efax for the Amiga is available as a component of a shareware voice mail package, AVM, distributed by Al Villarica (rvillari@cat.syr.edu).

저자

Efax was written by Ed Casas. Please send comments or bug reports to edc@cce.com.

버그 보고

Please mention the operating system, the type of the modem used and include a copy of a verbose session log that demonstrates the problem. Without the verbose log it's usually impossible to diagnose problems. Please do not send fax image files.

ACKNOWLEDGEMENTS

Many people have helped with the development of efax by providing encouragement, suggestions, bug reports and fixes, by doing pre-release testing and by developing related software.

A very incomplete list includes: Michele Bergonzoni, John Conover, Mitchum DSouza, Bradley Dale, Dirk Eddelbuettel, Debbe Gervin, Juha Heinanen, Jim Hitzel, Jamie Honan, Michael Huehne, Lester Ingber, Sarantos Kapidakis, Al Knudson, Ken Land, Ulrich Lauther, Robert J. LeBlanc, Derek Lee, Charles H. Lindsey, Norm Matloff, Mark Montague, Michele Bergonzoni, Jose' M. Piquer, Munagala V. S. Ramanath, Markus Regnet, Adam J. Richter, Stewart C. Russel, Lal Sanjay, Bogdan Urma, Al Villarica, and Brian White.

Yggdrasil and SuSE have provided complementary copies of their Linux CD-ROMs. Their support is gratefully acknowledged.

efax is copyright 1993 -- 1996 Ed Casas. It may be used, copied and modified under the terms of the GNU Public License.

DISCLAIMER

Although efax has been tested it may have errors that will prevent it from working correctly on your system. Some of these errors may cause serious problems including loss of data and interruptions to telephone service.

REFERENCES

Dennis Bodson et. al., "FAX: Digital Facsimile Technology and Applications", Second Edition. Artech House, Boston. 1992.

CCITT Recommendation T.4, "Standardization of Group 3 Facsimile Apparatus for Document Transmission". 1988.

CCITT Recommendation T.30, "Procedures for Document Facsimile Transmission in the General Switched Telephone Network". 1988

The above CCITT (now ITU-T) standards could be downloaded from gopher://info.itu.ch although this service seems to have been discontinued and it is now necessary to order printed copies.

Documentation on Class 1 and Class 2 fax commands as implemented by Rockwell are available from http://www.tokyo.rockwell.com/ref/reference.html.

The pbm utilities can be obtained by ftp from wuarchive.wustl.edu in /graphics/graphics/packages/NetPBM/netpbm-1mar1994.tar.gz.

Ghostscript can be obtained from any GNU archive site.

참고

fax(1), efix(1), pbm(5), g3topbm(1), gs(1), init(8), inittab(5), ttytab(5), printcap(5), lpd(8), printf(3), strftime(3).

버그

Can't read TIFF files with more than 1 strip

Class 1 operation may fail if the program can't respond to certain data received from the modem within 55 milliseconds.

May fail if multitasking delays cause the received data to overflow the computer's serial device buffer or if an under-run of transmit data exceeds 5 seconds.

Polling and Class 2.0 are not well tested.

Does not support 2-D coding, ECM, or BFT.