home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / texte / zfax3.api < prev    next >
Encoding:
Text File  |  1994-04-18  |  30.5 KB  |  555 lines

  1.  
  2. Appendix D
  3. ZFAX 3.12 API Function List
  4.  
  5. Programers can use two kind of API to call the ZFAX inside his program, the
  6. first one is use DOS shell to call the command line ZFAX, the other one is use
  7. the int 2fh to call ZFAX by software interrupt.
  8.  
  9. D.1 Command Line ZFAX
  10. You can call the ZFAX function from DOS command line, the usage is as follow :
  11.  
  12. Syntax:  zfax [cmdtype] [parameters] [options]
  13. cmdtype:
  14.    TSR ZFAX        : zfax ts
  15.    Send fax        : zfax sf filename faxnum
  16.    Print fax       : zfax pf filename
  17.    Convert faxfile : zfax cf filename dest-filename fcnvtype*
  18.    Viewfax         : zfax vf filename
  19.    Rcvfax for BBS  : zfax rf
  20.    Pollfax         : zfax lf faxnum
  21.    Send voice,     : zfax sv filename phonenum
  22.    Convert vocfile : zfax cv filename dest-filename vcnvtype*
  23.    Record voice    : zfax rv filename channel* vcmptype*
  24.    Play voice      : zfax pv filename channel*
  25.    Manual answer   : zfax ma
  26.    Dial phnumber   : zfax dp phonenum
  27.    In Terminal     : zfax tm
  28.    Send data       : zfax sd filename phonenum
  29.    Receive data    : zfax rd
  30.  
  31. * fcnvtype : 0=FAX, 1=PCX, 2=TIFF, 3=PRN
  32. * vcnvtype : 0=2bit-ADPCM, 1=3bit-ADPCM, 2=VOC
  33. * vcmptype : 0=CELP, 1=2bit-ADPCM, 2=3bit-ADPCM
  34. * channel  : 0=Teleco Line, 1=MIC/SPEAKER
  35.  
  36. options:
  37. /?   = Display help screen
  38. /u   = Remove the TSR
  39. /z:# = Page size (0-2), 0=A4, 1=B4, 2=A3
  40. /s:# = Page resolution (0-1), 0=Normal, 1=High
  41. /r:# = Retry counter (0-99)
  42. /p:# = Printer port (0-2), 0=LPT1, 1=LPT2, 2=LPT3
  43. /g:# = Graphic device (0-4), 0=AutoDetect, 1=VGA, 2=EGA, 3=CGA, 4=Hercules
  44. /c:# = COM port number (0-6)
  45.        0=IRQ4-3F8, 1=IRQ3-3E8, 2=IRQ4-3E8, 3=IRQ3-2E8
  46.        4=IRQ5-3E8, 5=IRQ2-2E8, 6=User-Defined
  47. /t:# = Printer type (0-7)
  48.        0=EPSON FX (8 pins), 1=EPSON LQ (24 pins),
  49.        2=LaserJet II letter,  3=LaserJet II legal,  4=LaserJet II A4
  50.        5=LaserJet III letter, 6=LaserJet III legal, 7=LaserJet III A4
  51. /n:addr,irq  /w:TmpDir
  52.  
  53.  
  54. D.2 API of INT 2fh
  55. This section describes the API function of ZFAX driver by using the software
  56. interrupt int 2fh. If you want to use the ZFAX function from your program,
  57. load the zfax to TSR first and then use int 2fh to execute zfax.
  58.  
  59. The signature of ZFAX is : 'Z'+081h = DBh.
  60. The procedure to use this API is as follow :
  61.  
  62.                 mov     ah,DBh          ;the signature
  63.                 mov     al,FUNC_TYPE    ;the function number
  64.                 mov     bx,Parameter0   ;the first parameter
  65.                 mov     cx,Parameter1   ;the second parameter
  66.                 mov     dx,Parameter2   ;the third parameter
  67.                 mov     si,Parameter3   ;the forth parameter
  68.                 int     2fh             ;
  69.  
  70. ;----------------------------------------------------------------
  71. Function 0      Check if the ZFAX has been resident
  72.  
  73.         Entry   :       AX      = DB00h
  74.         Exit    : if ZFAX is installed
  75.                         AX      = 00DBh
  76.                         ES:BX   = pointer to ZFAX Configure Table (Table D.1)
  77.                   otherwise
  78.                         unknown
  79.  
  80. ;----------------------------------------------------------------
  81. Function 1      Uninstall the ZFAX
  82.  
  83.         Entry   :       AX      = DB01h
  84.         Exit    :       AX      = 0, successful
  85.                         AX      = 1, fail to uninstall, ZFAX is busy right now.
  86.                         AX      = 2, fail to uninstall, other program above.
  87.  
  88. ;----------------------------------------------------------------
  89. Function 10h    Execute the ZFAX MainMenu
  90.  
  91.         Entry   :       AX      = DB10h
  92.  
  93. ;----------------------------------------------------------------
  94. Function 11h    SendFax
  95.  
  96.         Entry   :       AX      = DB11h
  97.                         DS:SI   = pointer to the file name, (include path,
  98.                                         maximum sting length is 128).
  99.                         DS:BX   = pointer to the remote fax number.
  100.         Exit    :       AX      = ErrCode (see Table D.2)
  101.  
  102. ;----------------------------------------------------------------
  103. Function 12h    PrintFax
  104.  
  105.         Entry   :       AX      = DB12h
  106.                         DS:SI   = pointer to the file name, (include path,
  107.                                         maximum sting length is 128).
  108.         Exit    :       AX      = ErrCode (see Table D.2)
  109.  
  110.  
  111. ;----------------------------------------------------------------
  112. Function 13h    ConvertFax
  113.  
  114.         Entry   :       AX      = DB13h
  115.                         DS:SI   = pointer to the source file name, (include
  116.                                         path, maximum sting length is 128).
  117.                         DS:BX   = pointer to the dest file name, (include
  118.                                         path, maximum sting length is 80).
  119.                         CX      = dest file format.
  120.                                         0=FAX, 1=PCX, 2=TIFF, 3=PRN
  121.         Exit    :       AX      = ErrCode (see Table D.2)
  122.  
  123. ;----------------------------------------------------------------
  124. Function 14h    ViewFax
  125.  
  126.         Entry   :       AX      = DB14h
  127.                         DS:SI   = pointer to the file name, (include path,
  128.                                         maximum sting length is 128).
  129.         Exit    :       AX      = ErrCode (see Table D.2)
  130.  
  131. ;----------------------------------------------------------------
  132. Function 20h    PollFax
  133.  
  134.         Entry   :       AX      = DB20h
  135.                         DS:SI   = pointer to the remote fax number.
  136.         Exit    :       AX      = ErrCode (see Table D.2)
  137.  
  138. ;----------------------------------------------------------------
  139. Function 21h    SendVoice
  140.  
  141.         Entry   :       AX      = DB21h
  142.                         DS:SI   = pointer to the source file name, (include
  143.                                         path, maximum sting length is 128).
  144.                         DS:BX   = pointer to the remote phone number.
  145.         Exit    :       AX      = ErrCode (see Table D.2)
  146.  
  147. ;----------------------------------------------------------------
  148. Function 22h    Convert Voice File
  149.  
  150.         Entry   :       AX      = DB22h
  151.                         DS:SI   = pointer to the source file name, (include
  152.                                         path, maximum sting length is 128).
  153.                         DS:BX   = pointer to the dest file name, (include
  154.                                         path, maximum sting length is 80).
  155.                         CX      = dest file format.
  156.                                         0=2bit-ADPCM, 1=3bit-ADPCM, 2=VOC
  157.         Exit    :       AX      = ErrCode (see Table D.2)
  158.  
  159. ;----------------------------------------------------------------
  160. Function 23h    Record Voice File
  161.  
  162.         Entry   :       AX      = DB23h
  163.                         DS:SI   = pointer to the dest file name, (include
  164.                                         path, maximum sting length is 128).
  165.                         CX      = record channel
  166.                                         0=Teleco Line, 1=MIC/SPEAKER
  167.                         DX      = voice file format
  168.                                         0=CELP, 1=2bit-ADPCM, 2=3bit-ADPCM
  169.         Exit    :       AX      = ErrCode (see Table D.2)
  170.  
  171.  
  172. ;----------------------------------------------------------------
  173. Function 24h    Play Voice File
  174.  
  175.         Entry   :       AX      = DB24h
  176.                         DS:SI   = pointer to the voice file name, (include
  177.                                         path, maximum sting length is 128).
  178.                         CX      = play channel
  179.                                         0=Teleco Line, 1=MIC/SPEAKER
  180.         Exit    :       AX      = ErrCode (see Table D.2)
  181.  
  182. ;----------------------------------------------------------------
  183. Function 25h    Voice System, Answer the modem by Voice system.
  184.  
  185.         Entry   :       AX      = DB25h
  186.         Exit    :       AX      = ErrCode (see Table D.2)
  187.  
  188. ;----------------------------------------------------------------
  189. Function 26h    DialPhone
  190.  
  191.         Entry   :       AX      = DB26h
  192.                         DS:SI   = pointer to the remote phone number
  193.         Exit    :       AX      = ErrCode (see Table D.2)
  194.  
  195. ;----------------------------------------------------------------
  196. Function 27h    RcvFax, Answer by setting the modem to fax mode.
  197.  
  198.         Entry   :       AX      = DB27h
  199.         Exit    :       AX      = ErrCode (see Table D.2)
  200.  
  201. ;----------------------------------------------------------------
  202. Function 28h    RcvFaxData, Answer by setting the modem to Multi-Auto mode
  203.  
  204.         Entry   :       AX      = DB28h
  205.         Exit    :       AX      = ErrCode (see Table D.2)
  206.  
  207. ;----------------------------------------------------------------
  208. Function 40h    Internal Terminal
  209.  
  210.         Entry   :       AX      = DB40h
  211.         Exit    :       AX      = ErrCode (see Table D.2)
  212.  
  213. ;----------------------------------------------------------------
  214. Function 31h    SendData, dial a number and use ZMODEM to upload a file
  215.  
  216.         Entry   :       AX      = DB41h
  217.                         DS:SI   = pointer to the source file name, (include
  218.                                         path, maximum sting length is 128).
  219.                         DS:BX   = pointer to the remote data number.
  220.         Exit    :       AX      = ErrCode (see Table D.2)
  221.  
  222.  
  223.  
  224.                 Table D.1  ZFAX Configuartion Table
  225.  ┌──────────────┬─────┬─────┬─────────────────────────────────────────────────┐
  226.  │ Field ID     │ Pos │ Len │  Field ID description                           │
  227.  ├──────────────┼─────┼─────┼─────────────────────────────────────────────────┤
  228.  │ Version      │   0 │   2 │  Version Number, it is 300h now                 │
  229.  │ Reserved     │   2 │   1 │                                                 │
  230.  │ WorkFpth     │   3 │  70 │  ZFAX working path                              │
  231.  │ EditorShell  │  73 │ 128 │  External Editor Path                           │
  232.  │ ExTermShell  │ 201 │ 128 │  External Terminal Path                         │
  233.  │ RingShell    │ 329 │ 128 │  Ring Shell Path                                │
  234.  │ DosShell     │ 457 │ 128 │  Dos Shell Path                                 │
  235.  │ DataShell    │ 585 │ 128 │  Data Shell Path                                │
  236.  │ ChFpth       │ 713 │  70 │  Chinese Font Path                              │
  237.  │ prn_type     │ 783 │   1 │  Printer Type  (*see PrinterType)               │
  238.  │ prn_port     │ 784 │   1 │  Printer Port  (*see PrnPort)                   │
  239.  │ GraphType    │ 785 │   1 │  Graphics Adapter Type  (*see GraphType)        │
  240.  │ DsplyType    │ 786 │   1 │  Disply Type  (*see DsplyType)                  │
  241.  │ HotScan      │ 787 │   1 │  ZFAX Hot-Key Scan Key                          │
  242.  │ ShiftMsk     │ 788 │   1 │  ZFAX Hot-Key Mask Key                          │
  243.  │ TonePulse    │ 789 │   1 │  Tone/Pulse, 0->Tone, 1->Pulse                  │
  244.  │ CallerID     │ 790 │   1 │  Caller ID, 0->Disable, 1->Enable               │
  245.  │ DistincRing  │ 791 │   1 │  Distinctive Ring, 0->Disable, 1->Enable        │
  246.  │ Ring1Type    │ 792 │   1 │  Normal Ring Answer Type (*see RingType)        │
  247.  │ Ring2Type    │ 793 │   1 │  Ring 1 Answer Type (*see RingType)             │
  248.  │ Ring3Type    │ 794 │   1 │  Ring 2 Answer Type (*see RingType)             │
  249.  │ Ring4Type    │ 795 │   1 │  Ring 3 Answer Type (*see RingType)             │
  250.  │ com_port     │ 796 │   1 │  Modem Com Port  (*see ComPort)                 │
  251.  │ com_volume   │ 797 │   1 │  Modem Speaker Volume (0-7)                     │
  252.  │ com_timer    │ 798 │   1 │  Modem Dial Timer (0-255, unit:sec)             │
  253.  │ UserIO       │ 799 │   2 │  User Defined ComPort I/O Address               │
  254.  │ UserIrq      │ 801 │   1 │  User Defined ComPort IRQ Number                │
  255.  │ InitStr      │ 802 │  81 │  Dial Prefix String                             │
  256.  │ EndStr       │ 883 │  79 │  Dial PostFix String                            │
  257.  │ RingCount    │ 962 │   1 │  AutoAnswer Ring Counter (0-255)                │
  258.  │ RetryCount   │ 963 │   1 │  Dial Busy Retry Counter (0-255)                │
  259.  │ RetryTimer   │ 964 │   1 │  Redial Timer (0-255, unit:sec)                 │
  260.  │ SysPassword  │ 965 │   2 │  System Password                                │
  261.  │ Reserved     │ 967 │   1 │                                                 │
  262.  │ VocCompCfg   │ 968 │   1 │  Voice File Compression Format  (*see VocComp)  │
  263.  │ Voc_DTMF0    │ 969 │   1 │  DTMF 0 Action in Voice System  (*see DTMFType) │
  264.  │ Voc_DTMF1    │ 970 │   1 │  DTMF 1 Action in Voice System  (*see DTMFType) │
  265.  │ Voc_DTMF2    │ 971 │   1 │  DTMF 2 Action in Voice System  (*see DTMFType) │
  266.  │ Voc_DTMF3    │ 972 │   1 │  DTMF 3 Action in Voice System  (*see DTMFType) │
  267.  │ Voc_DTMF4    │ 973 │   1 │  DTMF 4 Action in Voice System  (*see DTMFType) │
  268.  │ Voc_DTMF5    │ 974 │   1 │  DTMF 5 Action in Voice System  (*see DTMFType) │
  269.  │ Voc_DTMF6    │ 975 │   1 │  DTMF 6 Action in Voice System  (*see DTMFType) │
  270.  │ Voc_DTMF7    │ 976 │   1 │  DTMF 7 Action in Voice System  (*see DTMFType) │
  271.  │ Voc_DTMF8    │ 977 │   1 │  DTMF 8 Action in Voice System  (*see DTMFType) │
  272.  │ Voc_DTMF9    │ 978 │   1 │  DTMF 9 Action in Voice System  (*see DTMFType) │
  273.  │ Reserved     │ 979 │   2 │                                                 │
  274.  │ FaxID        │ 981 │  25 │  Local Fax ID showed on the page header         │
  275.  │ FaxDIS       │1006 │  20 │  Local Fax ID sent to remote fax                │
  276.  │ dest_psize   │1026 │   1 │  Fax Page Size (*see PageSize)                  │
  277.  │ dest_res     │1027 │   1 │  Fax Resolution (*see PageRes)                  │
  278.  │ dest_scheme  │1028 │   1 │  Fax Coding Scheme (*see PageCode)              │
  279.  │ text_margin  │1029 │   1 │  Text Left Margin, (0-255, unit:mm)             │
  280.  │ text_insvcnt │1030 │   1 │  Text vertical insertion, (0-20, unit:mm)       │
  281.  │ text_inshcnt │1031 │   1 │  Text horizontal insertion, (0-20, unit:mm)     │
  282.  │ text_max_line│1032 │   1 │  Text Maximum lines per page, (0-255, unit:line)│
  283.  │ text_type    │1033 │   1 │  Text Type to read, 0->ASCII, 1->WordStar       │
  284.  │ ImgBit       │1034 │   1 │  PCX Image Resize, 0->disable, 1->enable        │
  285.  │ AutoPrint    │1035 │   1 │  AutoPrint, 0->disable, 1->enable               │
  286.  │ CoverPage    │1036 │   1 │  CoverPage, 0->disable, 1->enable               │
  287.  │ ZpagFname    │1037 │  81 │  Coverpage Logo file name                       │
  288.  │ Zsender      │1118 │  65 │  Coverpage Sender Name                          │
  289.  │ zcap_enable  │1183 │   1 │  Printer Capture, 0->disable, 1->enable         │
  290.  │ send_imm     │1184 │   1 │  Send Immediately, 0->disable, 1->enable        │
  291.  │ cap_prnport  │1185 │   1 │  Printer port of Printer Capture (*see PrnPort) │
  292.  │ ZcapTimer    │1186 │   1 │  Printer Capture Timer (0-255, unit:sec)        │
  293.  │ HotScan2     │1187 │   1 │  Printer Capture Hot-Key Scan Key               │
  294.  │ ShiftMsk2    │1188 │   1 │  Printer Capture Hot-Key Mask Key               │
  295.  │ DataShellType│1189 │   1 │  DataShell Type (*see DshellType)               │
  296.  │ VideoIOType  │1190 │   1 │  Video I/O Type (*see VdoType)                  │
  297.  │ CtransDigits │1191 │   1 │  Call Transfer Digits (0-9)                     │
  298.  │ RecordTimer  │1192 │   2 │  Voice Recorder Maximum Timer (0-999, unit:sec) │
  299.  ├──────────────┼─────┴─────┴─────────────────────────────────────────────────┤
  300.  │ PrinterType  │ 0 -> EPSON FX (9 pins)                                      │
  301.  │              │ 1 -> EPSON LQ (24 pins)                                     │
  302.  │              │ 2 -> HP Laser Jet II, Letter size                           │
  303.  │              │ 3 -> HP Laser Jet II, Legal size                            │
  304.  │              │ 4 -> HP Laser Jet II, A4 size                               │
  305.  │              │ 5 -> HP Laser Jet III, Letter size                          │
  306.  │              │ 6 -> HP Laser Jet III, Legal size                           │
  307.  │              │ 7 -> HP Laser Jet III, A4 size                              │
  308.  │ PrnPort      │ 0 -> LPT1                                                   │
  309.  │              │ 1 -> LPT2                                                   │
  310.  │              │ 2 -> LPT3                                                   │
  311.  │ GraphType    │ 0 -> AutoDetect                                             │
  312.  │              │ 1 -> VGA                                                    │
  313.  │              │ 2 -> EGA                                                    │
  314.  │              │ 3 -> CGA                                                    │
  315.  │              │ 4 -> Hercules                                               │
  316.  │ DsplyType    │ 0 -> AutoDetect                                             │
  317.  │              │ 1 -> LCD                                                    │
  318.  │              │ 2 -> Color                                                  │
  319.  │              │ 3 -> Mono                                                   │
  320.  │ RingType     │ 0 -> Voice System                                           │
  321.  │              │ 1 -> Fax only                                               │
  322.  │              │ 2 -> Data Shell                                             │
  323.  │              │ 3 -> Ring Shell                                             │
  324.  │              │ 4 -> DOS Shell                                              │
  325.  │              │ 5 -> Ignore                                                 │
  326.  │ VocComp      │ 0 -> CELP, 9600bps (Plus only)                              │
  327.  │              │ 1 -> 2-Bit ADPCM, 19200bps                                  │
  328.  │              │ 2 -> 3-Bit ADPCM, 28800bps                                  │
  329.  │ DTMFType     │ 0 -> No Function                                            │
  330.  │              │ 1 -> Page Operator                                          │
  331.  │              │ 2 -> FaxBack                                                │
  332.  │              │ 3 -> Announcement                                           │
  333.  │              │ 4 -> Call Transfer                                          │
  334.  │              │ 5 -> Receive Fax                                            │
  335.  │              │ 6 -> Receive Data                                           │
  336.  │              │ 7 -> Voice MailBox                                          │
  337.  │              │ 8 -> DOS Shell Out                                          │
  338.  │              │ 9 -> Data Shell Out                                         │
  339.  │ PageSize     │ 0 -> A4 ( 210 X 297mm )                                     │
  340.  │              │ 1 -> B4 ( 250 X 353mm )                                     │
  341.  │              │ 2 -> A3 ( 297 X 420mm )                                     │
  342.  │ PageRes      │ 0 -> Normal Res.(3.85 pixels/mm)                            │
  343.  │              │ 1 -> High Res.(7.7 pixels/mm)                               │
  344.  │ PageCode     │ 0 -> 1-D, Modified Huffman Coding                           │
  345.  │              │ 1 -> 2-D, Modified READ Coding                              │
  346.  │ DshellType   │ 0 -> Internal Zmodem                                        │
  347.  │              │ 1 -> Data Shell                                             │
  348.  │              │ 2 -> Disable                                                │
  349.  │ VdoType      │ 0 -> AutoDetect                                             │
  350.  │              │ 1 -> Use BIOS                                               │
  351.  │              │ 2 -> Direct Access                                          │
  352.  └──────────────┴─────────────────────────────────────────────────────────────┘
  353.  
  354.  
  355.                        Table D.2  ZFAX Error Code
  356.             ┌───────────────┬─────┬───────────────────────────┐
  357.             │  Error Code   │ EQU │  Remark                   │
  358.             ├───────────────┼─────┼───────────────────────────┤
  359.             │ ERR_NONE      │ 0   │ OK                        │
  360.             │ ERR_DOSFUNC   │ 1   │ Invalid dos function      │
  361.             │ ERR_NOFILE    │ 2   │ file not found            │
  362.             │ ERR_NOPATH    │ 3   │ path not found            │
  363.             │ ERR_NOHANDLE  │ 4   │ no handle available       │
  364.             │ ERR_DOSACCESS │ 5   │ access denied by dos      │
  365.             │ ERR_HANDLE    │ 6   │ invalid handle            │
  366.             │ ERR_DISKFULL  │ 7   │ disk full                 │
  367.             │ ERR_PRINTER   │ 10h │ printer error             │
  368.             │ ERR_NOGRAFONT │ 11h │ no graph font             │
  369.             │ ERR_FAXFONT   │ 12h │ no zfax font              │
  370.             │ ERR_DCDOFF    │ 20h │ DCD drop while sending    │
  371.             │ ERR_NOTZYXEL  │ 21h │ not zyxel modem           │
  372.             │ ERR_BUSY      │ 22h │ busy                      │
  373.             │ ERR_COMERR    │ 23h │ no response from com port │
  374.             │ ERR_CARRIER   │ 24h │ no carrier                │
  375.             │ ERR_DIALTONE  │ 25h │ no dial tone              │
  376.             │ ERR_NOANSWER  │ 26h │ no answerer               │
  377.             │ ERR_NORESP    │ 27h │ no response               │
  378.             │ ERR_SENDFAIL  │ 28h │ fail to send fax          │
  379.             │ ERR_USRABT    │ 30h │ user abort                │
  380.             │ ERR_CRITDISK  │ 40h │ critical error on disk    │
  381.             │ ERR_ARGUMENT  │ 50h │ argument error            │
  382.             └───────────────┴─────┴───────────────────────────┘
  383.  
  384.  
  385. Appendix E
  386. ZFAX 3.12 File Format List
  387.  
  388.  E.1 .FAX file format
  389.  -------------------------
  390.         For the .FAX format, the *.fax file contains a file header and
  391.  a CCITT T.4 compressed fax data. The header is a 16-byte data, they are
  392.         Bytes 0 - 4 : title  -> "ZyXEL"
  393.         Byte  5     : 0
  394.         Byte  6 - 7 : version number
  395.         Byte  8 - 9 : reserved
  396.         Bytes 10-11 : Page scan width, A4=1728, B4=2048, A3=2432.
  397.         Bytes 12-13 : page count, pages number in this file, the page is
  398.                         seperated by the RTC code.
  399.         Bytes 14-15 : Resolution and coding scheme,
  400.                         0 - 1-D Normal
  401.                         1 - 1-D High
  402.                         2 - 2-D Normal
  403.                         3 - 2-D High
  404.  
  405.         The T.4 fax data is just the data received from U1496 Modem/Fax.
  406.  You can get the compress/decompress scheme from the CCITT blue book, or
  407.  you can obtain some information from the TIFF standard documents.
  408.  
  409.                         Table E.1  FAX File Format
  410.     ┌───────────────┬────────────┬────────┬────────┬──────┬──────────────────┐
  411.     │ Record ID     │ Field ID   │ name   │ length │ pos  │ remark           │
  412.     ├───────────────┼────────────┼────────┼────────┼──────┼──────────────────┤
  413.     │ header        │ title      │ TITLE  │ 5      │  0   │ "ZyXEL"          │
  414.     │               │            │        │ 1      │  5   │ 0                │
  415.     │               │ Version    │        │ 2      │  6   │ 0300H            │
  416.     │               │ reserved   │        │ 2      │  8   │ 0                │
  417.     │               │ page width │ PGWIDTH│ 2      │ 10   │                  │
  418.     │               │ page count │ PAGECNT│ 2      │ 12   │                  │
  419.     │               │ coding     │ CODING │ 2      │ 14   │ 0 : 1-DN         │
  420.     │               │            │        │        │      │ 1 : 1-DH         │
  421.     │               │            │        │        │      │ 2 : 2-DN         │
  422.     │               │            │        │        │      │ 3 : 2-DH         │
  423.     │               │            │        │─────   │      │                  │
  424.     │               │            │ FH     │ 16     │      │                  │
  425.     ├───────────────┼────────────┴────────┴────────┴──────┴──────────────────┤
  426.     │ Fax data      │   The data format of the following data is for         │
  427.     │               │   CCITT T.4 compression scheme.                        │
  428.     └───────────────┴────────────────────────────────────────────────────────┘
  429.  
  430.  
  431.  E.2 ZFAX Voice file format
  432.  --------------------------------
  433.  
  434.         The ZFAX voice file contains a file header and compressed voice data,
  435.  The header is a 16-byte data, they are
  436.  
  437.         Bytes 0 - 4 : title  -> "ZyXEL"
  438.         Byte  5     : 2
  439.         Byte  6 - 7 : version number
  440.         Byte  8 - 9 : reserved
  441.         Bytes 10-11 : compressed voice format, 0->CELP, 1->2-Bit, 2->3-Bit
  442.         Bytes 12-15 : reserved
  443.  
  444.                         Table E.2  ZFAX Voice File Format
  445.     ┌───────────────┬────────────┬────────┬────────┬──────┬──────────────────┐
  446.     │ Record ID     │ Field ID   │ name   │ length │ pos  │ remark           │
  447.     ├───────────────┼────────────┼────────┼────────┼──────┼──────────────────┤
  448.     │ header        │ title      │ TITLE  │ 5      │  0   │ "ZyXEL"          │
  449.     │ offset:0      │            │        │ 1      │  5   │ 2                │
  450.     │               │ Version    │        │ 2      │  6   │ 0300H            │
  451.     │               │ reserved   │        │ 2      │  8   │                  │
  452.     │               │ Compressed │        │ 2      │ 10   │                  │
  453.     │               │ reserved   │        │ 4      │ 12   │                  │
  454.     │               │            │        │─────   │      │                  │
  455.     │               │            │ FH     │ 16     │      │                  │
  456.     ├───────────────┼────────────┴────────┴────────┴──────┴──────────────────┤
  457.     │ voc data      │   The data format of the following data is for         │
  458.     │               │   ZyXEL Voice Compression Scheme.                      │
  459.     └───────────────┴────────────────────────────────────────────────────────┘
  460.  
  461.  
  462.  
  463.  E.3 ZFAX LOG file format
  464.  ------------------------
  465.         Zfax log file contains a file header and the fax log data. The header
  466.  is a 16-byte data, they are :
  467.  
  468.                         Table E.3  ZFAX Log File Format
  469.     ┌───────────────┬──────┬──────┬──────────────────────────────────────────┐
  470.     │ Record ID     │ pos  │  len │     Remark                               │
  471.     ├───────────────┼──────┼──────┼──────────────────────────────────────────┤
  472.     │ header        │   0  │   5  │ "ZyXEL"                                  │
  473.     │               │   5  │   1  │ 4                                        │
  474.     │               │   6  │   2  │ 0300H                                    │
  475.     │               │   8  │   2  │ reserved                                 │
  476.     │               │  10  │   2  │ RecCnt                                   │
  477.     │               │  12  │   4  │ Reserved                                 │
  478.     │ logbuf_year   │  16  │   2  │                                          │
  479.     │ logbuf_date   │  18  │   2  │                                          │
  480.     │ logbuf_time   │  20  │   2  │                                          │
  481.     │ logbuf_ext    │  22  │   2  │ extension number                         │
  482.     │ logbuf_type   │  24  │   2  │ 0->faxin, 1->faxout, 2->vocmsg           │
  483.     │ logbuf_status │  26  │   2  │ 0->normal, 1->remote delete              │
  484.     │ logbuf_fname  │  28  │ 129  │ file name                                │
  485.     │ logbuf_cid    │ 157  │  20  │ caller ID                                │
  486.     │ logbuf_faxnum │ 177  │  50  │ faxnumber                                │
  487.     │ logbuf_faxcid │ 227  │  20  │ remote fax ID                            │
  488.     │ ErrLvl        │ 247  │   2  │ error code                               │
  489.     │ ConnDir       │ 249  │   2  │                                          │
  490.     │ ConnMin       │ 251  │   1  │ Connection Minutes                       │
  491.     │ ConnSec       │ 252  │   1  │ Connection Seconds                       │
  492.     │ ConnSpeed     │ 253  │   2  │ Connection Speed                         │
  493.     │ ConnPage      │ 255  │   2  │ Connection Page Number                   │
  494.     │ ConnCode      │ 257  │   2  │ Connection Coding scheme                 │
  495.     │ ConnPageCnt   │ 259  │   2  │                                          │
  496.     └───────────────┴──────┴──────┴──────────────────────────────────────────┘
  497.  
  498.  
  499.  E.4 ZFAX Schedule file format
  500.  -----------------------------
  501.         Zfax schedule file contains a file header and the fax log data. The
  502.  header is a 16-byte data, they are :
  503.  
  504.                         Table E.3  ZFAX Log File Format
  505.     ┌───────────────┬──────┬──────┬──────────────────────────────────────────┐
  506.     │ Record ID     │ pos  │  len │     Remark                               │
  507.     ├───────────────┼──────┼──────┼──────────────────────────────────────────┤
  508.     │ header        │   0  │   5  │ "ZyXEL"                                  │
  509.     │               │   5  │   1  │ 3                                        │
  510.     │               │   6  │   2  │ 0300H                                    │
  511.     │               │   8  │   2  │ 0                                        │
  512.     │               │  10  │   2  │ Record Count                             │
  513.     │               │  12  │   4  │ Reserved                                 │
  514.     │ schbuf_year   │  16  │   2  │                                          │
  515.     │ schbuf_date   │  18  │   2  │                                          │
  516.     │ schbuf_time   │  20  │   2  │                                          │
  517.     │ schbuf_type   │  22  │   1  │                                          │
  518.     │ schbuf_fname  │  23  │ 129  │                                          │
  519.     │ schbuf_faxnum │ 152  │  51  │                                          │
  520.     │ schbuf_cpage  │ 203  │   1  │                                          │
  521.     │ schbuf_from   │ 204  │  65  │                                          │
  522.     │ schbuf_to     │ 269  │  65  │                                          │
  523.     │ schbuf_cc     │ 334  │  65  │                                          │
  524.     │ schbuf_sb     │ 399  │  65  │                                          │
  525.     └───────────────┴──────┴──────┴──────────────────────────────────────────┘
  526.  
  527. Appendix F
  528. ZFAX 3.12 Text script command
  529. -----------------------------
  530.  
  531.         ZFAX text decoder accepts the following command which start with a
  532.  ~ character. Make sure the ~ char begins at the first char of each line.
  533.  
  534.  ~Xn : horizontal character space, n=1,2,...9.
  535.  
  536.  ~Ln : Vertical line space, n=1,2,...99.
  537.  
  538.  ~Wn : Horizontal magnification, n=1,2..., magnify ratio.
  539.  
  540.  ~Zn : Vertical magnification, n=1,2..., magnify ratio.
  541.  
  542.  ~Fpath : include file name, this command makes you to insert logo, image
  543.           file, signature, or another text in a text file. For instance,
  544.           you can have a signature when ending a letter as :
  545.  
  546.                         Sincerely,
  547.                         ~FTomsig.fax
  548.                         Tom Chen.
  549.  
  550.           Where "path" is the file name with path and "Tomsig.fax" is a file
  551.           name of a signature.
  552.  
  553.  ~P : ZFAX will start another page after this command.
  554.  
  555.