[html]
[/html]
2009年7月30日 星期四
2009年7月27日 星期一
Installing NRPE 2.12 from source as a SMF managed service in Solaris 10
Installing NRPE on Solaris 10 involves just a bit more than your normal './configure && make && make install' routine. However, all the dependencies are likely present on a freshly installed system, you just have to tell NRPE where to find it. There's one file you need to patch, and then it will install. From there it's easy to plug into SMF!
First, let's make sure some directories are present, and create our Nagios user:
# mkdir /usr/local
# groupadd nagios
# useradd -m -c "nagios system user" -d /usr/local/nagios -g nagios -m nagios
Next, download and extract the source code to NRPE:
$ cd /tmp/
$ /usr/sfw/bin/wget http://superb-east.dl.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
$ gzip -dc nrpe-2.12.tar.gz | tar -xvf -
$ cd nrpe-2.12
Now, we need to tell the configure script where to find the openssl libraries, and make sure that GCC is in our path:
$ PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin ./configure --with-ssl=/usr/sfw/ --with-ssl-lib=/usr/sfw/lib/
That should run just fine. Before we build, we need to apply a quick fix to nrpe.c. If you don't do this, you'll get an error from make that says "nrpe.c:617: error: 'LOG_AUTHPRIV' undeclared (first use in this function)".
$ perl -pi -e 's/LOG_AUTHPRIV/LOG_AUTH/; s/LOG_FTP/LOG_DAEMON/' src/nrpe.c
Now, we should be okay to build it:
$ PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin make
Then, install it as root:
# PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin make install
Either copy the nrpe.cfg sample included in the source code, or drop your own into /usr/local/nagios/etc/nrpe.cfg. Now, stay logged in as root for the following, now we'll get NRPE setup to run under SMF.
First, we need to setup the service and present it to inetd:
echo "nrpe 5666/tcp # NRPE" >> /etc/services
echo "nrpe stream tcp nowait nagios /usr/sfw/sbin/tcpd /usr/local/nagios/bin/nrpe \
-c /usr/local/nagios/etc/nrpe.cfg -i" >> /etc/inet/inetd.conf
Now, tell SMF to pull in the inetd config:
inetconv
At this point, the SMF service is available, but we want to use TCP wrappers so that only our Nagios server can talk to NRPE (substitute $NAGIOS_IP with the IP of your Nagios server):
inetadm -m svc:/network/nrpe/tcp:default tcp_wrappers=TRUE
echo "nrpe: LOCAL, $NAGIOS_IP" >> /etc/hosts.allow
echo "nrpe: ALL" >> /etc/hosts.deny
Finally, fire up the service:
svcadm enable nrpe/tcp
That's it! Nagios should be able to monitor your Solaris 10 box now. Someday, I'll make a package for this, but you can pretty well copy and paste the code here to get up and running.
First, let's make sure some directories are present, and create our Nagios user:
# mkdir /usr/local
# groupadd nagios
# useradd -m -c "nagios system user" -d /usr/local/nagios -g nagios -m nagios
Next, download and extract the source code to NRPE:
$ cd /tmp/
$ /usr/sfw/bin/wget http://superb-east.dl.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
$ gzip -dc nrpe-2.12.tar.gz | tar -xvf -
$ cd nrpe-2.12
Now, we need to tell the configure script where to find the openssl libraries, and make sure that GCC is in our path:
$ PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin ./configure --with-ssl=/usr/sfw/ --with-ssl-lib=/usr/sfw/lib/
That should run just fine. Before we build, we need to apply a quick fix to nrpe.c. If you don't do this, you'll get an error from make that says "nrpe.c:617: error: 'LOG_AUTHPRIV' undeclared (first use in this function)".
$ perl -pi -e 's/LOG_AUTHPRIV/LOG_AUTH/; s/LOG_FTP/LOG_DAEMON/' src/nrpe.c
Now, we should be okay to build it:
$ PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin make
Then, install it as root:
# PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin make install
Either copy the nrpe.cfg sample included in the source code, or drop your own into /usr/local/nagios/etc/nrpe.cfg. Now, stay logged in as root for the following, now we'll get NRPE setup to run under SMF.
First, we need to setup the service and present it to inetd:
echo "nrpe 5666/tcp # NRPE" >> /etc/services
echo "nrpe stream tcp nowait nagios /usr/sfw/sbin/tcpd /usr/local/nagios/bin/nrpe \
-c /usr/local/nagios/etc/nrpe.cfg -i" >> /etc/inet/inetd.conf
Now, tell SMF to pull in the inetd config:
inetconv
At this point, the SMF service is available, but we want to use TCP wrappers so that only our Nagios server can talk to NRPE (substitute $NAGIOS_IP with the IP of your Nagios server):
inetadm -m svc:/network/nrpe/tcp:default tcp_wrappers=TRUE
echo "nrpe: LOCAL, $NAGIOS_IP" >> /etc/hosts.allow
echo "nrpe: ALL" >> /etc/hosts.deny
Finally, fire up the service:
svcadm enable nrpe/tcp
That's it! Nagios should be able to monitor your Solaris 10 box now. Someday, I'll make a package for this, but you can pretty well copy and paste the code here to get up and running.
2009年7月17日 星期五
Check_mysql_query 用法
/usr/local/nagios/libexec/check_mysql_query -q "SELECT free FROM ISPD.dim_ANY_MEMSTAT where sno=2" -u dim -p dimitri -H 10.110.32.120 -P 3306 -w 3333333 -c 55555555
free:Column 名稱
ISPD:Database名稱
dim_ANY_MEMSTAT:Table 名稱
sno: 查詢條件
free:Column 名稱
ISPD:Database名稱
dim_ANY_MEMSTAT:Table 名稱
sno: 查詢條件
Solaris 10下安裝nagios
Solaris 10下nagios监控系统
[日期:2009-01-15] 来源:Linux社区 作者:loveunix
Nagios是一个系统和网络监控软件,它可以监测所指定的主机和服务,并在出现问题以及问题恢复后发出报警。Nagios最早是被设计运行于Linux环境下的,但在大多数Unix操作系统下也可以使用。同时它是一个开源软件,我们可以免费获得它的源码,和使用它。Nagios是个不错的系统监控软件,www.britepic.org应用的范围也比较广泛。
本文将介绍Nagios在Solaris10操做系统下的安装过程,其中包括,源码的编译、安装;Apache的安装、Nagios CGI的配置;Nagios监控配置等。
本文参考了Nagios的官方文档和Nagios社区的文章,以及互联网上其他人的相关帖子。
环境、资源准备
gcc-3.4.6-sol10-x86-local.gz
libiconv-1.11-sol10-x86-local.gz
libintl-3.4.0-sol10-x86-local.gz
make-3.81-sol10-x86-local.gz
openssl-0.9.8h-sol10-x86-local.gz
gd-2.0.35-sol10-x86-local.gz
httpd-2.2.4.tar.gz
nagios-3.0.3.tar.gz
nagios-plugins-1.4.11.tar.gz
nrpe-2.12.tar.gz
1.安装Nagios
# groupadd nagios
# useradd -g nagios -d /usr/local/nagios nagios
# gunzip ./nagios-3.0.6.tar.gz
# tar xvf ./nagios-3.0.6.tar.gz
# cd ./nagios-3.0.6.tar.gz
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios \
--with-nagios-group=nagios --with-gd-lib=/usr/sfw/lib \
--with-gd-inc=/usr/sfw/include
# make all
# make fullinstall
# make install-config
2.安装openssl
# gunzip ./openssl-0.9.8j-sol10-sparc-local.gz
# pkgadd -d ./openssl-0.9.8j-sol10-sparc-local
# export LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH
3.安装Nagios Plugins
# gunzip ./nagios-plugins-1.4.13.tar.gz
# tar xvf ./nagios-plugins-1.4.13.tar
# cd nagios-plugins-1.4.13
# ./configure --without-mysql --prefix=/usr/local/nagios --with-openssl=/usr/local/ssl
# make
# make install
# make clean
# chown -R nagios:nagios /usr/local/nagios/libexec
4.配置Apache
在/etc/apache2/httpd.conf文件追加如下内容
#setting for nagios
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
Alias /nagios /usr/local/nagios/share
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
5.生成登录用户和验证口令
# /usr/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd
此处的user_name为登录Nagios Web应用需要输入的用户名www.britepic.org
按照提示输入要设置的口令即可
配置/usr/local/nagios/etc/cgi.cfg,添加用户edison
................. .................
# SYSTEM/PROCESS INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# have access to viewing the Nagios process information as
# provided by the Extended Information CGI (extinfo.cgi). By
# default, *no one* has access to this unless you choose to
# not use authorization. You may use an asterisk (*) to
# authorize any user who has authenticated to the web server.
authorized_for_system_information=nagiosadmin,edison
# CONFIGURATION INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# can view ALL configuration information (hosts, commands, etc).
# By default, users can only view configuration information
# for the hosts and services they are contacts for. You may use
# an asterisk (*) to authorize any user who has authenticated
# to the web server.
authorized_for_configuration_information=nagiosadmin,edison
# SYSTEM/PROCESS COMMAND ACCESS
# This option is a comma-delimited list of all usernames that
# can issue shutdown and restart commands to Nagios via the
# command CGI (cmd.cgi). Users in this list can also change
# the program mode to active or standby. By default, *no one*
# has access to this unless you choose to not use authorization.
# You may use an asterisk (*) to authorize any user who has
# authenticated to the web server.
authorized_for_system_commands=nagiosadmin,edison
# GLOBAL HOST/SERVICE VIEW ACCESS
# These two options are comma-delimited lists of all usernames that
# can view information for all hosts and services that are being
# monitored. By default, users can only view information
# for hosts or services that they are contacts for (unless you
# you choose to not use authorization). You may use an asterisk (*)
# to authorize any user who has authenticated to the web server.
authorized_for_all_services=nagiosadmin,edison
authorized_for_all_hosts=nagiosadmin,edison
# GLOBAL HOST/SERVICE COMMAND ACCESS
# These two options are comma-delimited lists of all usernames that
# can issue host or service related commands via the command
# CGI (cmd.cgi) for all hosts and services that are being monitored.
# By default, users can only issue commands for hosts or services
# that they are contacts for (unless you you choose to not use
# authorization). You may use an asterisk (*) to authorize any
# user who has authenticated to the web server.
authorized_for_all_service_commands=nagiosadmin,edison
authorized_for_all_host_commands=nagiosadmin,edison
................. .................
6.启动Nagios
Nagios的启动程序是/usr/local/nagios/bin/nagios
# ./nagios --help
Nagios 3.0.3
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 06-25-2008
License: GPL
Usage: ./nagios [options]
Options:
-v, --verify-config Verify all configuration data
-s, --test-scheduling Shows projected/recommended check scheduling and other
diagnostic info based on the current configuration files.
-x, --dont-verify-paths Don't check for circular object paths - USE WITH CAUTION!
-p, --precache-objects Precache object configuration - use with -v or -s options
-u, --use-precached-objects Use precached object config file
-d, --daemon Starts Nagios in daemon mode, instead of as a foreground process
Visit the Nagios website at http://www.nagios.org/ for bug fixes, new
releases, online documentation, FAQs, information on subscribing to
the mailing lists, and commercial support options for Nagios.
首先通过-v选项验证配置文件是否正确
# cd /usr/lcoal/nagios/bin
# ./nagios -v ../etc/nagios.cfg
Nagios 3.0.3
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 06-25-2008
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
.........................................................
.............................................
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
如果没有错误,就可以启动它了。
# cd /usr/local/nagios/bin
# ./nagios -d /usr/local/nagios/etc/nagios.cfg
nagios web界面提示
It appears as though you do not have permission to view information for any of the services you requested...
打开cgi.cfg配置文件,里面有个参数:
use_authentication=1
为了保障系统的安全性,nagios设置了这个参数,默认为1,改为0即可
查看/usr/local/nagios/var/nagios.log日志文件,观察启动是否正常。
在IE浏览器中查看监控情况。
点击左边导航栏的 Host Detail
[日期:2009-01-15] 来源:Linux社区 作者:loveunix
Nagios是一个系统和网络监控软件,它可以监测所指定的主机和服务,并在出现问题以及问题恢复后发出报警。Nagios最早是被设计运行于Linux环境下的,但在大多数Unix操作系统下也可以使用。同时它是一个开源软件,我们可以免费获得它的源码,和使用它。Nagios是个不错的系统监控软件,www.britepic.org应用的范围也比较广泛。
本文将介绍Nagios在Solaris10操做系统下的安装过程,其中包括,源码的编译、安装;Apache的安装、Nagios CGI的配置;Nagios监控配置等。
本文参考了Nagios的官方文档和Nagios社区的文章,以及互联网上其他人的相关帖子。
环境、资源准备
gcc-3.4.6-sol10-x86-local.gz
libiconv-1.11-sol10-x86-local.gz
libintl-3.4.0-sol10-x86-local.gz
make-3.81-sol10-x86-local.gz
openssl-0.9.8h-sol10-x86-local.gz
gd-2.0.35-sol10-x86-local.gz
httpd-2.2.4.tar.gz
nagios-3.0.3.tar.gz
nagios-plugins-1.4.11.tar.gz
nrpe-2.12.tar.gz
1.安装Nagios
# groupadd nagios
# useradd -g nagios -d /usr/local/nagios nagios
# gunzip ./nagios-3.0.6.tar.gz
# tar xvf ./nagios-3.0.6.tar.gz
# cd ./nagios-3.0.6.tar.gz
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios \
--with-nagios-group=nagios --with-gd-lib=/usr/sfw/lib \
--with-gd-inc=/usr/sfw/include
# make all
# make fullinstall
# make install-config
2.安装openssl
# gunzip ./openssl-0.9.8j-sol10-sparc-local.gz
# pkgadd -d ./openssl-0.9.8j-sol10-sparc-local
# export LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH
3.安装Nagios Plugins
# gunzip ./nagios-plugins-1.4.13.tar.gz
# tar xvf ./nagios-plugins-1.4.13.tar
# cd nagios-plugins-1.4.13
# ./configure --without-mysql --prefix=/usr/local/nagios --with-openssl=/usr/local/ssl
# make
# make install
# make clean
# chown -R nagios:nagios /usr/local/nagios/libexec
4.配置Apache
在/etc/apache2/httpd.conf文件追加如下内容
#setting for nagios
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
Alias /nagios /usr/local/nagios/share
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
5.生成登录用户和验证口令
# /usr/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd
此处的user_name为登录Nagios Web应用需要输入的用户名www.britepic.org
按照提示输入要设置的口令即可
配置/usr/local/nagios/etc/cgi.cfg,添加用户edison
................. .................
# SYSTEM/PROCESS INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# have access to viewing the Nagios process information as
# provided by the Extended Information CGI (extinfo.cgi). By
# default, *no one* has access to this unless you choose to
# not use authorization. You may use an asterisk (*) to
# authorize any user who has authenticated to the web server.
authorized_for_system_information=nagiosadmin,edison
# CONFIGURATION INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# can view ALL configuration information (hosts, commands, etc).
# By default, users can only view configuration information
# for the hosts and services they are contacts for. You may use
# an asterisk (*) to authorize any user who has authenticated
# to the web server.
authorized_for_configuration_information=nagiosadmin,edison
# SYSTEM/PROCESS COMMAND ACCESS
# This option is a comma-delimited list of all usernames that
# can issue shutdown and restart commands to Nagios via the
# command CGI (cmd.cgi). Users in this list can also change
# the program mode to active or standby. By default, *no one*
# has access to this unless you choose to not use authorization.
# You may use an asterisk (*) to authorize any user who has
# authenticated to the web server.
authorized_for_system_commands=nagiosadmin,edison
# GLOBAL HOST/SERVICE VIEW ACCESS
# These two options are comma-delimited lists of all usernames that
# can view information for all hosts and services that are being
# monitored. By default, users can only view information
# for hosts or services that they are contacts for (unless you
# you choose to not use authorization). You may use an asterisk (*)
# to authorize any user who has authenticated to the web server.
authorized_for_all_services=nagiosadmin,edison
authorized_for_all_hosts=nagiosadmin,edison
# GLOBAL HOST/SERVICE COMMAND ACCESS
# These two options are comma-delimited lists of all usernames that
# can issue host or service related commands via the command
# CGI (cmd.cgi) for all hosts and services that are being monitored.
# By default, users can only issue commands for hosts or services
# that they are contacts for (unless you you choose to not use
# authorization). You may use an asterisk (*) to authorize any
# user who has authenticated to the web server.
authorized_for_all_service_commands=nagiosadmin,edison
authorized_for_all_host_commands=nagiosadmin,edison
................. .................
6.启动Nagios
Nagios的启动程序是/usr/local/nagios/bin/nagios
# ./nagios --help
Nagios 3.0.3
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 06-25-2008
License: GPL
Usage: ./nagios [options]
Options:
-v, --verify-config Verify all configuration data
-s, --test-scheduling Shows projected/recommended check scheduling and other
diagnostic info based on the current configuration files.
-x, --dont-verify-paths Don't check for circular object paths - USE WITH CAUTION!
-p, --precache-objects Precache object configuration - use with -v or -s options
-u, --use-precached-objects Use precached object config file
-d, --daemon Starts Nagios in daemon mode, instead of as a foreground process
Visit the Nagios website at http://www.nagios.org/ for bug fixes, new
releases, online documentation, FAQs, information on subscribing to
the mailing lists, and commercial support options for Nagios.
首先通过-v选项验证配置文件是否正确
# cd /usr/lcoal/nagios/bin
# ./nagios -v ../etc/nagios.cfg
Nagios 3.0.3
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 06-25-2008
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
.........................................................
.............................................
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
如果没有错误,就可以启动它了。
# cd /usr/local/nagios/bin
# ./nagios -d /usr/local/nagios/etc/nagios.cfg
nagios web界面提示
It appears as though you do not have permission to view information for any of the services you requested...
打开cgi.cfg配置文件,里面有个参数:
use_authentication=1
为了保障系统的安全性,nagios设置了这个参数,默认为1,改为0即可
查看/usr/local/nagios/var/nagios.log日志文件,观察启动是否正常。
在IE浏览器中查看监控情况。
点击左边导航栏的 Host Detail
2009年4月10日 星期五
Linux 禁止 [Ctrl]-[Alt]-[Delete] 重新啟動
Linux 禁止 [Ctrl]-[Alt]-[Delete] 重新啟動
要禁止 Linux 按下 [Ctrl]-[Alt]-[Delete] 重新啟動,可以修改 /etc/inittab 設定檔實現。巨體方法如下:
1. 開啟 /etc/inittab
2. 找出以下一行:
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
3. 將這一行刪除,或者在這一行最開端加上 # 號。
4. 儲存檔案後重新啟動系統便會生效,如果不想重新啟動可以執行以下指令:
# init q
要禁止 Linux 按下 [Ctrl]-[Alt]-[Delete] 重新啟動,可以修改 /etc/inittab 設定檔實現。巨體方法如下:
1. 開啟 /etc/inittab
2. 找出以下一行:
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
3. 將這一行刪除,或者在這一行最開端加上 # 號。
4. 儲存檔案後重新啟動系統便會生效,如果不想重新啟動可以執行以下指令:
# init q
2009年4月9日 星期四
設定Asterisk 於Firewall 後
方法不難,只要在sip.conf加上幾行字然後再NAT開啟相對應的PORT就可以了。首先進入sip.conf的編輯畫面,
然後在[general]輸入以下字串即可。
externhost = test.ddns.org ; 自己所使用的domani name
externip = 168.39.5.6 ; isp提供的IP位址,或者是自己的聯外IP。如果使用的是撥接式adsl,此行可以省略,但記得申請DDNS,用doman name來作為替代。
localnet = 192.168.1.0/255.255.255.0 ; 區域網路所使用的IP位址/netmask。
nat = yes
然後在NAT的設定部份需開啟如下的PORT
sip udp port 5002~5082
rtp udp port 10000~20000
設定好之後,在終端模式下輸入
amportal stop
amportal start
然後在[general]輸入以下字串即可。
externhost = test.ddns.org ; 自己所使用的domani name
externip = 168.39.5.6 ; isp提供的IP位址,或者是自己的聯外IP。如果使用的是撥接式adsl,此行可以省略,但記得申請DDNS,用doman name來作為替代。
localnet = 192.168.1.0/255.255.255.0 ; 區域網路所使用的IP位址/netmask。
nat = yes
然後在NAT的設定部份需開啟如下的PORT
sip udp port 5002~5082
rtp udp port 10000~20000
設定好之後,在終端模式下輸入
amportal stop
amportal start
[Hack] 修改通話錄音的格式為 MP3
在 Trixbox 上有個很好用的通話錄音功能,而且是內建就有的,只是預設的語音檔格式是未經壓縮的 WAV 檔,非常耗用硬碟的儲存空間,此篇目的為:將預設的與錄音檔格式修改為 MP3,使其在不失音質條件下又可大量節省硬碟的儲存空間,兩種格式的檔案大小比率約為 7(WAV) : 1(MP3)。
首先說明如何操作系統上的通話錄音功能:
1. 確定分機的錄音功能是開啟的
《Setup》《Extensios》《分機號》《Recording Options》《Recording Incoming=On Demand,Recording Outgoing=On Demand》
2. 使用有開啟錄音功能的分機,撥打電話,對方接通後,要錄音時按下 *1,停止錄音時再按一次 *1 或掛斷時即自動結束錄音。
Tips: 在預設模式下,按下 *1 的間隔時間要迅速,否則無法開啟/關閉錄音功能,不過增加下方這個參數可以解決這問題。
編輯 /etc/asterisk/features_general_custom.conf
==================================================
featuredigittimeout = 1000 ; Max time (ms) between digits for
; feature activation. Default is 500
==================================================
3. 聽取錄音檔有兩種方式:透過網頁-Recording 播放或下載主機上的錄音檔至本地電腦端播放。
- 網頁方式:直接點選《Recording》,登入帳號/密碼預設為 admin/ari_password,為系統安全考量,強烈建議自行修改 /var/www/html/recordings/includes/main.conf.php
#
# Admin only account
#
$ARI_ADMIN_USERNAME = "admin";
$ARI_ADMIN_PASSWORD ="ari_password"; <------ 改這邊
- 主機下載方式:使用軟體 WinScp 或 FTP Client 連上主機,錄音檔位置在 /var/spool/asterisk/monitor。
接下來就是本篇重點,將 WAV 格式變更為容量較小的 MP3:
1. 新增一個轉換語音格式的程式檔,使用 nano 或 vi 編輯器都可以。
以 root 登入主機
#su - asterisk
$cd ~/bin
$vi ari-wav2mp3.sh
==========================================================
#!/bin/bash
#
# file : ari-wav2mp3.sh
# author: A-Lang, alang[dot]hsu[at]gmail[dot]com
# this is for debugging
#RECORD_PATH="/var/lib/asterisk/mytemp"
#
RECORD_PATH="/var/spool/asterisk/monitor"
LAME="/opt/lame-3.97/bin/lame"
cd $RECORD_PATH
#for WAV in $(ls *.wav 2> /dev/null)
#
# Ignore the audio files that are recording.
for WAV in $(ls *.wav | grep -v -e "-out.wav" | grep -v -e "-in.wav" 2> /dev/null)
do
echo "Encoding MP3 file from $WAV ..."
OUT=${WAV%.*}
$LAME --silent -V7 -B24 --tt $OUT.wav --add-id3v2 $OUT.wav $OUT.mp3
test -r $OUT.mp3 && rm -f $OUT.wav
done
#EOF
=============================================================
$chmod 755 ari-wav2mp3.sh
$exit
2. 新增工作排程,使其可自動執行轉檔的程序。
以 root 登入主機
#crontab -e
按下 i 鍵,將以下這行加上
*/5 * * * * su - asterisk -c "~asterisk/bin/ari-wav2mp3.sh"
分別按下 Esc :
輸入 wq
存檔完成了
3. 錄一段通話,然後在透過網頁 Recording 試聽,及下載語音檔案,驗證是否已經為 MP3 的格式。
補充:
如何手動安裝 LAME MP3 編碼器?
Ans:
以 Root 登入,
#wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz?modtime=1159107882&big_mirror=0
#tar -xzf lame-3.97.tar.gz
#cd lame-3.97
#./configure --prefix=/opt/lame-3.97
#make
#make install
#/opt/lame-3.97/bin/lame -h
--> 如果有出現說明文字,表示安裝成功。
首先說明如何操作系統上的通話錄音功能:
1. 確定分機的錄音功能是開啟的
《Setup》《Extensios》《分機號》《Recording Options》《Recording Incoming=On Demand,Recording Outgoing=On Demand》
2. 使用有開啟錄音功能的分機,撥打電話,對方接通後,要錄音時按下 *1,停止錄音時再按一次 *1 或掛斷時即自動結束錄音。
Tips: 在預設模式下,按下 *1 的間隔時間要迅速,否則無法開啟/關閉錄音功能,不過增加下方這個參數可以解決這問題。
編輯 /etc/asterisk/features_general_custom.conf
==================================================
featuredigittimeout = 1000 ; Max time (ms) between digits for
; feature activation. Default is 500
==================================================
3. 聽取錄音檔有兩種方式:透過網頁-Recording 播放或下載主機上的錄音檔至本地電腦端播放。
- 網頁方式:直接點選《Recording》,登入帳號/密碼預設為 admin/ari_password,為系統安全考量,強烈建議自行修改 /var/www/html/recordings/includes/main.conf.php
#
# Admin only account
#
$ARI_ADMIN_USERNAME = "admin";
$ARI_ADMIN_PASSWORD ="ari_password"; <------ 改這邊
- 主機下載方式:使用軟體 WinScp 或 FTP Client 連上主機,錄音檔位置在 /var/spool/asterisk/monitor。
接下來就是本篇重點,將 WAV 格式變更為容量較小的 MP3:
1. 新增一個轉換語音格式的程式檔,使用 nano 或 vi 編輯器都可以。
以 root 登入主機
#su - asterisk
$cd ~/bin
$vi ari-wav2mp3.sh
==========================================================
#!/bin/bash
#
# file : ari-wav2mp3.sh
# author: A-Lang, alang[dot]hsu[at]gmail[dot]com
# this is for debugging
#RECORD_PATH="/var/lib/asterisk/mytemp"
#
RECORD_PATH="/var/spool/asterisk/monitor"
LAME="/opt/lame-3.97/bin/lame"
cd $RECORD_PATH
#for WAV in $(ls *.wav 2> /dev/null)
#
# Ignore the audio files that are recording.
for WAV in $(ls *.wav | grep -v -e "-out.wav" | grep -v -e "-in.wav" 2> /dev/null)
do
echo "Encoding MP3 file from $WAV ..."
OUT=${WAV%.*}
$LAME --silent -V7 -B24 --tt $OUT.wav --add-id3v2 $OUT.wav $OUT.mp3
test -r $OUT.mp3 && rm -f $OUT.wav
done
#EOF
=============================================================
$chmod 755 ari-wav2mp3.sh
$exit
2. 新增工作排程,使其可自動執行轉檔的程序。
以 root 登入主機
#crontab -e
按下 i 鍵,將以下這行加上
*/5 * * * * su - asterisk -c "~asterisk/bin/ari-wav2mp3.sh"
分別按下 Esc :
輸入 wq
存檔完成了
3. 錄一段通話,然後在透過網頁 Recording 試聽,及下載語音檔案,驗證是否已經為 MP3 的格式。
補充:
如何手動安裝 LAME MP3 編碼器?
Ans:
以 Root 登入,
#wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz?modtime=1159107882&big_mirror=0
#tar -xzf lame-3.97.tar.gz
#cd lame-3.97
#./configure --prefix=/opt/lame-3.97
#make
#make install
#/opt/lame-3.97/bin/lame -h
--> 如果有出現說明文字,表示安裝成功。
Serial Console 管理 Asterisk 主機
要使 Asterisk 主機就像一般網路設備一樣,可以在不接螢幕,鍵盤及滑鼠之下,直接透過 serial console 的連接方式來管理內部系統。當然囉!! 若你和我一樣使用超小型主機來安裝,這技巧更是不可或缺。
首先看一下,這個超小型主機。要充分發揮它的迷你的特性,當然是不能接上螢幕/鍵盤/滑鼠,不然就遜掉。那系統管理該如何作呢?
作過網管的人都知道,一般網路設備都只是透過一條 serial console line 連接筆記型電腦和網路設備,以終端機軟體來管理內部的系統。此篇將告訴你如何在 Asterisk 系統上實現,而且步驟實在很簡單。
要實現這樣的應用,事實上,與 Asterisk 無任何關係,而關鍵在於 Linux 作業系統,所以此法也可套用在非 Asterisk 應用的 Linux 系統。
首先,請先完成 Asterisk 的所有設定,入門者可選擇 Trixbox 或 Elastix 這類的套件,安裝時較容易。
步驟一:編輯 /boot/grub/menu.lst
在 title ..... 上方,加上
## Enable serial console
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
這行前面加上註解
#splashimage=(hd0,1)/boot/grub/splash.xpm.gz
找到實際開機所需的那一行,例如是
title CentOS-4 i386-up (2.6.9-34.0.2.EL)
root (hd0,1)
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1
initrd /boot/initrd-2.6.9-34.0.2.EL.img
在 kernel 後方加上 console=tty0 console=ttyS0,9600n8
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1 console=tty0 console=ttyS0,9600n8
步驟二:編輯 /etc/inittab
最下方加上這行
# Enable serial console
sc:2345:respawn:/sbin/agetty ttyS0 115200,9600 xterm
步驟三: 系統預設是不予許 root 直接從 serial console 登入,這樣造成管理不是很方便,所以修改一下設定。
編輯 /etc/securetty,最底下加上
ttyS0
步驟四:完成了,到這兒,主機已經可以用 serial console 登入管理。
接著,準備一台筆記型電腦,還有自己習慣用的終端機軟體,如沒有,就用 Windows 內建的超級終端機也可,再一條 USB 轉 COM 的 console 線。設定終端機連接埠的參數為
資料傳輸率:9600
資料位
要使 Asterisk 主機就像一般網路設備一樣,可以在不接螢幕,鍵盤及滑鼠之下,直接透過 serial console 的連接方式來管理內部系統。當然囉!! 若你和我一樣使用超小型主機來安裝,這技巧更是不可或缺。
首先看一下,這個超小型主機。要充分發揮它的迷你的特性,當然是不能接上螢幕/鍵盤/滑鼠,不然就遜掉。那系統管理該如何作呢?
作過網管的人都知道,一般網路設備都只是透過一條 serial console line 連接筆記型電腦和網路設備,以終端機軟體來管理內部的系統。此篇將告訴你如何在 Asterisk 系統上實現,而且步驟實在很簡單。
要實現這樣的應用,事實上,與 Asterisk 無任何關係,而關鍵在於 Linux 作業系統,所以此法也可套用在非 Asterisk 應用的 Linux 系統。
首先,請先完成 Asterisk 的所有設定,入門者可選擇 Trixbox 或 Elastix 這類的套件,安裝時較容易。
步驟一:編輯 /boot/grub/menu.lst
在 title ..... 上方,加上
## Enable serial console
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
這行前面加上註解
#splashimage=(hd0,1)/boot/grub/splash.xpm.gz
找到實際開機所需的那一行,例如是
title CentOS-4 i386-up (2.6.9-34.0.2.EL)
root (hd0,1)
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1
initrd /boot/initrd-2.6.9-34.0.2.EL.img
在 kernel 後方加上 console=tty0 console=ttyS0,9600n8
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1 console=tty0 console=ttyS0,9600n8
步驟二:編輯 /etc/inittab
最下方加上這行
# Enable serial console
sc:2345:respawn:/sbin/agetty ttyS0 115200,9600 xterm
步驟三: 系統預設是不予許 root 直接從 serial console 登入,這樣造成管理不是很方便,所以修改一下設定。
編輯 /etc/securetty,最底下加上
ttyS0
步驟四:完成了,到這兒,主機已經可以用 serial console 登入管理。
接著,準備一台筆記型電腦,還有自己習慣用的終端機軟體,如沒有,就用 Windows 內建的超級終端機也可,再一條 USB 轉 COM 的 console 線。設定終端機連接埠的參數為
資料傳輸率:9600
資料位元:8
同位檢查:無
停止位元:1
流量控制:硬體
以 serial console 方式的管理介面與 telnet 是一樣的,只是若使用 Windows 內建的超級終端機軟體,會有畫面被截掉情形,筆者推薦使用 Putty 這工具。
元:8
同位檢查:無
停止位元:1
流量控制:硬體
以 serial console 方式的管理介面與 telnet 是一樣的,只是若使用 Windows 內建的超級終端機軟體,會有畫面被截掉情形,筆者推薦使用 Putty 這工具。
首先看一下,這個超小型主機。要充分發揮它的迷你的特性,當然是不能接上螢幕/鍵盤/滑鼠,不然就遜掉。那系統管理該如何作呢?
作過網管的人都知道,一般網路設備都只是透過一條 serial console line 連接筆記型電腦和網路設備,以終端機軟體來管理內部的系統。此篇將告訴你如何在 Asterisk 系統上實現,而且步驟實在很簡單。
要實現這樣的應用,事實上,與 Asterisk 無任何關係,而關鍵在於 Linux 作業系統,所以此法也可套用在非 Asterisk 應用的 Linux 系統。
首先,請先完成 Asterisk 的所有設定,入門者可選擇 Trixbox 或 Elastix 這類的套件,安裝時較容易。
步驟一:編輯 /boot/grub/menu.lst
在 title ..... 上方,加上
## Enable serial console
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
這行前面加上註解
#splashimage=(hd0,1)/boot/grub/splash.xpm.gz
找到實際開機所需的那一行,例如是
title CentOS-4 i386-up (2.6.9-34.0.2.EL)
root (hd0,1)
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1
initrd /boot/initrd-2.6.9-34.0.2.EL.img
在 kernel 後方加上 console=tty0 console=ttyS0,9600n8
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1 console=tty0 console=ttyS0,9600n8
步驟二:編輯 /etc/inittab
最下方加上這行
# Enable serial console
sc:2345:respawn:/sbin/agetty ttyS0 115200,9600 xterm
步驟三: 系統預設是不予許 root 直接從 serial console 登入,這樣造成管理不是很方便,所以修改一下設定。
編輯 /etc/securetty,最底下加上
ttyS0
步驟四:完成了,到這兒,主機已經可以用 serial console 登入管理。
接著,準備一台筆記型電腦,還有自己習慣用的終端機軟體,如沒有,就用 Windows 內建的超級終端機也可,再一條 USB 轉 COM 的 console 線。設定終端機連接埠的參數為
資料傳輸率:9600
資料位
要使 Asterisk 主機就像一般網路設備一樣,可以在不接螢幕,鍵盤及滑鼠之下,直接透過 serial console 的連接方式來管理內部系統。當然囉!! 若你和我一樣使用超小型主機來安裝,這技巧更是不可或缺。
首先看一下,這個超小型主機。要充分發揮它的迷你的特性,當然是不能接上螢幕/鍵盤/滑鼠,不然就遜掉。那系統管理該如何作呢?
作過網管的人都知道,一般網路設備都只是透過一條 serial console line 連接筆記型電腦和網路設備,以終端機軟體來管理內部的系統。此篇將告訴你如何在 Asterisk 系統上實現,而且步驟實在很簡單。
要實現這樣的應用,事實上,與 Asterisk 無任何關係,而關鍵在於 Linux 作業系統,所以此法也可套用在非 Asterisk 應用的 Linux 系統。
首先,請先完成 Asterisk 的所有設定,入門者可選擇 Trixbox 或 Elastix 這類的套件,安裝時較容易。
步驟一:編輯 /boot/grub/menu.lst
在 title ..... 上方,加上
## Enable serial console
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
這行前面加上註解
#splashimage=(hd0,1)/boot/grub/splash.xpm.gz
找到實際開機所需的那一行,例如是
title CentOS-4 i386-up (2.6.9-34.0.2.EL)
root (hd0,1)
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1
initrd /boot/initrd-2.6.9-34.0.2.EL.img
在 kernel 後方加上 console=tty0 console=ttyS0,9600n8
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/1 console=tty0 console=ttyS0,9600n8
步驟二:編輯 /etc/inittab
最下方加上這行
# Enable serial console
sc:2345:respawn:/sbin/agetty ttyS0 115200,9600 xterm
步驟三: 系統預設是不予許 root 直接從 serial console 登入,這樣造成管理不是很方便,所以修改一下設定。
編輯 /etc/securetty,最底下加上
ttyS0
步驟四:完成了,到這兒,主機已經可以用 serial console 登入管理。
接著,準備一台筆記型電腦,還有自己習慣用的終端機軟體,如沒有,就用 Windows 內建的超級終端機也可,再一條 USB 轉 COM 的 console 線。設定終端機連接埠的參數為
資料傳輸率:9600
資料位元:8
同位檢查:無
停止位元:1
流量控制:硬體
以 serial console 方式的管理介面與 telnet 是一樣的,只是若使用 Windows 內建的超級終端機軟體,會有畫面被截掉情形,筆者推薦使用 Putty 這工具。
元:8
同位檢查:無
停止位元:1
流量控制:硬體
以 serial console 方式的管理介面與 telnet 是一樣的,只是若使用 Windows 內建的超級終端機軟體,會有畫面被截掉情形,筆者推薦使用 Putty 這工具。
Web-Meetme Conference 錄音檔不能下載問題
Conference 錄音檔不能下載問題
修改conf_update.php
將
echo " ";
修改為
echo "src=\"images/speaker.gif\" alt=\"Play\" border=0 style=\"{text-decoration: none;}\">";
建立ln link
ln -s /var/lib/asterisk/sounds/conf-recordings /var/www/html/web-meetme/wav
修改conf_update.php
將
echo " ";
修改為
echo "src=\"images/speaker.gif\" alt=\"Play\" border=0 style=\"{text-decoration: none;}\">";
建立ln link
ln -s /var/lib/asterisk/sounds/conf-recordings /var/www/html/web-meetme/wav
Web-Meetme 錄音 圖示未出現問題
Web-Meetme 錄音
mkdir /var/lib/asterisk/sounds/conf-recordings
chown asterisk.asterisk /var/lib/asterisk/sounds/conf-recordings -R
# mkdir /var/lib/asterisk/sounds/conf-recordings
# chown -R asterisk:asterisk /var/lib/asterisk/sounds/conf-recordings
mkdir /var/lib/asterisk/sounds/conf-recordings
chown asterisk.asterisk /var/lib/asterisk/sounds/conf-recordings -R
# mkdir /var/lib/asterisk/sounds/conf-recordings
# chown -R asterisk:asterisk /var/lib/asterisk/sounds/conf-recordings
Asterisk With SaveCom SIP Trunk
Asterisk With SaveCom
Trunk Name:To Savecom
PEER Details
--------------------------
context=from-pstn
host=sip.savecom.net.tw
username=***
fromuser=***
fromdomain=***.net.tw
type=friend
secret=********
insecure=very
disallow=all
allow=g729
realm=***
nat=yes
dtmfmode=rfc2833
------------------------------------
USER Context:***
----------------------------------
context=from-pstn
fromdomain=***.net.tw
host=***.net.tw
secret=*********
type=friend
username=******
----------------------------------
Register String
--------------------------------
0******:********@***.net.tw/0********
Trunk Name:To Savecom
PEER Details
--------------------------
context=from-pstn
host=sip.savecom.net.tw
username=***
fromuser=***
fromdomain=***.net.tw
type=friend
secret=********
insecure=very
disallow=all
allow=g729
realm=***
nat=yes
dtmfmode=rfc2833
------------------------------------
USER Context:***
----------------------------------
context=from-pstn
fromdomain=***.net.tw
host=***.net.tw
secret=*********
type=friend
username=******
----------------------------------
Register String
--------------------------------
0******:********@***.net.tw/0********
Asterisk SIP Trunk with Nortel IPPBX
Asterisk SIP Trunk with Nortel IPPBX
username=0********
usereqphone=yes
type=peer
secret=844******
realm=sip.mmm.net.tw
nat=yes
insecure=very
host=sip.mmm.net.tw
fromuser=0*****
fromdomain=sip.mmm.net.tw
disallow=all
allow=g729
username=0********
usereqphone=yes
type=peer
secret=844******
realm=sip.mmm.net.tw
nat=yes
insecure=very
host=sip.mmm.net.tw
fromuser=0*****
fromdomain=sip.mmm.net.tw
disallow=all
allow=g729
修改web-meetme 預設Participants人數
修改web-meetme 預設Participants人數
vi /var/www/html/web-meetme/meetme_control.php
修改
vi /var/www/html/web-meetme/meetme_control.php
修改
開啟Web-Meetme Callout功能
開啟Web-Meetme Callout功能
編輯/var/www/html/web-meetme/lib/defines.php
Changed the Outcall defaults from:
define ("OUT_CONTEXT", "default");
to:
define ("OUT_CONTEXT", "from-internal");
Edited /var/www/html/web-meetme/call_operator.php as follows:
Line 71 - change from:
if ( CHAN_TYPE == "Local") {
$channel = CHAN_TYPE . "/" . $invite_num;
to:
if ( CHAN_TYPE == "Local") {
$channel = CHAN_TYPE . "/" . $invite_num . "@" . OUT_CONTEXT;
(also for call invite)
(fixes invite from conference for extensions)
編輯/var/www/html/web-meetme/lib/defines.php
Changed the Outcall defaults from:
define ("OUT_CONTEXT", "default");
to:
define ("OUT_CONTEXT", "from-internal");
Edited /var/www/html/web-meetme/call_operator.php as follows:
Line 71 - change from:
if ( CHAN_TYPE == "Local") {
$channel = CHAN_TYPE . "/" . $invite_num;
to:
if ( CHAN_TYPE == "Local") {
$channel = CHAN_TYPE . "/" . $invite_num . "@" . OUT_CONTEXT;
(also for call invite)
(fixes invite from conference for extensions)
解決Web-Meetme 查詢時HTTPD CPU 100%的問題
解決Web-Meetme 查詢時HTTPD CPU 100%的問題
修改以下兩檔案
1.etc/asterisk/phpagi.conf
[phpagi]
debug=true
error_handler=true
admin=root@localhost
hostname=root@localhost
tempdir=/tmp
[asmanager]
server=localhost
port=5038
username=admin
secret = amp111
[fastagi]
setuid=false
basedir=/var/lib/asterisk/agi-bin/
[festival]
text2wave=/usr/bin/text2wave
[cepstral]
swift=/opt/swift/bin/swift
voice=David
2./etc/asterisk/manager.conf
[admin]
secret = amp111
3.service httpd restart
修改以下兩檔案
1.etc/asterisk/phpagi.conf
[phpagi]
debug=true
error_handler=true
admin=root@localhost
hostname=root@localhost
tempdir=/tmp
[asmanager]
server=localhost
port=5038
username=admin
secret = amp111
[fastagi]
setuid=false
basedir=/var/lib/asterisk/agi-bin/
[festival]
text2wave=/usr/bin/text2wave
[cepstral]
swift=/opt/swift/bin/swift
voice=David
2./etc/asterisk/manager.conf
[admin]
secret = amp111
3.service httpd restart
Asterisk 安裝G729Codec
先至http://asterisk.hosting.lv/ 下載適當 Codec
下載於/usr/lib/asterisk/modules
asterisk -r
module load codec*.so
下載於/usr/lib/asterisk/modules
asterisk -r
module load codec*.so
於FreePBX介面中設定WebMeetme
1) Tools-->Custom Destinations --> Add Custom Destinations
1-1) Custom Destinations :custom-meetme3,s,1
1-2) Description : Web-Meetme
1-3) sumbit changes
1-4) Apply Configuration changes
2) Setup --> Misc Applications --> Add Misc Applications
2-1) Descritption: Web-Meetme
2-2) Feature Code: 1000
2-3) Feature Status:Enable
2-4) Desination 選擇 Custom Destinations [Web-Meetme]
2-5) sumbit changes
2-6) Apply Configuration changes
3) 設定Inbound route Setup--> Add Incoming Route
3-1) DID Number 0949144125 (根據使用的Trunk決定)
3-2) Set Destination 選擇Custom Destination [Web-Meetme]
3-3) sumbit changes
3-4) Apply Configuration changes
1-1) Custom Destinations :custom-meetme3,s,1
1-2) Description : Web-Meetme
1-3) sumbit changes
1-4) Apply Configuration changes
2) Setup --> Misc Applications --> Add Misc Applications
2-1) Descritption: Web-Meetme
2-2) Feature Code: 1000
2-3) Feature Status:Enable
2-4) Desination 選擇 Custom Destinations [Web-Meetme]
2-5) sumbit changes
2-6) Apply Configuration changes
3) 設定Inbound route Setup--> Add Incoming Route
3-1) DID Number 0949144125 (根據使用的Trunk決定)
3-2) Set Destination 選擇Custom Destination [Web-Meetme]
3-3) sumbit changes
3-4) Apply Configuration changes
修正TrixBox CDR上無法顯示Pin 欄位問題
/* --AMP Begin-- */
$FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19");
$FG_TABLE_COL[]=array ("Channel", "channel", "13%", "center", "", "30", "", "", "", "", "", "display_acronym");
$FG_TABLE_COL[]=array ("Source", "src", "14%", "center", "", "30");
$FG_TABLE_COL[]=array ("Clid", "clid", "26%", "center", "", "80");
$FG_TABLE_COL[]=array ("Accountcode", "accountcode", "8%", "center", "", "20");
$FG_TABLE_COL[]=array ("Dst", "dst", "14%", "center", "SORT", "30");
$FG_TABLE_COL[]=array ("Disposition", "disposition", "9%", "center", "", "30");
if ((!isset($resulttype)) || ($resulttype=="min")) $minute_function= "display_minute";
$FG_TABLE_COL[]=array ("Duration", "duration", "6%", "center", "SORT", "30", "", "", "", "", "", "$minute_function");
$FG_TABLE_DEFAULT_ORDER = "calldate";
$FG_TABLE_DEFAULT_SENS = "DESC";
// This Variable store the argument for the SQL query
//$FG_COL_QUERY='calldate, channel, src, clid, lastapp, lastdata, dst, dst, serverid, disposition, duration';
$FG_COL_QUERY='calldate, channel, src, clid, accountcode, dst, disposition, duration';
/* --AMP End -- */
$FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19");
$FG_TABLE_COL[]=array ("Channel", "channel", "13%", "center", "", "30", "", "", "", "", "", "display_acronym");
$FG_TABLE_COL[]=array ("Source", "src", "14%", "center", "", "30");
$FG_TABLE_COL[]=array ("Clid", "clid", "26%", "center", "", "80");
$FG_TABLE_COL[]=array ("Accountcode", "accountcode", "8%", "center", "", "20");
$FG_TABLE_COL[]=array ("Dst", "dst", "14%", "center", "SORT", "30");
$FG_TABLE_COL[]=array ("Disposition", "disposition", "9%", "center", "", "30");
if ((!isset($resulttype)) || ($resulttype=="min")) $minute_function= "display_minute";
$FG_TABLE_COL[]=array ("Duration", "duration", "6%", "center", "SORT", "30", "", "", "", "", "", "$minute_function");
$FG_TABLE_DEFAULT_ORDER = "calldate";
$FG_TABLE_DEFAULT_SENS = "DESC";
// This Variable store the argument for the SQL query
//$FG_COL_QUERY='calldate, channel, src, clid, lastapp, lastdata, dst, dst, serverid, disposition, duration';
$FG_COL_QUERY='calldate, channel, src, clid, accountcode, dst, disposition, duration';
/* --AMP End -- */
如何最佳化Sisky 與Asterisk介接反應時間
1) 使用Asterisk Ring Group功能
1-1) 先建立DISA提供Sisky呼入後,轉撥SIP Trunk到宏遠
1-1-1) Setup-->DISA-->Add DISA
DISA name:名稱
Response time out:8 接通後多久沒有反應後掛斷(Default 10)
Digit time out:3 輸入號碼後多久沒有反應掛斷(Default 5)
2) 使用Asterisk Announcement 功能
2-1) 先建立Announcement提供Sisky呼入後,撥放歡迎詞後直接送到DISA
2-1-1) Setup-->Announcements-->Add announcement
Description:名稱
Recording:選擇要撥放的聲音檔
Don't Answer Channel:需選取,以避免輸入的第一碼被切斷
Destination after playback:選擇DISA
3) 使用Asterisk Ring Groups 功能
3-1) 先建立Ring Groups提供Sisky 撥入使用
3-1-1) Setup-->Ring Groups-->Add Ring Group
Ring Group number:6000 (可任意指定)
Group Description:名稱
Extensions List:輸入閒置中的分機號碼
Destination if no Answer:選擇Announcement
4) Sisky設定將所有由Skype撥入的通話全部轉至6000
4-1) Port:點選要更改的Port
4-2) Other->Dial In:6000
4-3) Save
1-1) 先建立DISA提供Sisky呼入後,轉撥SIP Trunk到宏遠
1-1-1) Setup-->DISA-->Add DISA
DISA name:名稱
Response time out:8 接通後多久沒有反應後掛斷(Default 10)
Digit time out:3 輸入號碼後多久沒有反應掛斷(Default 5)
2) 使用Asterisk Announcement 功能
2-1) 先建立Announcement提供Sisky呼入後,撥放歡迎詞後直接送到DISA
2-1-1) Setup-->Announcements-->Add announcement
Description:名稱
Recording:選擇要撥放的聲音檔
Don't Answer Channel:需選取,以避免輸入的第一碼被切斷
Destination after playback:選擇DISA
3) 使用Asterisk Ring Groups 功能
3-1) 先建立Ring Groups提供Sisky 撥入使用
3-1-1) Setup-->Ring Groups-->Add Ring Group
Ring Group number:6000 (可任意指定)
Group Description:名稱
Extensions List:輸入閒置中的分機號碼
Destination if no Answer:選擇Announcement
4) Sisky設定將所有由Skype撥入的通話全部轉至6000
4-1) Port:點選要更改的Port
4-2) Other->Dial In:6000
4-3) Save
DISA (Direct Inward System Access)
DISA(passcode[|context])
DISA(password file)
主要的用途可以用在外線撥入後聽到dialtone後,經由pbx在撥號的功能,像是一般Gateway的上車功能.
passcode為密碼保護,不需密碼保護則輸入no-password
例一.
公司留一線PSTN線路供員工撥入PBX後,在撥打到國外客戶電話,以方便員工在外時對國外客戶的連絡.
FXO進線,context為fxo-in,內線context為internal
我們可以在fxo-in寫入
exten => s,1,Answer()
exten => s,2,DISA(1234|internal)
這樣子當撥號進線後,會聽到嘟聲,輸入1234後,就可以輸入internal可以外撥的號碼外撥出去了.
例二.
公司針對外線做管制,一般只可以撥打內線電話,要撥打外線時要先撥0,聽到dialtone後輸入密碼,根據不同密碼可以有不同的外撥
權限.
exten => *99,1,DISA(/path/disa.txt)
編輯disa.txt檔
1234|local
5678|international
......
這時公司內部要撥打外線時要接*99(或設置於話機的熱鍵),根據輸入不同的密碼給予不同的撥號權限.
DISA(password file)
主要的用途可以用在外線撥入後聽到dialtone後,經由pbx在撥號的功能,像是一般Gateway的上車功能.
passcode為密碼保護,不需密碼保護則輸入no-password
例一.
公司留一線PSTN線路供員工撥入PBX後,在撥打到國外客戶電話,以方便員工在外時對國外客戶的連絡.
FXO進線,context為fxo-in,內線context為internal
我們可以在fxo-in寫入
exten => s,1,Answer()
exten => s,2,DISA(1234|internal)
這樣子當撥號進線後,會聽到嘟聲,輸入1234後,就可以輸入internal可以外撥的號碼外撥出去了.
例二.
公司針對外線做管制,一般只可以撥打內線電話,要撥打外線時要先撥0,聽到dialtone後輸入密碼,根據不同密碼可以有不同的外撥
權限.
exten => *99,1,DISA(/path/disa.txt)
編輯disa.txt檔
1234|local
5678|international
......
這時公司內部要撥打外線時要接*99(或設置於話機的熱鍵),根據輸入不同的密碼給予不同的撥號權限.
修改Web-Meetme Caller-ID
vi /var/www/html/web-meetme/lib/defines.php
define ("OUT_CALL_CID", "From Web-Meetme 1000"); // Caller ID for Invites
define ("OUT_CALL_CID", "From Web-Meetme 1000"); // Caller ID for Invites
訂閱:
文章 (Atom)