投げ銭

★当サイトへの投げ銭(PayPal)★

LINK


(無償、寄付歓迎) logo
世界中で使われるISO標準オフィスソフト(MSオフィス互換)

★LibreOfficeの導入事例★
詳細について

人気の投稿(1ヶ月間)

Ad

Ad

投げ銭

★当サイトへの投げ銭(PayPal)★

2010年5月17日月曜日

【Linux CentOS5.4】 hylafax-IAXmodem-Asteriskの連携によるFAX送受信の準備

(これは古い情報です。)

CentOSバージョン5.7に、iaxmodem-1.2.0と、hylafax-6.0.5をインストールする新しい手順は、こちらです。
http://akira-arets.blogspot.com/2011/09/linux-centos56-iaxmodemhylafax.html


◆hylafax-IAXmodem-Asteriskの連携によるFAX送受信の準備


■インストールのための下準備・・・

[root@localhost]# yum clean all 
[root@localhost]# yum update -y

[root@localhost]# yum install gcc gcc-c++


■IAXmodemインストールのための準備
[root@localhost]# yum info libjpeg libjpeg-devel libtiff libtiff-devel
Loaded plugins: fastestmirror, kmod
Loading mirror speeds from cached hostfile
 * addons: ftp.yz.yamagata-u.ac.jp
 * base: ftp.yz.yamagata-u.ac.jp
 * extras: ftp.yz.yamagata-u.ac.jp
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: ftp.yz.yamagata-u.ac.jp
Installed Packages
Name       : libjpeg
Arch       : i386
Version    : 6b
Release    : 37
Size       : 267 k
Repo       : installed
Summary    : JPEG 画像形式のファイルを操作するためのライブラリ
URL        : http://www.ijg.org/
License    : distributable
Description: The libjpeg package contains a library of functions for manipulating
           : JPEG images, as well as simple client programs for accessing the
           : libjpeg functions.  Libjpeg client programs include cjpeg, djpeg,
           : jpegtran, rdjpgcom and wrjpgcom.  Cjpeg compresses an image file into
           : JPEG format.  Djpeg decompresses a JPEG file into a regular image
           : file.  Jpegtran can perform various useful transformations on JPEG
           : files.  Rdjpgcom displays any text comments included in a JPEG file.
           : Wrjpgcom inserts text comments into a JPEG file.

Name       : libtiff
Arch       : i386
Version    : 3.8.2
Release    : 7.el5_3.4
Size       : 723 k
Repo       : installed
Summary    : TIFF 形式画像ファイルを操作するための関数のライブラリ
URL        : http://www.remotesensing.org/libtiff/
License    : libtiff
Description: The libtiff package contains a library of functions for manipulating
           : TIFF (Tagged Image File Format) image format files.  TIFF is a widely
           : used file format for bitmapped images.  TIFF files usually end in the
           : .tif extension and they are often quite large.
           :
           : The libtiff package should be installed if you need to manipulate TIFF
           : format image files.

Available Packages
Name       : libjpeg-devel
Arch       : i386
Version    : 6b
Release    : 37
Size       : 105 k
Repo       : base
Summary    : libjpeg ライブラリを使用するプログラム用の開発ツール
URL        : http://www.ijg.org/
License    : distributable
Description: The libjpeg-devel package includes the header files and static libraries
           : necessary for developing programs which will manipulate JPEG files using
           : the libjpeg library.
           :
           : If you are going to develop programs which will manipulate JPEG images,
           : you should install libjpeg-devel.  You'll also need to have the libjpeg
           : package installed.

Name       : libtiff-devel
Arch       : i386
Version    : 3.8.2
Release    : 7.el5_3.4
Size       : 465 k
Repo       : base
Summary    : libtiff ライブラリを使用するプログラム用の開発ツール
URL        : http://www.remotesensing.org/libtiff/
License    : libtiff
Description: This package contains the header files and documentation necessary for
           : developing programs which will manipulate TIFF format image files
           : using the libtiff library.
           :
           : If you need to develop programs which will manipulate TIFF format
           : image files, you should install this package.  You'll also need to
           : install the libtiff package.

[root@localhost]# yum install libjpeg libjpeg-devel libtiff libtiff-devel
Complete!
[root@localhost libiax2]# yum install ghostscript ghostscript-devel ghostscript-fonts sox
Complete!


■IAXmodemソースをダウンロードし、インストールする

[root@localhost iaxmodem]# wget http://downloads.sourceforge.net/projec/iaxmodem/iaxmodem/iaxmodem-1.2.0/iaxmodem-1.2.0.tar.gz
長さ: 3075769 (2.9M) [application/x-gzip]
2010-05-17 02:06:19 (1.17 MB/s) - `iaxmodem-1.2.0.tar.gz' へ保存完了 [3075769/3075769]

[root@localhost iaxmodem]# tar zxvf iaxmodem-1.2.0.tar.gz

□ライブラリのインストール
[root@localhost iaxmodem]# cd iaxmodem-1.2.0/lib/libiax2
[root@localhost libiax2]# ./configure
[root@localhost libiax2]# make
[root@localhost libiax2]# make install
Libraries have been installed in:
   /usr/local/lib   →ライブラリがこのディレクトリに生成
□ 生成されたライブラリが入っているディレクトリへのリンクを作成

[root@localhost libiax2]# echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
[root@localhost spandsp]# /sbin/ldconfig -v
/usr/lib/qt-3.3/lib:
        libqui.so.1 -> libqui.so.1.0.0
        libqt-mt.so.3 -> libqt-mt.so.3.3.6
/usr/local/lib:
        libiax.so.0 -> libiax.so.0.0.0

□もうひとつインストールする
[root@localhost libiax2]# cd ..
[root@localhost lib]# cd
libiax2/ spandsp/
[root@localhost lib]# cd spandsp/
[root@localhost spandsp]# ./configure
[root@localhost spandsp]# make install

□本体のインストール
[root@localhost spandsp]# cd ..
[root@localhost lib]# cd ..
[root@localhost iaxmodem-1.2.0]# ./build
[root@localhost iaxmodem-1.2.0]# cp -p iaxmodem /usr/local/sbin/  ・・・生成されたプログラムを適当な場所へコピー


[root@localhost iaxmodem-1.2.0]# mkdir /etc/iaxmodem   ・・・設定ファイルを置くディレクトリの作成
[root@localhost iaxmodem-1.2.0]# ls
CHANGES      TODO     config.ttyIAX        iaxmodem.1            iaxmodem.init.fedora
FAQ          VERSION  configure            iaxmodem.c            iaxmodem.init.suse
Makefile.in  build    iaxmodem             iaxmodem.inf          lib
README       compat   iaxmodem-cfg.ttyIAX  iaxmodem.init.debian  termpkg-ttydforfax.patch
[root@localhost iaxmodem-1.2.0]# cp -p iaxmodem-cfg.ttyIAX /etc/iaxmodem/ttyIAX ・・・設定ファイルをコピー


□デフォルト設定ファイルの確認
[root@localhost iaxmodem-1.2.0]# cat /etc/iaxmodem/ttyIAX
device          /dev/ttyIAX
owner           uucp:uucp
mode            660
port            4570
refresh         300
server          127.0.0.1
peername        iaxmodem
secret          password
cidname         John Doe
cidnumber       8005551212
codec           slinear
★もし、複数のIAXmodemをインスタンス化したいなら、
必要なインスタンス数分、名前を変えて上のコンフィギュレーションファイルをコピーし、
さらに、それぞれ区別できるよう内容を書き換える。
下にあげた二項目については、各互いに異なるように設定する。
device          /dev/ttyIAX ←ttyIAX_01などのように異なる番号をつけ区別する
peername        iaxmodem ←ASTERISKのiax.confの[デバイス定義]と1対1の関係にあるようにする

これらの設定は、IAXmodemが起動されたときに反映される。

□自動起動させるための設定

[root@localhost iaxmodem-1.2.0]# cp -p iaxmodem.init.fedora /etc/init.d/iaxmodem
[root@localhost iaxmodem-1.2.0]# chmod +x /etc/init.d/iaxmodem
[root@localhost iaxmodem-1.2.0]# chkconfig --add iaxmodem
[root@localhost iaxmodem-1.2.0]# chkconfig iaxmodem on
[root@localhost iaxmodem-1.2.0]# chkconfig --list | grep iaxmodem
iaxmodem        0:off   1:off   2:on    3:on    4:on    5:on    6:off

□ログ用ファイルを置く
[root@localhost iaxmodem-1.2.0]# mkdir /var/log/iaxmodem
[root@localhost iaxmodem-1.2.0]# touch /var/log/iaxmodem/iaxmodem


□IAXmodemを起動する
[root@localhost iaxmodem-1.2.0]# service iaxmodem start
IAXmodem を起動中:                                         [  OK  ]
[root@localhost iaxmodem-1.2.0]# ls /dev/ | grep ttyIAX
ttyIAX    ・・・デバイスが作成されている
★前述したように複数のIAXmodemがインスタンス化されるように設定した場合は、
ここで異なる名前の複数のデバイスを見ることになる。



■hylafaxのインストール

○必要なモノをインストールしておく
[root@localhost iaxmodem-1.2.0]# yum install mgetty-voice  ・・・vgettyというプログラムがインストールされる
=============================================================================================================
 Package                      Arch                 Version                        Repository            Size
=============================================================================================================
Installing:
 mgetty-voice                 i386                 1.1.33-9.fc6                   base                 446 k

Transaction Summary
=============================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 446 k
Is this ok [y/N]: y
Downloading Packages:
mgetty-voice-1.1.33-9.fc6.i386.rpm                                                    | 446 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : mgetty-voice                                                                          1/1

Installed:
  mgetty-voice.i386 0:1.1.33-9.fc6
[root@localhost iaxmodem-1.2.0]# ls /sbin/vgetty  ・・・インストールされたvgettyのパスを確認する
/sbin/vgetty

[root@localhost hylafax-6.0.4]# yum install zlib-devel  ・・・これがなければconfigureでエラーが出る

○hylafaxのソースをダウンロードしてインストールする
[root@localhost iaxmodem-1.2.0]# cd ~
[root@localhost ~]# cd tmp
[root@localhost tmp]# mkdir hylafx
[root@localhost tmp]# cd hylafx/
[root@localhost hylafx]# wget ftp://ftp.hylafax.org/source/hylafax-6.0.4.tar.gz
[root@localhost hylafx]# tar xvfz hylafax-6.0.4.tar.gz
[root@localhost hylafx]# cd hylafax-6.0.4
[root@localhost hylafax-6.0.4]# ./configure

質問事項があり、そのうちいくつかを設定しなおす


HylaFAX configuration parameters (part 1 of 2) are:

[ 1] Directory for applications:        /usr/local/bin
[ 2] Directory for lib data files:      /usr/local/lib/fax
[ 3] Directory for lib executables:     /usr/local/sbin
[ 4] Directory for system apps:         /usr/local/sbin
[ 5] Directory for manual pages:        /usr/local/man
[ 7] Directory for spooling:            /var/spool/hylafax
[ 8] Directory for uucp lock files:     /var/lock
[ 9] Uucp lock file scheme:             ascii
[10] PostScript imager package:         gs
[11] PostScript imager program:         /usr/bin/gs
[12] Manual page installation scheme:   bsd-source-cat
[13] Default page size:                 North American Letter
[14] Default vertical res (lpi):        98

Are these ok [yes]? 13
Default page size [North American Letter]? A4

HylaFAX configuration parameters (part 1 of 2) are:

[ 1] Directory for applications:        /usr/local/bin
[ 2] Directory for lib data files:      /usr/local/lib/fax
[ 3] Directory for lib executables:     /usr/local/sbin
[ 4] Directory for system apps:         /usr/local/sbin
[ 5] Directory for manual pages:        /usr/local/man
[ 7] Directory for spooling:            /var/spool/hylafax
[ 8] Directory for uucp lock files:     /var/lock
[ 9] Uucp lock file scheme:             ascii
[10] PostScript imager package:         gs
[11] PostScript imager program:         /usr/bin/gs
[12] Manual page installation scheme:   bsd-source-cat
[13] Default page size:                 ISO A4
[14] Default vertical res (lpi):        98

Are these ok [yes]? 14
Default vertical res (lpi) [98]? 196

HylaFAX configuration parameters (part 1 of 2) are:

[ 1] Directory for applications:        /usr/local/bin
[ 2] Directory for lib data files:      /usr/local/lib/fax
[ 3] Directory for lib executables:     /usr/local/sbin
[ 4] Directory for system apps:         /usr/local/sbin
[ 5] Directory for manual pages:        /usr/local/man
[ 7] Directory for spooling:            /var/spool/hylafax
[ 8] Directory for uucp lock files:     /var/lock
[ 9] Uucp lock file scheme:             ascii
[10] PostScript imager package:         gs
[11] PostScript imager program:         /usr/bin/gs
[12] Manual page installation scheme:   bsd-source-cat
[13] Default page size:                 ISO A4
[14] Default vertical res (lpi):        196

Are these ok [yes]?

HylaFAX configuration parameters (part 2 of 2) are:

[15] Location of getty program:         /sbin/agetty
[16] Location of voice getty program:   /bin/vgetty
[17] Location of sendmail program:      /usr/sbin/sendmail
[18] Location of TIFF tools:            /usr/bin
[19] Location of SysV init scripts:     /etc/rc.d/init.d
[20] Location of SysV start scripts:    ../rc2.d ../rc3.d ../rc4.d ../rc5.d
[21] Location of SysV stop scripts:     ../rc0.d ../rc1.d ../rc6.d
[22] Name of SysV start script:         S97hylafax
[23] Name of SysV stop script:          K05hylafax
[24] Init script starts faxq:           yes
[25] Init script starts hfaxd           yes
[26] Start paging protocol:             no
Are these ok [yes]? 16
Location of vgetty program [/bin/vgetty]? /sbin/vgetty  ・・・vgettyのパス設定(前述)

HylaFAX configuration parameters (part 2 of 2) are:

[15] Location of getty program:         /sbin/agetty
[16] Location of voice getty program:   /sbin/vgetty
[17] Location of sendmail program:      /usr/sbin/sendmail
[18] Location of TIFF tools:            /usr/bin
[19] Location of SysV init scripts:     /etc/rc.d/init.d
[20] Location of SysV start scripts:    ../rc2.d ../rc3.d ../rc4.d ../rc5.d
[21] Location of SysV stop scripts:     ../rc0.d ../rc1.d ../rc6.d
[22] Name of SysV start script:         S97hylafax
[23] Name of SysV stop script:          K05hylafax
[24] Init script starts faxq:           yes
[25] Init script starts hfaxd           yes
[26] Start paging protocol:             no
Are these ok [yes]?


Done.
[root@localhost hylafax-6.0.4]# make     ・・・時間がかかる(5分近く)
[root@localhost hylafax-6.0.4]# make install


○セットアップを行う
[root@localhost hylafax-6.0.4]#/usr/local/sbin/faxsetup

・・・yumをつかってhylafaxをインストールしていたためか、なぜか特にせっていすることなく終了


○コンフィグファイルを確認する
[root@localhost hylafax-6.0.4]# cat /var/spool/hylafax/etc/config
LogFacility:            daemon
CountryCode:            81
AreaCode:               ** ←市外局番から先頭の0をとったものを入れる
LongDistancePrefix:     0
InternationalPrefix:    010 ←国際電話用
DialStringRules:        etc/dialrules
ServerTracing:          1
○ソースを展開しコンパイル作業を行った iaxmodem-1.2.0 ディレクトリから、
IAXmodemを使うための prototype configを持ってくる
[root@localhost iaxmodem-1.2.0]# cp -p ./config.ttyIAX /var/spool/hylafax/etc/config.ttyIAX

★複数のIAXmodemモデムをhylafaxで使うには、
それぞれのIAXmodemが持っている互いに異なるデバイス名を用いてprototype configをコピーすること。
(例)ttyIAX_01とリンクしたmodemに対して、hylafaxの設定ファイルは、/var/spool/hylafax/etc/config.ttyIAX_01とする。

[root@localhost hylafax-6.0.4]# vi /var/spool/hylafax/etc/config.ttyIAX ←モデムがつながったデバイスの名称
# $Id: iaxmodem,v 1.7 2007/11/06 18:44:20 faxguy Exp $

#
# prototype config for the IAXmodem softmodem which uses
# the spandsp soft-DSP library
#

#
CountryCode:            81 ←国際電話での国番号(日本)
AreaCode:               ** ←市外局番から先頭の0をとった番号
FAXNumber:              +81.**.***.**** ←ファックス番号(自局)
LongDistancePrefix:     0
InternationalPrefix:    010  ←国際電話発信用番号
DialStringRules:        etc/dialrules
ServerTracing:          1
SessionTracing:         0xFFF
RecvFileMode:           0600
LogFileMode:            0600
DeviceMode:             0600
RingsBeforeAnswer:      1
SpeakerVolume:          off
GettyArgs:              "-h %l dx_%s"
LocalIdentifier:        ***  ←自局の名称
TagLineFont:            etc/lutRS18.pcf
TagLineFormat:          "From %%l|%c|Page %%P of %%T"
MaxRecvPages:           25
#

#
#
# Modem-related stuff: should reflect modem command interface
# and hardware connection/cabling (e.g. flow control).
#
ModemType:              Class1          # use this to supply a hint

#
#             *** Caller-ID settings ***
#
# Enabling this will use the hfaxd-protocol to set Caller*ID
#
#ModemSetOriginCmd:     "AT+VSID=\"%s\",\"%d\""
#
# If "glare" during initialization becomes a problem then take
# the modem off-hook during initialization, and then place it
# back on-hook when done.
#
#ModemResetCmds:        "ATH1\nAT+VCID=1"       # enables CallID display
#ModemReadyCmds:        ATH0
#
# You'll likely want Caller*ID display (also displays DID) enabled.
#
ModemResetCmds:         AT+VCID=1       # enables CallID display
#
# If you are "missing" Caller*ID data on some calls (but not all)
# and if you do not have adequate glare protection you may want to
# not answer based on RINGs, but rather enable the CallIDAnswerLength
# for NDID, disable AT+VCID=1 and do this:
#
#RingsBeforeAnswer: 0
#ModemRingResponse: AT+VRID=1

# The pty apparently does not support changing parity.
PagerTTYParity:         none

Class1AdaptRecvCmd:     AT+FAR=1
Class1TMConnectDelay:   400             # counteract quick CONNECT response

#
# Older iaxmodem versions didn't support V.17 very well.  It can be
# disabled in this fashion:
#
#Class1RMQueryCmd:      "!24,48,72,96"  # V.17 fast-train recv doesn't work well
#Class1TMQueryCmd:      "!24,48,72,96"  # V.17 fast-train recv doesn't work well

CallIDPattern:          "NMBR="
CallIDPattern:          "NAME="
CallIDPattern:          "ANID="
CallIDPattern:          "NDID="
#CallIDAnswerLength:    4
# Uncomment these if you really want them, but you probably don't.
#CallIDPattern:          "DATE="
#CallIDPattern:          "TIME="


○hylafaxを自動起動させる
[root@localhost hylafax-6.0.4]# chkconfig hylafax on
[root@localhost hylafax-6.0.4]# chkconfig --list | grep hyla
hylafax         0:off   1:off   2:on    3:on    4:on    5:on    6:off

[root@localhost hylafax-6.0.4]# service hylafax restart
Stopping HylaFAX Servers.
HylaFAX: faxq hfaxd (without SNPP support).


○ttyIAXデバイスをfaxgetty(hylafaxに添付されている)に渡す
これをやらなければ、hylafaxがFAXを受信しなかった。
[root@localhost ~]# /usr/local/sbin/faxgetty /dev/ttyIAX &
[1] 3591

★複数のmodemがhylafaxに接続されるなら、各modemのデバイスを同様にfaxgettyに渡す

○ 状態を表示する
[root@localhost ~]# faxstat -s
HylaFAX scheduler on localhost.localdomain: Running ←hylafax ready
Modem ttyIAX (+81.**.***.****): Initializing server  ←Modem ttyIAX  サーバーを初期化中

[root@localhost ~]# faxstat -s
HylaFAX scheduler on localhost.localdomain: Running ←hylafax ready
Modem ttyIAX (+81.**.***.****): Running and idle  ←Modem ttyIAX ready

IAXmodemと、hylafaxの準備は以上で完了



◆試しにhylafaxからファックスを送信してみる 


すでにASTERISKはインストール済みで、外線へのアクセスも可能になっている状態にしておく。
IAXmodemがASTERISKにレジストするので、そのためのデバイスを iax.conf に定義する。


○ASTERISKを設定する

IAXmodemが持つ設定情報は次のとおり。
[root@localhost iaxmodem-1.2.0]# cat /etc/iaxmodem/ttyIAX
device          /dev/ttyIAX
owner           uucp:uucp
mode            660
port            4570
refresh         300
server          127.0.0.1
peername        iaxmodem
secret          password
cidname         John Doe
cidnumber       8005551212
codec           slinear
上の情報に合うように、ASTERISK設定ファイルのiax.confを編集する
[general]
iaxcompat=yes
language=jp
bandwidth=medium
disallow=all
allow=ulaw
allow=slinear
jitterbuffer=no
forcejitterbuffer=no

[iaxmodem]
type=friend
username=iaxmodem
secret=password
host=dynamic
disallow=all
allow=ulaw
allow=slinear
requirecalltoken=no
context=外線につなげられるコンテクスト

IAXmodemからの呼が設定済みの適当なデフォルトコンテクストへ流れるように設定する。

○IAXmodemと、ASTERISKとの接続を確認する
localhost*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status
iaxmodem/iaxmod  127.0.0.1       (D)  255.255.255.255  4570          Unmonitored  ・・・接続された


○上記のように準備が整っていたら、テキストファイルをファクス送信する

[root@localhost ~]# sendfax -n -d デンワ番号  送信するテキストファイル
request id is 1 (group id 1) for host localhost (1 file)

[root@localhost ~]# faxstat -s
HylaFAX scheduler on localhost.localdomain: Running
Modem ttyIAX (+81.**.***.****): Initializing server

JID  Pri S  Owner Number       Pages Dials     TTS Status
1    127 R   root 0*********    0:1   0:12


数十秒後、電話がかかってきました!
そして、指定したテキストファイルがファックス機で印字されてきました。
やっとできた。

○送信済みの処理を表示させる
[root@localhost ~]# faxstat -d
HylaFAX scheduler on localhost.localdomain: Running
Modem ttyIAX (+81.**.***.****): Running and idle

JID  Pri S  Owner Number       Pages Dials     TTS Status
1    127 D   root 0*********    1:1   1:12


<参考>
http://n73.jugem.jp/?eid=10
http://blog.goo.ne.jp/jnana_tomo/e/123f1557e1d3303d15e358f7ed92d3fb


◆ついでに、WINDOWSからファックスを送ってみる

WindowsXPを使用して、hylafax経由でファクスを送る

○リモート接続を許可する、登録済みのリナックスuserをセットする。(当然パスワード設定済み)
[root@localhost hylafax-6.0.4]# faxadduser username


Windowsマシンで作業を行う
○Winprint HylaFAXをダウンロード、インストールを行う


http://www.hylafax.org/content/Related_Software内のリンクに、
http://www.hylafax.org/content/Desktop_Client_Softwareがある。
Winprint HylaFAX: A simple-to-use Windows printer client (2008)をダウンロードし、実行する
インストール終了後は何も表示されない

○プリンタの追加

「プリンタとFAXの追加」で、「プリンタの追加」をクリック
ローカルプリンタを指定

新しいポートの作成(→Winprint HylaFAXを指定する)
PortNameには最初は、HFAX1: が入力されている。(キュー名みたいな識別子なので何でもよい)

プリンタドライバの選択画面で、Appleを選ぶ
ドライバは、LaserWriter 16/600 PS-J を指定する(ポストスクリプトプリンタのこと)

設定したプリンターのプロパティーから「ポートの構成」を開く
HylaFAX Server Addressには、リナックスマシンのアドレスを入力
Usernameと、Passwordは上で設定したものを入力
Address Book Directoryは、アドレスを貯めるファイルをおくディレクトリなので勝手に作って指定する(c:\hylafaxとした)
Page Sizeはデフォルトの用紙の大きさ (A4にした)

○上で指定したAddress Book Directoryにファイルを2つ作成する
c:\hylafax(上の例で)に、names.txt と、numbers.txtという名称の空ファイルを作成しておく


以上で準備完了。


○テストプリントする
あて先のFAX番号を入れて(Save Numberボタンで保存することもできる)、 Sendボタンを押すだけ
Save Numberボタンで保存したものは、Delete Entryボタンで消すことも可能。

送信ボタンを押下直後に、
Job x Submitted という文が書かれた小さなウインドウが開くと同時に処理が進めれる


数秒後、着信しファックスが届いた。

<参考>
http://winprinthylafax.sourceforge.net/


◆FAXを受信する

○ASTERISKでの着信用設定
ASTERISKにおいて、外線からの着信が[fax]コンテクストのエクステンション20に入ってくるとする。

[fax]
exten => 20,1,Dial(IAX2/iaxmodem)   ・・・iaxmodemはiax.confで定義したもの(前述)


○faxgettyに、ttyIAXが渡されていることを確認する
[root@localhost asterisk]# faxstat
HylaFAX scheduler on localhost.localdomain: Running
Modem ttyIAX (+81.**.***.****: Running and idle

渡されていなければ、次のようにコマンドを実行する(前述)
[root@localhost asterisk]# /usr/local/sbin/faxgetty /dev/ttyIAX &


○hylafaxへファックスを送信する

○スプールを確認する
[root@localhost asterisk]# ls /var/spool/hylafax/recvq/
fax000000002.tif  seqf

○受信したファックス文書をpdfファイルに変換し電子メールで送る
[root@localhost asterisk]# vi /var/spool/hylafax/etc/FaxDispatch
SENDTO=me@my.mail.server;
FILETYPE=pdf;

2010年5月6日木曜日

【CentOS5.4】 リモートでパソコンの温度を測る

パソコンの温度を測る


■必要なパッケージをインストール

[root@localhost ~]# yum info lmsensors
Available Packages
Name       : lm_sensors
Arch       : i386
Version    : 2.10.7
Release    : 4.el5
Size       : 513 k
Repo       : base
Summary    : ハードウェア監視アプレット
URL        : http://secure.netroedge.com/~lm78/
License    : GPL
Description: The lm_sensors package includes a collection of modules for general SMBus
           : access and hardware monitoring.  NOTE: this requires special support which
           : is not in standard 2.2-vintage kernels.

[root@localhost ~]# yum install lm_sensors
Installed:lm_sensors.i386 0:2.10.7-4.el5



■温度などの情報を保持しているチップにアクセスするドライバをインストールする

次のコマンドで、自動的にインストールされる。
各質問には、エンターを押していくだけ。
[root@localhost ~]# sensors-detect
# sensors-detect revision 5291 (2008-06-23 23:40:46 -0700)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing
.

We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-viapro' for device 0000:00:11.0: VIA Technologies VT8237 South Bridge

We will now try to load each adapter module in turn.
Module `i2c-viapro' already loaded.
If you have undetectable or unsupported I2C/SMBus adapters, you can have
them scanned by manually loading the modules before running this script.

To continue, we need module `i2c-dev' to be loaded.
Do you want to load `i2c-dev' now? (YES/no):
Module loaded successfully.

We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.

Next adapter: SMBus Via Pro adapter at 0500 (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No

Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no):
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM78-J' at 0x290...     No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No

Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       Yes
Found `Winbond W83697HF/F/HG Super IO Sensors'              Success! ←スーパーセンサー(本当の意味でのセンサーの、ラッパー?)が見つかった。
    (address 0x290, driver `w83627hf')

Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no):
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD K10 thermal sensors...                                  No
Intel AMB FB-DIMM thermal sensor...                         No
↑ソースブリッジや、CPU、メモリにも同様のチップがあるらしいが、使っているマザーボードには見つけられなかったようだ。
Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `w83627hf' (should be inserted):
  Detects correctly:
  * ISA bus, address 0x290
    Chip `Winbond W83697HF/F/HG Super IO Sensors' (confidence: 9)
↑結局、見つけられたのは上記のセンサー。

↓発見できたセンサーや使用するドライバを登録しているのだろう。
Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
lm_sensors を起動中:                                       [  OK  ]


■チップが保持している情報を表示させる

[root@localhost ~]# sensors
w83697hf-isa-0290 ←情報を持っているチップ
Adapter: ISA adapter
VCore:     +0.98 V  (min =  +1.60 V, max =  +0.72 V)       ALARM
+3.3V:     +3.34 V  (min =  +0.67 V, max =  +0.70 V)       ALARM
+5V:       +4.97 V  (min =  +1.10 V, max =  +1.29 V)       ALARM
+12V:     +11.49 V  (min =  +0.18 V, max =  +6.14 V)       ALARM
-12V:     -14.83 V  (min =  +2.20 V, max =  -4.63 V)       ALARM
-5V:       -7.66 V  (min =  +0.33 V, max =  -3.69 V)       ALARM
V5SB:      +5.46 V  (min =  +4.35 V, max =  +0.03 V)       ALARM
VBat:      +3.26 V  (min =  +1.79 V, max =  +2.08 V)       ALARM
fan1:        0 RPM  (min = 2463 RPM, div = 4)              ALARM
fan2:        0 RPM  (min = 168750 RPM, div = 4)              ALARM
temp1:       +63°C  (high =   +73°C, hyst =  +112°C)   sensor = transistor
temp2:     +71.0°C  (high =  +120°C, hyst =  +115°C)   sensor = diode
alarms:
beep_enable:
          Sound alarm enabled

かなり温度が高いのはファンレスパソコンだからだ。でもそれぞれいったいどこの温度なんだろう。
BIOS設定画面で表示される情報と比較すればわかるかもしれない。
ひとつはおそらくCPUだろうと思う。

これから夏に向けて暑くなってくるので放熱が悪くなるため要注意だ。

■自動起動するようにしておく
[root@localhost ~]# chkconfig lm_sensors on

以上

○ちなみに、別マシンでは次のようになっていた。

Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      Yes
Found `ITE IT8716F Super IO Sensors'                        Success!
    (address 0x228, driver `it87')
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No

Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no):
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   Success!
    (driver `k8temp')
AMD K10 thermal sensors...                                  No
Intel Core family thermal sensor...                         No
Intel AMB FB-DIMM thermal sensor...                         No

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `it87' (should be inserted):
  Detects correctly:
  * ISA bus, address 0x228
    Chip `ITE IT8716F Super IO Sensors' (confidence: 9)

Driver `k8temp' (should be inserted):
  Detects correctly:
  * Chip `AMD K8 thermal sensors' (confidence: 9)

↑二つ登場

これらのチップが保持している情報は次のとおり。
[root@server01 ~]# sensors
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp:  +18.0°C
Core0 Temp:  +21.0°C
Core1 Temp:  +20.0°C
Core1 Temp:  +18.0°C

it8716-isa-0228
Adapter: ISA adapter
VCore:       +0.99 V  (min =  +0.00 V, max =  +4.08 V)
VDDR:        +1.22 V  (min =  +0.00 V, max =  +4.08 V)
+3.3V:       +3.36 V  (min =  +0.00 V, max =  +4.08 V)
+5V:         +4.92 V  (min =  +0.00 V, max =  +6.85 V)
+12V:       +12.10 V  (min =  +0.00 V, max = +16.32 V)
in5:         +1.94 V  (min =  +0.00 V, max =  +4.08 V)
in6:         +1.18 V  (min =  +0.00 V, max =  +4.08 V)
5VSB:        +4.81 V  (min =  +0.00 V, max =  +6.85 V)
VBat:        +3.09 V
fan1:       2089 RPM  (min = 3245 RPM)  ALARM
fan2:          0 RPM  (min =    0 RPM)
fan3:          0 RPM  (min =   11 RPM)  ALARM
temp1:       +54.0°C  (low  = +127.0°C, high = +75.0°C)  sensor = thermal diode
temp2:       +41.0°C  (low  = +127.0°C, high = +75.0°C)  sensor = transistor
temp3:       +36.0°C  (low  = +127.0°C, high = +75.0°C)  sensor = thermal diode
cpu0_vid:   +0.750 V

これらも、比較的高い温度を示すがどの部位の温度なのかは、
BIOS設定画面に表示される情報と比較すればわかるかもしれない。

【Linux CentOS5.4】 tftp-serverの利用

tftp-serverをインストールし、利用できるようする。


■インストール
[root@localhost ~]# yum install tftp-server


■コンフィグファイルの修正
[root@localhost ~]# vi /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot   ← /tftpboot がtftpにて公開される
        disable                 = no          ← noにする
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}


■xinetdの再起動
[root@localhost ~]# service xinetd restart

そうすると、tftp-serverがアクティブになる。

ルートディレクトリに/tftpbootが作成されていることを確認し、
tftpで公開するファイルをコピーする。
公開ファイルの所有者はrootでもかまわない。

投げ銭

★当サイトへの投げ銭(PayPal)★

Ad

Ad