◎ 安裝 FAX 軟體 (mgetty+sendfax)
cd /usr/ports/comm/mgetty
make install clean
◎ 安裝接收傳真處理程序需要套件
ports 路徑
| bg5ps:/usr/ports/chinese/bg5ps/ | bg5ps |
| 文鼎TTF:/usr/ports/chinese/arphicttf/ | bg5ps 需要 bsmi00lp.ttf |
| gs (GhostScript):/usr/ports/print/ghostscript-gnu/ | gs |
| MIME-Lite:/usr/ports/mail/p5-MIME-Lite/ | new_fax |
| 圖檔轉換:/usr/ports/graphics/netpbm/ | pnmscale、ppmtogif、g3topbm |
| samba:/usr/ports/net/samba | Samba Server |
| gcc-3.2.3:/usr/ports/ | make samba |
gcc-3.2.2 → gcc3.2.3
cd /usr/bin
mv gcc gccc
ln -s /usr/local/gcc32 gcc
◎ 待命接收傳真
FreeBSD:mgetty /dev/cuaa0 &
Linux:mgetty /dev/ttyS0 &
◎ 選擇接收傳真處理程序
範例:/usr/local/lib/mgetty+sendfax/samples
選擇完放在 /usr/local/lib/mgetty+sendfax/ 內
怎麼知道要將 new_fax 放在哪個目錄?
#whereis mgetty
mgetty: /usr/local/sbin/mgetty
grep -a new_fax /usr/local/sbin/mgetty
◎ 傳真放在哪裡?
◎ 常駐接收
<<Linux>>
/etc/inittab
f0:35:respawn:/sbin/mgetty -a -F -s 19200 ttyS0
<<FreeBSD>>
/etc/ttys
cuaa1 "/usr/local/sbin/mgetty" unknown on insecure
收到的傳真放在:/var/spool/fax/incoming
格式為 G3,可使用 kfax 或其他軟體觀看,或是轉換成一般圖檔
◎ 怎麼看收到的 fff399d4da1-Fax.01檔案?
收到的傳真也是 G3 格式,所以必須先進行轉檔的動作才能看
g3topbm < $file | pnmtopng > ${file}.png
例:g3topbm < fff399d4da1-Fax.01 | pnmtopng > fax.png
g3topbm < $file | pnmscale -width 800 | ppmtogif > ${file}.gif
例:g3topbm < fff399d4da1-Fax.01 | pnmscale -width 800 | ppmtogif > fax.gif
pnmscale 參數
-width 設定寬度
-height 設定高度
◎ 先發一張純文字的傳真測試吧!
將文字轉換成 ps 格式
#cat test.txt | bg5ps > test.ps
將 ps 格式轉換成傳真所需 g3 格式
#gs -sDEVICE=faxg3 -sOutputfile=test.g3.%D test.ps
#sendfax 9999999 test.g3
◎ 該如何分享給其他使用者 (Samba + printfax.pl + respond)
說明:使用者把傳真當作是列印一樣操作即可。
Server 端
Samba 需開啟 PDC 或是身分認證功能,將相關分享設定完成,smb.conf
Windows 端
設定“工作群組”加入 Samba 的網域中
連接到 Samba 分享出的傳真印表機,新增型號為:“HP LaserJet 4/4M PS”
<<說明>>
目前 Samba 自動複製驅動程式功能還沒測試出,所以必須自行手動選擇
選擇 HP LaserJet 4/4M PS 的原因是我們需要列印的檔案自動轉換為 PostScript 的格式
<</說明>>
執行 RESPOND 常駐接受 5555 呼叫
請使用 root 帳號登入使用傳真
◎ 數據機燈號
HS (High Speed)- 高速指示 9600bps 以上
AA (Auto-Answer)-自動回應
CD (Carrier Detect)- 載波偵測
OH (Off Hook)- 佔線
RD (Receive Date)- 接收資料
TD- 送出資料
TR (Terminal Ready), 傳送資料
MR (Model Ready???), 數據機備妥
DSR (Data Set Ready)- 數據機正常運作
CTS (Clear To Sent)- 數據機接收備妥