使用開源Asterisk打造480路的呼叫中心

第1章:安裝前準備

文檔編寫以及環境準備


檢查主板PCI槽

安裝板卡之前,請檢查主板的PCI 槽是否可以支持Sangoma 語音板卡,Sangoma A101D代表1口PCI帶回聲模塊板卡,A101DE 代表PCI-E 帶回聲抑制模塊板卡。 點擊查看貴公司購買的主板是否支持標準的PCI插槽:主板PCI/PCI-E 介紹為了快速高效解決現場技術問題,強烈建議實施人員細心閱讀以下建議:

E1線端口

標準的2M E1線路支持兩種形式的接入方式:75歐姆(BNC)/120歐姆(RJ45)。幾個端口的匹配請客戶留意:1)Sangoma 廠家配置RJ45 的直通線。通常運營商端口你是BNC頭或者RJ45. 請用戶提前瞭解現場情況。2)可利用75/120歐姆轉接盒實現接入方式的轉換。3)如何做直通線,交叉線,回換測試線,請訪問:E1 RJ45 線序。


使用開源Asterisk打造480路的呼叫中心

數字語音卡支持運營商PRI接入


使用開源Asterisk打造480路的呼叫中心

語音卡插入服務器PCI槽,支持企業電話系統和呼叫中心

更多的語音卡配置環境和類型,讀者可以參考:

https://www.toutiao.com/a1660783770513422

E1線路支持的服務

企業通信接入的E1線路服務是接入配置的重要內容,客戶需要提前瞭解服務的影響必要配置:

1)線路是否支持CRC4校驗。2)運營商要求的pri 撥號規則,通常包括:本地用戶(local),國家(national),未知(unknown),國際(international) 4種格式。3)出局是否帶需要攜帶CID。

以上參數如果配置不正確,影響正常呼叫通話。另外,如果需要購買E1 數字線路,請諮詢VOIP88業務人員。

第2章:下載 Asterisk/Dahdi/Libpri

執行命令 cd /usr/src,轉到src 目錄

<code>wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz 
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.6.2-current.tar.gz
/<code>

注意,以上版本只是安裝板卡的例子,版本可能隨時更新,請用戶留意。

第3章:安裝 Asterisk/Dahdi/Libpri

1)檢查系統是否檢測到sangoma 語音板卡:執行命令 lspci -vvv, 如果檢測到板卡信息(會顯示sangoma廠商信息),執行下一步;如果沒有,重新拔出板卡,然後重新插入板卡。2)檢查安裝必要的軟件支持包-Centos 環境下,用戶必須確認以下安裝包成功安裝!訪問鏈接瞭解安裝包支持環境:https://wiki.asterisk.org/wiki/display/AST/Asterisk+Packageshttp://www.voip-info.org/wiki/view/Asterisk+11+Installation+on+CentOS+6http://wiki.sangoma.com/wanpipe-linux-asterisk-dahdiCentos 環境下,安裝支持包,和內核開發包:

<code> 
yum -y install kernel-devel-$(uname -r) libtool* make gcc patch perl bison gcc-c++ ncurses-devel flex
libtermcap-devel autoconf* automake* autoconf
/<code>

Ubutun/Debian 環境下:

<code>apt-get -y install gcc g++ automake autoconf libtool make libncurses5-dev flex bison patch libtool autoconf linux-headers-$(uname -r) sqlite3 libsqlite3-dev 
/<code>

以上支持包必須確認完全正確安裝,如果出現錯誤,請重新安裝,確保所有支持包完整安裝。特別留意內核開發包的安裝!3)為了安裝方便,強烈建議減壓 下載源代碼asterisk,dahdi,libpri到 /usr/src目錄下安裝dahdi 硬件接口模塊

<code>tar xvzf dahdi-linux-complete<version>
cd dahdi-linux-complete <version>
make
make install
/<version>/<version>/<code>

安裝libpri 協議支持包

<code>tar xvfz libpri-<version>
cd libpri-<version>
make

make install
/<version>/<version>/<code>

安裝asterisk

<code>tar xvfz asterisk-<version>.tgz
cd asterisk-<version>
./configure
make
make install
make samples // 如果第一次安裝,請執行這個命令;如果是更新系統,請執行前備份 /etc/asterisk 命令下的配置文件
/<version>/<version>/<code>

第4章:安裝Sangoma 驅動

1)下載Wanpipe驅動:下載地址:sangoma 驅動下載2)保存文件到 /usr/src 命令下3)減壓 wanpipe

<code>tar xvfz wanpipe-<version>.tgz
cd wanpipe-<version>
make // 確認成功安裝,無任何報錯信息
make install // 確認成功安裝,無任何報錯信息
./Setup install // 執行腳本安裝編譯,確認沒有任何報錯信息。
/<version>/<version>/<code>

如果安裝Sangoma A116E

<code>./Setup install --dahdi-chunk=40  
/<code>

執行 setup 安裝過程時的選項:

<code>[root@localhost wanpipe-7.0.5]# ./Setup install
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------

WANPIPE INSTALLATION

You are about to install WANPIPE Multi-Protocol
TDM Voice & WAN Router into your system.

This/>and/or modify necessary files and directories.

You must have Linux Kernel Headers along with
full development tools (i.e. GNU C compiler and utilities)
installed in order to be able to install this product.

This/>drivers and install them in their appropriate directory.

If you are installing Wanpipe for ASTERISK/ZAPTEL this
script will will prompt you for zaptel source location.

If you have previoulsy installed WANPIPE, this release
will overrite/upgrade full release without the need to
uninstall first!

IMPORTANT:
It is always recommended to say YES to all options
prompted during the install!

Please visit: http://wiki.sangoma.com for more info.

Would you like to install WANPIPE now? [y] (y/n) y // 選擇y
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------

Fixing file permissions...

Verifying files and fixing permissions ...Done

Warning: Wanpipe Modules are currently running!
Its recommended to unload Wanpipe Modules before proceeding
with installation.


Would you like to proceed? (y/n) y
Checking for C developement tools ...(gcc) OK
Checking for C++ developement tools ...OK
Checking for Make utility ...OK
Checking for ncurses library ... OK
Checking for Perl developement tools ...OK
Checking for AWK ...OK
Checking for FLEX ...OK
Checking for Patch ...OK

Checking for libtermcap-devel...OK
Checking for bison...OK
Checking for libtool...OK

Press [Enter] to continue... // 確認以上支持包成功安裝。輸入 Enter 鍵
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------


Installing WANPIPE Device Drivers: Linux KERNEL

To integrate WANPIPE Multi-Protocol Voice & WAN Router
modules into the Linux kernel, the kernel has to be
updated with latest wanpipe sources. Install will only
modify existing wanpipe source that is already in the
Kernel.

IMPORTANT:
It is always recommended to say YES to all options
prompted during the install!

----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------


Please specify absolute path name of your linux headers/source directory

Press Enter for Default: /lib/modules/2.6.32-358.23.2.el6.x86_64/build

#>
Setting linux directory to /lib/modules/2.6.32-358.23.2.el6.x86_64/build



Upgrading WANPIPE kernel documentation ...Done.


Installing WANPIPE include headers ...Done.

WANPIPE device drivers upgraded successfully!

Press [Enter] to continue... // 輸入Enter 鍵
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.

----------------------------------------------------------

WANPIPE KERNEL DRIVER COMPILATION

The next step in WANPIPE installation involves compiling
WANPIPE kernel modules.

This/>into the currently running linux kernel.

For greater customization you will be prompted to
select which Protocol/Drivers you would like to
build into the WANPIPE kernel modules.

Wanpipe for Asterisk/Dahdi/Zaptel
Default for Asterisk/Dahdi/Zaptel
Wanpipe for Wan Routing/API
Default for Wan/IP Routing and Data API
Wanpipe for Asterisk SMG/SS7
Default for Asterisk SS7
Wanpipe for TDM API
Default for FreeSwitch and Voice API

Custom Compilation:
------------------
Customise WANPIPE driver compilation to add only the
protocols that you need. This way one can reduce
the size of the WANPIPE kernel drivers.

Refer to http://wiki.sangoma.com for more info

grep: /lib/modules/2.6.32-358.23.2.el6.x86_64/build/include/include/autoconf.h: No such file or directory
grep: /lib/modules/2.6.32-358.23.2.el6.x86_64/build/include/include/autoconf.h: No such file or directory
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------


Please Select Compilation Mode

1. WAN Protocols Support
Protocols: Frame Relay, CHDLC, PPP, ATM, X25, ADSL, TDM API
Default for: Wan Routing, Data & Voice API devel.

2. Asterisk/Dahdi Support
Asterisk protocols: libpri (PRI,BRI), Analog (FXO/FXS), libss7 (SS7)
Default for: Asterisk

3. Asterisk/Dahdi + WAN Protocol Support

4. TDM API (libsangoma)
Protocols: TDM API (libsangoma) on AFT adapters:
Default for: FreeSWITCH, Yate, Sunrise
Custom voice development

5. Custom Compilation Mode
Specify protocols to be added into the WANPIPE
kernel drivers.

6. Deprecated: SMG (BRI) (Asterisk SMG/BRI [Use Asterisk/Dahdi option 2 instead])

7. Deprecated: SMG (BRI) + Asterisk/Dahdi [Use Asterisk/Dahdi option 2 instead]


Please select (1-7) [Default: 1]: 2 // 現在 2 在asterisk 環境下安裝E1 卡

Looking for zaptel/dahdi directory in /usr/src ...
-------------------------------------------
1 : /usr/src/dahdi-linux-complete-2.7.0.1+2.7.0.1
------------------------------------------
------------------------------------------
m : Enter zaptel path manually

(ctrl-c to Exit)
Please select working zaptel directory [1-1][m]: 1 // 輸入 1 選擇 dahdi 源代碼安裝路徑,如果dahdi 沒有安裝在默認的路徑下,需要手動添加路徑

Enabling the TDM Voice Asterisk Support

Dahdi HW HDLC Support Detected: Enabling DCHAN Feature
Native Dahdi HW HDLC Support Detected - No patch required
Dahdi source unmodified

Checking for UDEV Zaptel compatibility... Dahdi installed, no need to add UDEV rules
Enabling the AFT TE1 Support

Checking for SMP support ...Enabled.

Checking current processor type ...x86_64

Wan Update Flags: -DAF_WANPIPE_2612_FORCE_UPDATE -DWANPIPE_MOD_266_FORCE_UPDATE
Checking fo regparm: Disabled


--------------------------------------------------
CFLAGS: gcc -Wp,-MD,.wanpipe.o.d -nostdinc -iwithprefix include -D__LINUX__ -Dlinux -D__KERNEL__ -I/usr/include/wanpipe -I/lib/modules/2.6.32-358.23.2.el6.x86_64/build/include -DMODULE -DAF_WANPIPE_2612_FORCE_UPDATE -DWANPIPE_MOD_266_FORCE_UPDATE
--------------------------------------------------


Compiling General WANPIPE Driver for 2.6.X Kernel .....Done.


WAN HWEC module enabled and compiled!
Linking Wanpipe Driver and protocols ...Done.

Updating Kernel Modules ...Done.

Visually Confirm that driver compilation was successful! (y/n) y // 選擇 y
Compilation Successful.
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------

WANPIPE META CONFIGURATION

There are two configuration files associated with WANPIPE.

1) /usr/src/wanpipe-7.0.5/wanrouter.rc:
- defines locations of important files such as lock
and configuration files as well as start/stop
order of multiple WANPIPE devices.
2) /usr/src/wanpipe-7.0.5/wanpipe1.conf:
- main configuration file for each WANPIPE device.
- defines interfaces, hardware and protocol information.
- this file can be created using the 'wancfg' GUI
utility or manually based on sample files located
in /etc/wanpipe/samples.

Please read the WanpipeInstallation.(pdf/txt) manual for further
information.

Press [Enter] to continue... // 輸入 Enter

Wanpipe META config file found in /etc/wanpipe directory

Wanpipe startup sequence: wanpipe1

Would you like to keep the original wanpipe startup sequence? (y/n) y // 選擇 y

Please specify a desired location for WANPIPE configuration files.

(Press Enter for Default: /etc/wanpipe)

<specify>

Please specify a desired location for WANPIPE interface files.

(Press Enter for Default: /etc/wanpipe/interfaces)

<specify> // 摁Enter 鍵, 板卡配置文件路徑


Please specify a location for WANPIPE binary, firmware files.

(Press Enter for Default: /etc/wanpipe/firmware)

<specify> //摁 Enter 鍵。
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------

WANPIPE UTILITIES SETUP

WANPIPE utilities are used to:
1) create configuration files: for Zaptel and Asterisk
/usr/sbin/wancfg_dahdi#Dahdi and Asterisk
/usr/sbin/wancfg_zaptel#Zaptel and Asterisk
/usr/sbin/wancfg_smg#BRI/SS7, Dahdi/Zaptel and Asterisk
/usr/sbin/wancfg_tdmapi#TDM API
2) create WANPIPE WAN/IP configuration files.
(/usr/sbin/wancfg)
3) start,stop,restart individual/all devices and interfaces.
(/usr/sbin/wanrouter)
4) debug line, protocol and driver problems.
(/usr/sbin/wanpipemon)
5) aid in WANPIPE API development
(/etc/wanpipe/api)

Refer to the WanpipeInstallation.(pdf/txt) for more information.

Press [Enter] to continue... // 摁 Enter
Compiling WANPIPE LibSangoma API library ...Done.


Compiling WANPIPE LibStelephony API library ...Done.



Compiling WANPIPE Utilities ...Done.


Compiling WANPIPE WanCfg Utility ...Done.


Compiling WANPIPE LibStelephony API Library ... skipped, not required.



Compiling WANPIPE API Development Utilities ... skipped, not required.


Compiling WANPIPE HWEC Utilities ...Done.


WANPIPE Environment Setup Complete !!!

Press [Enter] to continue... // 摁 Enter 鍵
Installing WANPIPE Files ... !
Installing WANPIPE Utilities in /usr/sbin
Installing wanrouter.rc in /etc/wanpipe
Installing wanpipe libraries in /etc/wanpipe
Installing firmware in /etc/wanpipe/firmware
Installing documentation in /usr/share/doc/wanpipe
cp: omitting directory `doc/man'
Installing sample api code in /etc/wanpipe/api
Installing AFT Firmware update utility in /etc/wanpipe/util
Installing driver headers in /etc/wanpipe/api/include/linux
Installing Hardware Echo Cancel Utilites
Press [Enter] to continue... // 摁 Enter 鍵
----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------


WANPIPE BOOTSTRAP CONFIGURATION

Your system uses System V -style initialization/>to add router start-up/>automatically when system enters multi-user mode and shut down when it enters
single-user mode or when it is halted.

i.e. By selecting this option WANPIPE will startup on system bootup and
stop on system shutdown.

Would you like to install WANPIPE start-up/>
########################################################################
# Sangoma Wanpipe #
# Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script #
# v2.39 #
# Sangoma Technologies Inc. #
# Copyright(c) 2013. #
########################################################################

Current boot level is 3

Wanrouter boot/>
Removing existing wanrouter boot/>Verifying Zaptel boot/>Enabling wanrouter boot/>Enabling wanrouter shutdown scripts ...(level:91)

----------------------------------------------------------
WANPIPE v7.0.5 Installation Script
Copyright (c) 1995-2013, Sangoma Technologies Inc.
----------------------------------------------------------

WANPIPE INSTALLATON: COMPLETE

WANPIPE installation is now complete. WANPIPE kernel drivers
and configuration/debug utilities have been compiled and installed.

1) Proceed to configure the WANPIPE drivers:
Asterisk/Dahdi  : /usr/sbin/wancfg_dahdi
Asterisk/Zaptel  : /usr/sbin/wancfg_zaptel
TDM API  : /usr/sbin/wancfg_tdmapi
SMG SS7/BRI/PRI  : /usr/sbin/wancfg_smg
WAN Routing/API  : /usr/sbin/wancfg
2) Use the /usr/sbin/wanrouter startup/> the router. (eg: wanrouter start)
3) To uninstall WANPIPE package run ./Setup remove

Please read http://wiki.sangoma.com for further instructions.


Wanpipe / Zaptel Configuration
==============================

wancfg_zaptel configurator can create all wanpipe config files
for ZAPTEL including /etc/zaptel.conf file.
Optionally: the configurator can also create Asterisk zapata.conf
-----------------------------------------------------
Would you like to configure wanpipe devices for DAHDI? (y/n) y // 輸入 y

########################################################################
# Sangoma Wanpipe #
# Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script #
# v2.39 #
# Sangoma Technologies Inc. #
# Copyright(c) 2013. #
########################################################################

Would you like to generate /etc/asterisk/chan_dahdi.conf
1. YES
2. NO
[1-2]:1 // 輸入1 , 創建默認chan_dahdi.conf 文件

-------------------------------------------------------
Configuring T1/E1 cards [A101/A102/A104/A108/A116/T116]
-------------------------------------------------------
A101 detected on slot:4 bus:4

-----------------------------------------------------------
Configuring port 1 on A101 slot:4 bus:4.
-----------------------------------------------------------

Select media type for AFT-A101 on port 1 [slot:4 bus:4 span:1]
1. T1
2. E1
3. Unused
4. Exit
[1-4]:2 // 選擇 2, 配置為E1 類型

Configuring port 1 on AFT-A101 as E1, line coding:HDB3, framing:CRC4
1. YES - Keep these settings
2. NO - Configure line coding and framing
[1-2, ENTER='YES']:2 // 是否安裝HDB3, CRC4 方式創建文件;如果不帶CRC4, 選擇2, 修改配置文件

Select line coding for port 1 on 101
1. HDB3
2. AMI
[1-2, ENTER='HDB3']:1 // 選擇 1

Select framing for port 1 on 101
1. CRC4
2. NCRC4
3. UNFRAMED
[1-3, ENTER='CRC4']:2 // 選擇不支持CRC4

Select clock for AFT-101 on port 1 [slot:4 bus:4 span:1]
1. NORMAL
2. MASTER
[1-2]:1 // 選擇 1

Select signalling type for AFT-101 on port 1 [slot:4 bus:4 span:1]
1. Zaptel/Dahdi - PRI CPE
2. Zaptel/Dahdi - PRI NET
3. Zaptel/Dahdi - E & M
4. Zaptel/Dahdi - E & M Wink
5. Zaptel/Dahdi - FXS - Loop Start
6. Zaptel/Dahdi - FXS - Ground Start
7. Zaptel/Dahdi - FXS - Kewl Start
8. Zaptel/Dahdi - FX0 - Loop Start
9. Zaptel/Dahdi - FX0 - Ground Start
10. Zaptel/Dahdi - FX0 - Kewl Start
11. Sangoma SMG/sangoma_prid- PRI CPE
12. Sangoma SMG/sangoma_prid- PRI NET
[1-12]:1 // 選擇CPE 用戶側。運營商是網絡側


Select switchtype for AFT-101 on port 1
1. National ISDN 2
2. Nortel DMS100
3. AT&T 4ESS
4. Lucent 5ESS
5. EuroISDN
6. Old National ISDN 1
7. Q.SIG
[1-7]:5 // 選擇5


Would you like to enable hardware DTMF detection?
1. YES
2. NO
[1-2, ENTER='YES']:1 // 選擇 1

Would you like to enable hardware fax detection?
1. YES
2. NO
[1-2, ENTER='NO']:1 // 選擇 1

Configuring port 1 on AFT-101 as a full E1
1. YES - Use all channels
2. NO - Configure for fractional
[1-2, ENTER='YES']:1 // 使用所有通道

Select dialplan context for AFT-101 on port 1
1. from-pstn
2. from-internal
3. Custom
[1-3]:1 // 選擇1


Port 1 on AFT-A101 configuration complete...
Press any key to continue: // 摁Enter 繼續檢測安裝

T1/E1 card configuration complete.
Press any key to continue: // 摁 Enter 鍵,進行其他板卡檢測
-------------------------------------------
Configuring ISDN BRI cards [A500/B500/B700]
-------------------------------------------

No Sangoma ISDN BRI cards detected

Press any key to continue: // 摁 enter
------------------------------------

Configuring GSM cards [W400]
------------------------------------

No Sangoma GSM cards detected

Press any key to continue: // 摁Enter
------------------------------------
Configuring analog cards [A200/A400/B600/B610/B700/B800]
------------------------------------
------------------------------------
Configuring USB devices [U100]
------------------------------------

###################################################################
# SUMMARY #
###################################################################

1 T1/E1 port(s) detected, 1 configured
0 ISDN BRI port(s) detected, 0 configured
0 analog card(s) detected, 0 configured
0 GSM card(s) detected, 0 configured
0 usb device(s) detected, 0 configured

Configurator will create the following files:
1. Wanpipe config files in /etc/wanpipe
2. Dahdi config file /etc/dahdi/system.conf
3. chan_dahdi config file /etc/asterisk/chan_dahdi.conf


Your original configuration files will be saved to:
1. /etc/dahdi/system.conf.bak
2. /etc/asterisk/chan_dahdi.conf.bak


Your configuration has been saved in /etc/wanpipe/debug-2013-11-21.tgz.
When requesting support, email this file to [email protected]


###################################################################

Configuration Complete! Please select following:
1. YES - Continue
2. NO - Exit
[1-2]:1 // 選擇 1, 繼續配置


Dahdi and Wanpipe configuration complete: choose action
1. Save cfg: Restart Asterisk & Wanpipe now
2. Save cfg: Restart Asterisk & Wanpipe when convenient
3. Save cfg: Stop Asterisk & Wanpipe now

4. Save cfg: Stop Asterisk & Wanpipe when convenient
5. Save cfg: Save cfg only (Not Recommended!!!)
6. Do not save cfg: Exit
[1-6]:2 // 選擇 2 或者 3。


Stopping Asterisk...
Waiting for inactivity to perform halt

Stopping Wanpipe...


Shutting down wanpipe1 interface: w1g1
Shutting down device: wanpipe1
No devices running, Unloading Modules


Unloading Dahdi modules...
FATAL: Module dahdi is in use.
Error executing command:
modprobe -r dahdi // 忽略這些錯誤

Would you like to continue?
1. No - exit
2. YES
[1-2, ENTER='No']:1 2 // 選擇2


Removing old configuration files...

Copying new Wanpipe configuration files...

Copying new Dahdi configuration file (/etc/dahdi/system.conf)...

Copying new chan_dahdi configuration files (/etc/asterisk/chan_dahdi.conf)...

Starting Wanpipe...

Starting WAN Router...
Loading WAN drivers: wanpipe done.
Starting up device: wanpipe1
--> Loading ec image OCT6116-64S.ima...
Configuring interfaces: w1g1
done.

Loading Dahdi...
DAHDI Tools Version - 2.7.0.1

DAHDI Version: 2.7.0.1

Echo Canceller(s): HWEC
Configuration
======================

SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)

31 channels to configure.

Setting echocan for channel 1 to mg2
Setting echocan for channel 2 to mg2
Setting echocan for channel 3 to mg2
Setting echocan for channel 4 to mg2
Setting echocan for channel 5 to mg2
Setting echocan for channel 6 to mg2
Setting echocan for channel 7 to mg2
Setting echocan for channel 8 to mg2
Setting echocan for channel 9 to mg2
Setting echocan for channel 10 to mg2
Setting echocan for channel 11 to mg2
Setting echocan for channel 12 to mg2
Setting echocan for channel 13 to mg2
Setting echocan for channel 14 to mg2
Setting echocan for channel 15 to mg2
Setting echocan for channel 16 to none
Setting echocan for channel 17 to mg2
Setting echocan for channel 18 to mg2
Setting echocan for channel 19 to mg2
Setting echocan for channel 20 to mg2
Setting echocan for channel 21 to mg2
Setting echocan for channel 22 to mg2
Setting echocan for channel 23 to mg2
Setting echocan for channel 24 to mg2
Setting echocan for channel 25 to mg2
Setting echocan for channel 26 to mg2
Setting echocan for channel 27 to mg2
Setting echocan for channel 28 to mg2
Setting echocan for channel 29 to mg2
Setting echocan for channel 30 to mg2
Setting echocan for channel 31 to mg2

Starting Asterisk...
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

Listing Asterisk channels...

Chan Extension Context Language MOH Interpret Blocked State Description
pseudo default default In Service
1 from-pstn default In Service
2 from-pstn default In Service
3 from-pstn default In Service

4 from-pstn default In Service
5 from-pstn default In Service
6 from-pstn default In Service
7 from-pstn default In Service
8 from-pstn default In Service
9 from-pstn default In Service
10 from-pstn default In Service
11 from-pstn default In Service
12 from-pstn default In Service
13 from-pstn default In Service
14 from-pstn default In Service
15 from-pstn default In Service
17 from-pstn default In Service
18 from-pstn default In Service
19 from-pstn default In Service
20 from-pstn default In Service
21 from-pstn default In Service
22 from-pstn default In Service
23 from-pstn default In Service
24 from-pstn default In Service
25 from-pstn default In Service
26 from-pstn default In Service
27 from-pstn default In Service
28 from-pstn default In Service
29 from-pstn default In Service
30 from-pstn default In Service
31 from-pstn default In Service

Type "asterisk -r" to connect to Asterisk console


Wanrouter start complete...
Current boot level is 3

Wanrouter boot/>
Removing existing wanrouter boot/>Would you like wanrouter to start on system boot?
1. YES
2. NO
[1-2]:1 // 選擇 1

Verifying Dahdi boot/>Verifying Dahdi boot/>Verifying Dahdi shutdown/>Enabling wanrouter boot scripts ...(level:12)
Enabling wanrouter shutdown/>
Would you like to execute 'dahdi_cfg' each time wanrouter starts?
1. YES
2. NO
[1-2]:1 // 選擇 1

Removing old smg_ctrl boot.....OK
Removing old smg_ctrl_safe boot.....OK
Sangoma cards configuration complete, exiting...


You have new mail in /var/spool/mail/root
[root@localhost wanpipe-7.0.5]# 到此,板卡配置完成。如果是2,4,8,或者16E1板卡,腳本在安裝過程中會自動檢測
第2口,第3口,依此類推。重複執行相應的次數。
/<specify>/<specify>/<specify>/<code>

以下信息是驅動安裝時的提示一些特別說明信息,請選擇正確的選項。如果選擇錯誤,可以重新執行 linux 命令 setup-sangoma 來重新配置。以下信息是安裝過程中對中國用戶的選項,如果成功安裝,可以跳過 步驟 4.

<code>4)'''執行腳本安裝過程中,中國用戶需要選擇的選項''',請小心操作:
Select media type->E1 // 支持中國E1
Select linecode-> HDB3 // E1接口支持兩種線路編解碼格式:AMI格式和HDB3格式。默認HDB3
Select framing-> NCRC4 // 是否需要支持CRC4 校驗,如果不支持選擇此項。大多數中國客戶使用NCRC4
Select Clock-> Normal
Select Signalling type-> PRI CPE // 運營商端上NET 網絡側,本地必須選擇CPE 用戶側
Select switchtype -> EuroISDN
Select Configure port for full use->yes
Select Dialplan context-> PSTN // 注意,到這一步,一個端口就算配置完成了,腳本會重複配置 第2 口,3口。。直到配置完所有的板卡端口。
Configuration complete-> Yes
Dahdi and Wanpepe configuration complete-> 選擇 2
would you like to continue->Yes

would you like wanrouter to start on system boot-> yes
would you like to execute dahdi_cfg each time wanrouter starts-> 選擇 1
/<code>

第5章:配置驅動通道

腳本配置完成以後,執行這個命令:

<code>wanrouter hwprobe
/<code>

如果可以正確顯示板卡信息,和端口信息,說明板卡可以正常工作。如果出現報錯信息,請聯繫sangoma中國郵箱:[email protected]

檢查Wanpipe 配置文件

腳本會自動生成wanpipe 配置文件,在 /etc/wanpipe 目錄下,自動生成每個端口文件 /etc/wanpipe/wanpipe1.confwanpipe2.conf wanpipeX.conf 文件。 X 代表端口數。多少端口會有多少個相應的配置文件。例如,以下是端口1 的配置參數。

<code>#================================================
# WANPIPE1 Configuration File
#================================================
#
# Date: Wed Dec 6 20:29:03 UTC 2006
#
# Note: This file was generated automatically
# by /usr/local/sbin/setup-sangoma program.
#
# If you want to edit this file, it is
# recommended that you use wancfg program
# to do so.
#================================================
# Sangoma Technologies Inc.
#================================================

[devices]
wanpipe1 = WAN_AFT_TE1, Comment

[interfaces]
w1g1 = wanpipe1, , TDM_VOICE, Comment

[wanpipe1]
CARD_TYPE \t= AFT
S514CPU \t= A
CommPort \t= PRI
AUTO_PCISLOT \t= NO
PCISLOT \t= 4 // 綁定了PCI 4 插槽,如果換PCI插槽,需要重新執行腳本配置板卡
PCIBUS \t= 22
FE_MEDIA\t= E1
FE_LCODE\t= HDB3 // 線路編碼
FE_FRAME\t= NCRC4
FE_LINE\t\t= 1
TE_CLOCK \t= NORMAL // 本地是從時鐘,從運營商獲得時鐘。
TE_REF_CLOCK = 0
TE_SIG_MODE = CAS
TE_HIGHIMPEDANCE\t= NO
TE_RX_SLEVEL = 430
LBO \t\t= 120OH
FE_TXTRISTATE\t= NO
MTU \t\t= 1500
UDPPORT \t= 9000
TTL\t\t= 255
IGNORE_FRONT_END = NO
TDMV_SPAN\t= 1
TDMV_DCHAN\t= 16 // D 通道信令控制
TDMV_HW_DTMF\t= YES
TDMV_HW_FAX_DETECT = YES

[w1g1]
ACTIVE_CH\t= ALL
TDMV_HWEC\t= YES // 帶硬件回聲模塊的E1板卡
MTU \t\t= 8

/<code>

注意,如果修改了任何 wanpipeX.conf 或者system.conf 文件,都需要重新啟動wanpipe 驅動(建議重新啟動服務器環境)。 自動生成 /etc/dahdi/system.conf 自動生成 /etc/asterisk/chan_dahdi.conf

檢查硬件回聲模塊

執行命令 wanrouter hwprobe

<code>A200d : 32
A101d : 32
A102d : 64
A104d : 128
A108d : 256
A500d : 64
/<code>


檢查dahdi 配置文件 /etc/asterisk/chan_dahdi.conf

注意,此配置文件是4E1板卡配置文件,根據購買的板卡端口數量,配置文件的通道數有所不同!

<code>#autogenerated by /usr/sbin/wancfg_dahdi do not hand edit
#autogenrated on 2011-10-09
#Dahdi Channels Configurations
#For detailed Dahdi options, view /etc/dahdi/system.conf.bak
loadzone=cn
defaultzone=cn

#Sangoma A104 port 1 [slot:4 bus:22 span:1] <wanpipe1>
span=1,1,0,ccs,hdb3
bchan=1-15,17-31
hardhdlc=16
# echocanceller=mg2,1-15,17-31 // 如果帶硬件回聲模塊,需要註釋掉這一行配置。如果軟件回聲模塊,打開註釋。
#Sangoma A104 port 2 [slot:4 bus:22 span:2] <wanpipe2>
span=2,2,0,ccs,hdb3
bchan=32-46,48-62
# echocanceller=mg2,32-46,48-62
hardhdlc=47

#Sangoma A104 port 3 [slot:4 bus:22 span:3] <wanpipe3>
span=3,3,0,ccs,hdb3
bchan=63-77,79-93
# echocanceller=mg2,63-77,79-93
hardhdlc=78

#Sangoma A104 port 4 [slot:4 bus:22 span:4] <wanpipe4>
span=4,4,0,ccs,hdb3
bchan=94-108,110-124
# echocanceller=mg2,94-108,110-124
hardhdlc=109
/<wanpipe4>/<wanpipe3>/<wanpipe2>/<wanpipe1>/<code>

檢查asterisk 應用層chan_dahdi.conf 通道配置文件

<code>;autogenerated by /usr/sbin/wancfg_dahdi do not hand edit
;autogenrated on 2011-10-09
;Dahdi Channels Configurations
;For detailed Dahdi options, view /etc/asterisk/chan_dahdi.conf.bak

[trunkgroups] // 默認的sangoma 腳本可能丟失此標籤,需要手動添加

[channels] // 默認的sangoma 腳本配置可能丟失此標籤,需要手動添加,否則asterisk CLI命令: dahdi show channels 無任何顯示結果
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
pridialplan=local // 支持PRI 撥號規則本地用戶
prilocaldialplan=local
;Uncomment these lines if you have problems with the disconection of your analog lines

#include dahdi-channels.conf
#include chan_dahdi_additional.conf


/<code>

以下是dahdi-channels.conf 文件,包含4個端口的124個通道

<code>; Span 1: WPE1/0 "wanpipe1 card 0" (MASTER) 
group=0
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31 // 如果是A101 線路,顯示31 路
context = default
;group = 63

; Span 2: WPE1/1 "wanpipe2 card 1"
group=1
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 32-46,48-62
context = default
;group = 63

; Span 3: WPE1/2 "wanpipe3 card 2"
group=2
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 63-77,79-93
context = default
;group = 63

; Span 4: WPE1/3 "wanpipe4 card 3"
group=3
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 94-108,110-124
context = default
;group = 63

/<code>

檢查通道的狀態

Sangoma 語音板卡的安裝步驟已經完成,如果以上這些步驟沒有任何錯誤的話,客戶在呼叫之前需要確認以下幾個技術參數,然後再進行通話測試。

<code>1) 登錄系統後臺,執行命令 dmesg, 檢查打印信息,確認沒有任何和板卡dahdi相關的報錯信息。
2) 啟動asterisk,執行asterisk -r, 進入asterisk CLI 後臺,確認:
3) 執行命令:dahdi show channels, 如果顯示有通道數量,說明通道配置正確。
4) 執行 pri show spans, 如果顯示了spans 的數量,而且是 up,active 說明系統正常,可以呼入測試。
5)執行 pri show spans,如果狀態顯示是down inactive/active, 檢查配置或者硬件板卡。
/<code>

在5)執行以後,如果出現down,inactive, 狀態退出asterisk CLI 命令。確認wanrouter start 已經執行,並且成功啟動,執行Sangoma工具檢測命令:

<code>wanpipemon -i w1g1 -c Ta  // wX 代表 端口X,現在是w1 代表 1口,w2 代表2口,以此類推。
**** w1g1: E1 Rx Alarms (Framer) *****
ALOS:OFF| LOS:OFF
RED:ON| AIS:OFF
LOF:ON| RAI:ON // 確認所有告警信息是OFF 狀態,如果是ON 狀態,檢查CRC4, 物理連接,BNC頭TX/RX 接線順序。
***** w1g1: E1 Rx Alarms (LIU) *****
Short Circuit:OFF
Open Circuit:OFF
Loss of Signal:OFF
***** w1g1: E1 Tx Alarms *****
AIS:OFF| YEL:ON
***** w1g1: E1 Performance Monitoring Counters *****
Line Code Violation: 120472300
Far End Block Errors: 0
CRC4 Errors: 0
FAS Errors: 48
Rx Level: -15db to -17.5db // 注意 Rx level 顯示的值。如果例如-32db to -36db, -26db to -29db

/<code>

說明RJ48或者BNC頭有物理檢測不良,或者BNC頭接反(tx/rx長短方向對調),請檢查更換!

  • 請運營商技術人員現場做迴環測試,確認線路正常。
  • 檢查BNC RX/TX 是否接反,或者RJ48配線,水晶頭是否良好。

以下是正常的線路連接 Rx level:

<code>執行命令:wanpipemon -i w1g1 -c Ta, 注意以下所有告警信息是正常狀態,說明物理連接正常。如果有告警信息是ON狀態,需要重新檢查。

***** w1g1: E1 Rx Alarms (Framer) *****
ALOS: OFF | LOS: OFF
RED: OFF | AIS: OFF
LOF: OFF | RAI: OFF
***** w1g1: E1 Rx Alarms (LIU) *****
Short Circuit: OFF
Open Circuit: OFF
Loss of Signal: OFF
***** w1g1: E1 Tx Alarms *****
AIS: OFF | YEL: OFF
***** w1g1: E1 Performance Monitoring Counters *****
Line Code Violation : 330
Far End Block Errors : 4215
CRC4 Errors : 0
FAS Errors : 3

Rx Level : > -2.5db // 良好的線路物理連接,值應該是-2.5db
/<code>

以上命令中,如果滿足第4步的要求,可以進行呼入測試;

第6章:測試呼叫

這裡,我們介紹的只是一個非常簡單的呼入呼出例子。客戶可以根據自己的業務需求開發呼叫中心,錄音,語音IVR等等應用業務。測試用例的目的是測試語音板卡是否正常工作。測試呼叫之前,需要修改撥號規則配置文件/etc/asterisk/extensions.conf.添加以下撥號規則,重新在asterisk 後臺執行 relaod 命令,重新加載修改的數據,使之生效!建議用戶首先測試呼入的功能,然後測試呼出的功能!

呼入測試

<code>[from-pstn]   // 注意,這裡的from-pstn 必須對應 chan_dahdi.conf 裡面的context 
exten => s,1,Answer() // 應答一個呼入電話
exten => s,n,Playback(cc_welcome) // 播放歡迎信息,呼叫者將會聽到播放的語音。
exten => s,n,Hangup() // 播放結束,掛機
/<code>

呼出測試

如果呼入測試正常,可以做呼出測試。1) 呼出測試之前,必須在extensions.conf 文件添加以下內容,然後建立終端分機或者軟電話。

<code>[from-internal]
exten => 100,1,Dial(dahdi/1/18665XXXXXX)
exten => 100,2,Hangup
/<code>

2) 使用101分機,撥100 呼出測試,通過dahdi 通道1呼出到18665XXXXXXX 手機。當然可以通過任何一個B通道呼出到任何一個有效的電話號碼。3)如果呼入呼出正常,說明語音板卡可以正常工作。

第7章:E1語音板卡知識庫

1)Sangoma A1XX 線路數字語音板卡支持E1 支持30B+D PRI(PRA),速率是2.048Mbit/s ,默認使用成復幀的E1中,除了第0時隙外,第16時隙(D 通道)是用於傳輸信令的,只有第1(B 通道)到15,第17到第31共30個時隙可用於傳輸有效數據或者語音2)安裝sangoma 語音板卡時需要注意阻抗/幀結構/CRC4校驗,如果以上數據出現雙方不匹配,可能導致不通/誤碼/滑碼/失步等問題,請聯繫運營商確認以上參數必須和本地完全匹配。3) Sangoma 板卡的主要應用環境:呼叫中心,電子傳真,企業IVR服務,落地,語音轉換。4) Sangoma 板卡是否支持滿配?是的,1:1 滿配。保證30路滿負荷,語音清晰。5) 查看E1語音板卡的物理連接是否良好,E1線路狀態診斷工具6) E1 PRI線路聽不到彩鈴或者語音提示,修改撥號規則(extensions.conf),在dial 命令前添加 progress(),例如:

<code>exten => _X.,1, Progress()
exten => _X.,n, Dial(dahdi/g0/1866512XXXX) /<code>


分享到:


相關文章: