自分の現在のネットワーク構成は、複数のYAMAHA RT-58iに電話機を接続して、LAN(VPN)内でIP電話(内線電話として)を利用している。複数の拠点(たとえば、本社と営業所などの複数拠点)に発展した場合に、フレッツグループ(など)を利用したVPNを構築することで、(ビジネス的に)それほど大きな投資を必要とせず、また、そのまま内線電話として使用できるため月々の通話料を必要としないだろう。特に中小企業においては有効な仕組みとして利用できる。
友達同士や、離れた場所に住む親戚家族同士などでも利用できるが、よほど電話を利用する機会が多い場合に考えるべきだと思う。初期投資としての機器購入代金はそれなりに必要となるし、VPNを構築するためのネット接続は、やはり有料だ。VPNを組むことで月額無料のIP電話が構成できるが、それは、ネットワーク環境が(必然的に)整っていることが前提の話。極々一般的な家庭においては、Skypeやメッセンジャー・プログラムを使っていたほうが安上がりとなる。
このページは、あくまでも自己記録という意味で、インストール方法を記載しておく。
%su Password: # cd /usr/ports/databases/mysql50-server # make install clean # rehash
インストールが完了すると、mysqlというユーザが作成される。また、次の起動/終了シェルスクリプトが作られるので、確認しておく。
# vi /etc/rc.conf
/etc/rc.conf の中に次の1行を加える。ファイル末尾でよい。
mysql_enable="YES"
一旦、再起動する。
# reboot
続けて、MySQLのrootパスワードを設定する。
%su Password: # mysqladmin -u root password 設定したいパスワード文字列
# mysql -p Enter password: mysql>select user, host from mysql.user; +------+--------------------------+ | user | host | +------+--------------------------+ | root | 127.0.0.1 | | | localhost | | root | localhost | | | sip.vdobv.com | | root | sip.vdobv.com | +------+--------------------------+ 5 rows in set (0.00 sec) mysql>quit
# mysql -p Enter password: mysql>delete from mysql.user where host != 'localhost'; mysql>delete from mysql.user where user != 'root'; mysql>select user, host from mysql.user; +------+-----------+ | user | host | +------+-----------+ | root | localhost | +------+-----------+ 1 row in set (0.00 sec) mysql>quit
%su Password: # cd /usr/ports/net/ser # make install clean # rehash
インストールが完了すると、次の起動/終了シェルスクリプトが作られるので、確認しておく。
まずは、いつものように、
# vi /etc/rc.conf
/etc/rc.conf の中に次の1行を加える。ファイル末尾でよい。
ser_enable="YES"
/etc/my.cnf が存在しなければコピーする。
# cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf # chmod 644 /etc/my.cnf # vi /etc/my.cnf
[mysqld]セクションの中に次の一文を加える。クライアント接続数の上限だが、ほんの少しの余裕を持って設定しておくとよい。
set-variable = max_connections=100
# cd /root/ # vi .cshrc
次の一行(サーバ自身のドメイン名かIPアドレス)を追加する。
setenv SIP_DOMAIN "192.168.0.100"
# /usr/local/sbin/ser_mysql.sh create MySql password for root: パスワードをタイプする。 Domain (realm) for the default user 'admin': ドメイン名を入力する。
この後、MySQLにログインして、追加されたデータベースを確認することができる。
# mysql -p Enter password: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | ser | | test | +--------------------+ 4 rows in set (0.00 sec) mysql> use ser; Database changed mysql> show tables; +-----------------------+ | Tables_in_ser | +-----------------------+ | acc | | active_sessions | | admin_privileges | | aliases | | calls_forwarding | | config | | domain | | event | | grp | | location | | missed_calls | | pending | | phonebook | | preferences_types | | reserved | | server_monitoring | | server_monitoring_agg | | silo | | speed_dial | | subscriber | | trusted | | uri | | usr_preferences | | version | +-----------------------+ 24 rows in set (0.00 sec) mysql> quit
# vi /usr/local/etc/ser/ser.cfg
下記を参考にして、#!!! の行のコメントを取ったり付けたり。
#
# $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
(中略)
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/mysql.so" #!!!
(中略)
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/ser/modules/auth.so" #!!!
loadmodule "/usr/local/lib/ser/modules/auth_db.so" #!!!
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
###modparam("usrloc", "db_mode", 0) #!!!
# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2) #!!!
# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes) #!!!
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password") #!!!
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{
(中略)
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("iptel.org", "subscriber")) { #!!!
www_challenge("iptel.org", "0"); #!!!
break; #!!!
};
save("location");
break;
};
(中略)
}
(以降省略)
# /usr/local/etc/rc.d/ser start # ps aux | grep ser
# serctl add ユーザ名 パスワード メールアドレス
MySql password: heslo
# serctl passwd ユーザ名 新パスワード
MySql password: heslo
# serctl rm ユーザ名
MySql password: heslo
# mysql -p Enter password: mysql>use ser; mysql>select username, password, email_address from subscriber order by username; +----------+----------+----------------+ | username | password | email_address | +----------+----------+----------------+ | admin | heslo | root@localhost | | testid | testpass | test@vdobv.com | +----------+----------+----------------+ 2 rows in set (0.04 sec) mysql>quit
hesloを別の文字に変更したい場合。ser@'localhost'のパスワードを変更する。
# mysql -p Enter password: mysql>set password for ser@'localhost' = password('abc'); mysql>quit # serctl add ユーザ名 パスワード メールアドレス MySql password: abc