close
Openser 網路電話伺服器Linux下安裝記錄

Openser 網路電話伺服器Linux下安裝記錄---我96.7辛苦爬行的痕跡

Linux pc.er 2.6.23.15-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i686 i386 GNU/Linux
一、利用yum安裝openser # yum install openser*
openser-1.3.2-2.fc7

二、修改  /etc/openser/openserctlrc 大部分的 '#' 都被我拿掉了

三、建立資料庫
[root@pc openserctl]# openserdbctl create
INFO: test server charset
INFO: creating database openser ...
/usr/lib/openser/openserctl/openserdbctl.mysql: line 155: /usr/share/openser//mysql/#-create.sql: 沒有此一檔案或目錄
ERROR: Creating core tables failed!

看一下/usr/lib/openser/openserctl /openserdbctl.mysql: line 155
for TABLE in $STANDARD_MODULES; do
        mdbg "Creating core table: $TABLE"
        sql_query $1 < $DB_SCHEMA/$TABLE-create.sql
        if [ $? -ne 0 ] ; then
                merr "Creating core tables failed!"
                exit 1
        fi
done

再去看/etc/openser/openserctlrc原來這行的 '#'沒有拿乾淨,把資料庫刪了重新執行。
STANDARD_MODULES="standard acc lcr domain group permissions registrar usrloc msilo
#                   alias_db uri_db speeddial avpops auth_db pdt dialog dispatcher"

[root@pc openser]# openserdbctl create
INFO: test server charset
INFO: creating database openser ...
INFO: Core OpenSER tables succesfully created.
Install presence related tables? (y/n): y
INFO: creating presence tables into openser ...
INFO: Presence tables succesfully created.
Install tables for imc cpl siptrace domainpolicy carrierroute? (y/n): y
INFO: creating extra tables into openser ...
INFO: Extra tables succesfully created.
Install SERWEB related tables? (y/n): y
INFO: creating serweb tables into openser ...

                  WARNING                       

 1. There was a default admin user created:     
    username: admin@pc.er
    password: openserrw

 Please change this password or remove this user
 from the subscriber and admin_privileges table.

 2. Make sure to set HAS_SERWEB=yes in your   
    openserctlrc file (default: /etc/openser/)  

INFO: SERWEB tables succesfully created.
有四十三個表。

四、修改 /etc/openser/openser.cfg 拿掉註解
loadmodule "mysql.so"
loadmodule "auth.so"
loadmodule "auth_db.so"

modparam("usrloc", "db_mode",   2)

modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",  "mysql://openser:openserrw@localhost/openser")
modparam("auth_db", "load_credentials", "")

                # authenticate the REGISTER requests (uncomment to enable auth)
                if (!www_authorize("ip196051.ntcu.edu.tw", "subscriber"))
                {
                        www_challenge("ip196051.ntcu.edu.tw", "0");
                        exit;
                }

                if (!check_to())
                {
                        sl_send_reply("403","Forbidden auth ID");
                        exit;
                }

五、啟動測試
[root@pc ~]# service openser start
正在啟動 openser:                                          [  確定  ]

六、 加入使用者
格式 openserctl  add
[root@pc ~]# openserctl  add U0 123456 U0@ip196051.ntcu.edu.tw
new user 'U0' added

修改密碼
[root@pc ~]# openserctl passwd U1 512656
INFO: password change succeeded

移 除使用者
[root@pc ~]# openserctl rm U1

直接翻看資料庫,表名為'subscriber'
[root@pc ~]# openserctl db show subscriber

實機測通軟體話機即ok!

有關 openserctl 的指令 http://linux.die.net/man/8/openserctl

完整連結 http://note.tc.edu.tw/392.html

arrow
arrow

    Johnson峰 發表在 痞客邦 留言(0) 人氣()