X

How to send fax using remserial and efax on CentOS 5

The condition is , Fax Modem is available over a TCP socket.

Let say .. 192.168.1.59 port 4001

Now, in order to use that as a local serial modem.
I use a remserial which redirect the TCP socket a local serial port.

Get the source from here :
http://lpccomp.bc.ca/remserial/

once done the following

copy its binary into /usr/local/sbin/remserial

then test.

/usr/local/sbin/remserial -r 192.168.1.59 -p 4001 -l /dev/modem /dev/ptmx

.. now time to test.

try with minicom -s

serial port : /dev/modem
speed : 9600
bit : 8N1

AT
OK
ATZ
OK
ATI4
will return the modem detail.

to call

ATDT0123456779;

now to test the fax..


yum install efax

make a .ps file using OpenOffice -> print to file -> ps.

fax PAGE=a4 DEV=modem FROM="namran.net" NAME="Namran"  send -v 0370002778 /home/namran/Desktop/fax2.ps

replace the 0370002778 with the destination number.

or if want directly to use efax with CLASS=1 .. need to convert to 001 first

efax -o 1   -d /dev/modem -t T30001629 /home/namran/Desktop/fax.ps.001 

Example result :

[root@home ~]# fax PAGE=a4 DEV=modem FROM="namran.net" NAME="Namran" CLASS="1" send -v 70002778 /tmp/ashraf.ps 
/tmp/ashraf.ps is postscript...
/usr/bin/efax: Thu Jun 23 14:49:10 2011 efax v 0.9 Copyright 1999 Ed Casas
efax: 49:10 Warning: local ID (namran.net) has non-standard characters
efax: 49:10 TIFF version 4.2 file (little-endian)
efax: 49:10 TIFF directory at 8 with 20 tags, last image.
efax: 49:10 page 1 : /tmp/ashraf.ps.001 + 338 : 1728x2156 @ 204x196 dpi TIFF/FAX
efax: 49:10 argv[0]=/usr/bin/efax
efax: 49:10 argv[1]=-v
efax: 49:10 argv[2]=chewmainrxtf
efax: 49:10 argv[3]=-v
efax: 49:10 argv[4]=chewmainrxtf
efax: 49:10 argv[5]=-d/dev/modem
efax: 49:10 argv[6]=-x
efax: 49:10 argv[7]=/var/lock/LCK..modem
efax: 49:10 argv[8]=-iZ
efax: 49:10 argv[9]=-i&FE&D2S7=120
efax: 49:10 argv[10]=-i&C0
efax: 49:10 argv[11]=-iM1L0
efax: 49:10 argv[12]=-l
efax: 49:10 argv[13]=namran.net
efax: 49:10 argv[14]=-kZ
efax: 49:10 argv[15]=-h
efax: 49:10 argv[16]=2011/06/23 14:49     namran.net      Namran     p. %d/%d
efax: 49:10 argv[17]=-t
efax: 49:10 argv[18]=T70002778
efax: 49:10 argv[19]=/tmp/ashraf.ps.001
efax: 49:10 created text lock file /var/lock/LCK..modem
efax: 49:10 opened /dev/modem
efax: 49:10 command  "Q0V1"
efax: 49:10 waiting 2.0 s
efax: 49:10 .540 [ATQ0V1]
efax: 49:10 .577 [OK]
efax: 49:10 response "OK"
efax: 49:10 command  "Z"
efax: 49:10 waiting 5.0 s
efax: 49:10 .682 [ATZ]
efax: 49:10 .895 [OK]
efax: 49:10 response "OK"
efax: 49:10 command  "&FE&D2S7=120"
efax: 49:10 waiting 5.0 s
efax: 49:11 .000 [AT&FE&D2S7=120]
efax: 49:11 .051 [OK]
efax: 49:11 response "OK"
efax: 49:11 command  "&C0"
efax: 49:11 waiting 5.0 s
efax: 49:11 .194 [OK]
efax: 49:11 response "OK"
efax: 49:11 command  "M1L0"
efax: 49:11 waiting 5.0 s
efax: 49:11 .338 [OK]
efax: 49:11 response "OK"
efax: 49:11 command  "E0"
efax: 49:11 waiting 5.0 s
efax: 49:11 .481 [OK]
efax: 49:11 response "OK"
efax: 49:11 command  "I3"
efax: 49:11 waiting 5.0 s
efax: 49:11 .624 [CX81802-V90]
efax: 49:11 .628 [OK]
efax: 49:11 response "OK"
efax: 49:11 command  "+FCLASS=?"
efax: 49:11 waiting 5.0 s
efax: 49:11 .779 [0,1,1.0,8,10]
efax: 49:11 .788 [OK]
efax: 49:11 response "OK"
efax: 49:11 command  "+FCLASS=1"
efax: 49:11 waiting 5.0 s
efax: 49:11 .935 [OK]
efax: 49:11 response "OK"
efax: 49:11 using CX81802-V90 in class 1
efax: 49:12 command  "+FTM=?"
efax: 49:12 waiting 5.0 s
efax: 49:12 .080 [3,24,48,72,73,74,96,97,98,121,122,145,146]
efax: 49:12 .101 [OK]
efax: 49:12 response "OK"
efax: 49:12 dialing T79582778
efax: 49:12 command  "DT79582778"
efax: 49:12 waiting 120.0 s
efax: 49:22 .213 [CONNECT]
efax: 49:22 response "CONNECT"
efax: 49:22 connected
efax: 49:23 waiting 2.0 s
efax: 49:23 .644 [OK]
efax: 49:23 response "OK"
efax: 49:23 Warning: bit-reversed HDLC frame, reversing bit order
efax: 49:23 received 22 bytes:
efax: 49:23  ff c0 04 00 00 70 00 00 00 68 f0 80 c0 00 08 a0
efax: 49:23  40 a9 13 10 e1 d8
efax: 49:23 received NSF - answering features
efax: 49:23 command  "+FRH=3"
efax: 49:23 waiting 35.0 s
efax: 49:23 .689 [CONNECT]
efax: 49:23 response "CONNECT"
efax: 49:24 waiting 2.0 s
efax: 49:24 .033 [OK]
efax: 49:24 response "OK"
efax: 49:24 received 11 bytes:
efax: 49:24  ff c8 01 00 73 1d 01 01 88 03 ae
efax: 49:24 received DIS - answering capabilities
efax: 49:24 remote has no document(s) to send, and can receive
efax: 49:24 local   196lpi 14.4kbps 8.5"/215mm  any   1D    -     -  0ms
efax: 49:24 remote  196lpi  9600bps 8.5"/215mm  any   2D    -     -  20/10ms
efax: 49:24 session 196lpi  9600bps 8.5"/215mm  any   1D    -     -  10ms
efax: 49:24 command  "+FTH=3"
efax: 49:24 waiting 3.1 s
efax: 49:24 .108 [CONNECT]
efax: 49:24 response "CONNECT"
efax: 49:24 sent 23 bytes:
efax: 49:24  ff c0 c2 2e a6 76 74 76 86 4e b6 86 76 04 04 04
efax: 49:24  04 04 04 04 04 04 04
efax: 49:24 sent TSI - caller ID
efax: 49:24 waiting 13.6 s
efax: 49:25 .893 [CONNECT]
efax: 49:25 response "CONNECT"
efax: 49:25 sent 6 bytes: ff c8 c1 00 62 14
efax: 49:25 sent DCS - session format
efax: 49:25 waiting 13.6 s
efax: 49:26 .315 [OK]
efax: 49:26 response "OK"
efax: 49:26 command  "+FTS=8"
efax: 49:26 waiting 3.0 s
efax: 49:26 .444 [OK]
efax: 49:26 response "OK"
efax: 49:26 command  "+FTM=96"
efax: 49:26 waiting 3.1 s
efax: 49:26 .516 [CONNECT]
efax: 49:26 response "CONNECT"
efax: 49:27 waiting 30.0 s
efax: 49:28 .477 [OK]
efax: 49:28 response "OK"
efax: 49:28 sent TCF - channel check of 1800 bytes
efax: 49:28 command  "+FRS=1"
efax: 49:28 waiting 3.0 s
efax: 49:28 .567 [OK]
efax: 49:28 response "OK"
efax: 49:28 command  "+FRH=3"
efax: 49:28 waiting 3.0 s
efax: 49:29 .726 [CONNECT]
efax: 49:29 response "CONNECT"
efax: 49:30 waiting 2.0 s
efax: 49:30 .727 [OK]
efax: 49:30 response "OK"
efax: 49:30 received 5 bytes: ff c8 21 57 be
efax: 49:30 received CFR - channel OK
efax: 49:30 command  "+FTM=96"
efax: 49:30 waiting 3.1 s
efax: 49:30 .800 [CONNECT]
efax: 49:30 response "CONNECT"
efax: 49:30 padding to 12 bytes/scan line.
efax: 49:30 header:[2011/06/23 14:49     namran.net      Namran     p. 1/1]
efax: 49:51 waiting 30.0 s
efax: 49:55 .331 [OK]
efax: 49:55 response "OK"
efax: 49:55 sent 20+2156 lines, 10384+18500 bytes, 25 s  9242 bps
efax: 49:55 command  "+FTS=8"
efax: 49:55 waiting 3.0 s
efax: 49:55 .472 [OK]
efax: 49:55 response "OK"
efax: 49:55 command  "+FTH=3"
efax: 49:55 waiting 3.1 s
efax: 49:55 .539 [CONNECT]
efax: 49:55 response "CONNECT"
efax: 49:55 sent 3 bytes: ff c8 f4
efax: 49:55 sent EOP - done
efax: 49:55 waiting 13.6 s
efax: 49:56 .843 [OK]
efax: 49:56 response "OK"
efax: 49:56 command  "+FRH=3"
efax: 49:56 waiting 3.0 s
efax: 49:57 .631 [CONNECT]
efax: 49:57 response "CONNECT"
efax: 49:58 waiting 2.0 s
efax: 49:58 .600 [OK]
efax: 49:58 response "OK"
efax: 49:58 received 5 bytes: ff c8 31 45 8f
efax: 49:58 received MCF - page OK
efax: 49:58 sent -> /tmp/ashraf.ps.001
efax: 49:58 command  "+FTH=3"
efax: 49:58 waiting 3.1 s
efax: 49:58 .661 [CONNECT]
efax: 49:58 response "CONNECT"
efax: 49:58 sent 3 bytes: ff c8 5f
efax: 49:58 sent DCN - disconnect
efax: 49:58 waiting 13.6 s
efax: 49:59 .963 [OK]
efax: 49:59 response "OK"
efax: 49:59 command  "H"
efax: 49:59 waiting 5.0 s
efax: 50:00 .836 [OK]
efax: 50:00 response "OK"
efax: 50:00 command  "Q0V1"
efax: 50:00 waiting 2.0 s
efax: 50:00 .980 [OK]
efax: 50:00 response "OK"
efax: 50:01 command  "Z"
efax: 50:01 waiting 5.0 s
efax: 50:01 .298 [OK]
efax: 50:01 response "OK"
efax: 50:01 read HDB pid 6643 [      6643] from /var/lock/LCK..modem (our pid)
efax: 50:01 removed lock file /var/lock/LCK..modem
efax: 50:01 done, returning 0 (success)
[root@home ~]# 

:)

Namran Hussin: a soft spoken guy... with exceptional interest in computers and technology. I love to learn new thing and also love to break thing for the sake of learning.. but I do abide to the self-imposed limitation or certain thing such as social thing in life, thing can be done and thing that must be avoided at whatever cost such as drug,illegal tracking, smoke,illicit activity..etc.muahahaha let's share what we had in this short term of the life.! make it worth of the living.~
Related Post
Leave a Comment