DAHDI板卡的配置文件說明

有許多公司生產用於 Asterisk 的 PSTN 板卡。這些板卡需要安裝驅動程序,這樣 Linux纔可以識別
它們 (DAHDI 包含了 Digium 的板卡驅動) 。 從這一點看, 配置是被 Asterisk module chan_dahdi 處理的。

 當安裝電話板卡硬件時,請確保升級了  /etc/dahdi/modules  文件以使能與你的硬件適應的 modules,
然後通過初始化腳本(/etc/init.d/dahdi)重載DAHDI,你也可以使用 dahdi_genconf modules 命令生成  modules  文件

 要配置一張FXO板卡能夠在Asterisk系統上工作,需要修改以下的兩個文件:
  /etc/dahdi/system.conf //這個是DAHDI的配置文件,主要用來指定系統中可用的Channels
  /etc/asterisk/chan_dahdi.conf //這個主要是告訴Asterisk系統中有效的Channels以及它們各自使用的信令。

 下面假設我這裏有一張DAHDI的板卡,上面有4個FXO端口,/etc/dahdi/system.conf的內容如下:
  
# Echo Cancellers
 迴音抵消器
# ^^^^^^^^^^^^^^^
# DAHDI uses modular echo cancellers that are configured per channel. The echo
 DAHDI在每個通道上的迴音抵消器是模塊化的。
# cancellers are compiled and installed as part of the dahdi-linux package.
 迴音抵消器作爲dahdi-Linux包的一部分被編譯和安裝
# You can specify in this file the echo canceller to be used for each
 你可以在本文件中爲每個通道指定其使用的迴音抵消器
# channel. The default behavior is for there to be NO echo canceller on any
  默認每個通道上是沒有任何迴音抵消器的
# channel, so it is very important that you specify one here.
  所以你在這裏設置迴音抵消器是非常重要的。
# Valid echo cancellers are: hwec, mg2, kb1, sec2, and sec.
 可用的迴音抵消器有:hwec   mg2  kb1  sec2   sec
# 'hwec' is a special echo canceller that should be used if hardware echo
hwec是一個特別的迴音抵消器,如果硬件迴音抵消器想在指定的通道上可用
# cancellation is desired on and available on the specified channels.

# If compiled, 'hpec' is also a valid echo canceller.
hpec也是一個可用的迴音抵消器,如果編譯了的話。
# To configure the default echo cancellers, use the format:
   配置默認的迴音抵消器,用法如下:
# echocanceller=<echocanceller name>,<channel(s)>
#
# Example:例如:
# Configure channels 1 through 8 to use the mg2 echo canceller
配置通道1到通道8使用mg2迴音抵消器,如下:
#echocanceller=mg2,1-8
#
# And change channel 2 to use the kb1 echo canceller.
  通道2使用kb1迴音抵消器,如下:
#echocanceller=kb1,2


  loadzone = us //我的理解是區域(國家的代碼,兩個字母如:中國=cn)的選擇,然後板卡會根據你的區域來播放匹配的音樂如:撥號音、忙音等
  defaultzone = us //設置默認的區域
  fxsks = 1-4 //指定板卡上使用FXS信令的通道,也就是FXO端口有哪些。
  echocanceller=oslec,1-4 //指定通道1-4所使用的 迴音抵消器

 一旦你的板卡上的channels被操作系統所識別,那麼你就必須在/etc/asterisk/chan_dahdi.conf文件中來配置,以讓asterisk來知道有哪些channels
在板卡上是可以使用的。/etc/asterisk/chan_dahdi.conf的內容如下:

/etc/asterisk/chan_dahdi.conf
  [channels]
  signalling = fxs_ks   //指定Channels所使用的信令爲FXS_KS
  channel => 1-4 //定義可以使用的Channels爲1、2、3、4
  context = fxo-incoming  //定義呼叫開始的context
 在這個例子中,我們告訴 Asterisk,系統中的頭 4 個 DAHDI channels 是 FXO 端口

------------------------------------------------------------------------------------------------------------------
 在這個配置文件中還可以配置一個通道組group,然後把這些通道都加入到相應的組中。
Channels and Groups
There are three different kind of groups in Asterisk:
在Asterisk中有三種不同的Group
(1) group=blah
— This is used to bundle (typically trunk) interfaces together so that you can use something like Dial,Zap/g2/.... to use any of the channels in group 2.
 這種是用在中繼線路中的,你可以用“Dial,Zap/g2/” 來使用group 2中的任何一個線路
(2) callgroup=blah
— This is a list of group memberships that you belong to for call pickup purposes
 
(3) pickupgroup=blah
— This is a list of groups that you are permitted to pickup in.

For #2 and #3, basically, you just dial *8# and you can pickup a ringing phone if you have a group in your pickupgroup that is in their callgroup.

hint: pickupgroup is for FXS interfaces while callgroup is for FXO interfaces.
-----------------------------------------------------------------------------------------------
group = 1
channel => 1-4
group = 1,2
channel => 5-6
group = 2,3
channel => 7-8
group = 4
channel => 9-12
group =
channel => 13-16


Channnels 1-4 are in just group 1.
Channels 5 and 6 are in groups 1 and 2.
Channels 7 and 8 are in groups 2 and 3.
Channels 9-12 are in group 4, and
Channels 13-16 are in no groups... so...


1,1,Dial,Zap/g1...would give you the first channel in the range 1-6 that was available.
 將會把group 1中可用的,第一個通道給你使用。
1,1,Dial,Zap/G1...would give you the largest channel in the range 1-6 that was available see http://www.voip-info.org/wiki/view/Asterisk+ZAP+channels.
 將會把group 1中可用的,最大的那個通道給你用。
1,1,Dial,Zap/g2...would give you the first channel in the range 5-8 that was available.

1,1,Dial,Zap/g3...would give you the first channel in the range 7-8 that was available

1,1,Dial,Zap/g4...would give you the first channel in the range 9-12 that was available.
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章