Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3519657
  • 博文数量: 534
  • 博客积分: 11595
  • 博客等级: 上将
  • 技术积分: 5785
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-22 17:00
文章分类

全部博文(534)

文章存档

2015年(4)

2014年(27)

2013年(15)

2012年(38)

2011年(36)

2010年(85)

2009年(63)

2008年(142)

2007年(124)

分类: LINUX

2014-01-18 14:41:48

dahdi卡

# lspci –vvvv
Network controller

# yum install kernel-devel
reboot

# cd /usr/src/dahdi-linux-complete-XX
# cd linux
# make
# make install
# cd tools
# ./configure
# make
# make install
# make config

最后会提示
DAHDI has been configured.
List of detected DAHDI devices:
pci:0000:02:09.0     wctdm-       e159:0001 Wildcard TDM400P REV I
run ‘dahdi_genconf modules’ to load support for only
the DAHDI hardware installed in this system.  By
default support for all DAHDI hardware is loaded at
DAHDI start.
make[1]: Leaving directory `/root/install/dahdi-linux-complete-2.4.1.2+2.4.1/tools’
注意这里的wctdm-表示驱动尚未生效。


# cd ../asterisk-1.8.0 # ./configure # make # make install # make config


# modprobe dahdi
# modprobe wctdm opermode=CHINA  (模拟卡)
# modprobe wct4xxp  (4e1)
# modprobe wcte11xp (D110P/D110E)
# modprobe opvxd115 (DE110P_DE110E)



读opermode确认参量已经被加载了
cat /sys/module/wctdm/parameters/opermode
如果用opvxa1200, 请按下面的命令执行:
cat /sys/module/opvxa1200/parameters/opermode
加载了驱动之后,运行dmesg命令去检查这个mode.

opermode修改
具体步骤如下:
运行:
1)首先停止asterisk
asterisk -r
> stop now

2)然后退出asterisk的CLI命令行进入Linux Shell命令行, 依次运行下列命令
service dahdi stop
modprobe dahdi
modprobe wctdm opermode=CHINA
dahdi_cfg -vvvv

3)运行下列命令: 确定opermode已经修改成功
cat /sys/module/wctdm/parameters/opermode
如果结果显示CHINA表示成功

4)重启asterisk
asterisk -vvvvvvvvgc

以A1200P和中国模式为例
在文件/etc/modprobe.d/dahdi.conf中添加一行:
options opvxa1200 opermode=CHINA
然后重启系统就可以了。




# dahdi_genconf
/usr/sbin/dahdi_genconf: Failed to open /etc/asterisk/dahdi-channels.conf: No such file or directory
如果有提示有个asterisk的一个文件没有找到没有关系的。

# echo "#include dahdi-channels.conf" >> /etc/asterisk/chan_dahdi.conf


system.conf
loadzone = cn
defaultzone = cn
/etc/asterisk/indications.conf
country=cn

# dahdi_cfg –vvvvvv
localhost*CLI> dahdi show channels
dahdi_hardware
pci:0000:02:09.0     wctdm+       e159:0001 Wildcard TDM400P REV I
可以看到+号,表示驱动已经生效。
这是时候可以看到卡上的4个绿灯长亮。

 

ls /dev/dahdi/
1  2  3  4  channel  ctl  pseudo  timer  transcode
可以看到设备文件已经创建

cat /proc/dahdi/1
Span 1: WCTDM/4 “Wildcard TDM400P REV I Board 5″ (MASTER)
1 WCTDM/4/0
2 WCTDM/4/1 FXSKS RED
3 WCTDM/4/2 FXSKS RED
4 WCTDM/4/3 FXSKS RED
这里可以看到卡的插线状态 S口因为没有接计算机电源因此没有任何状态。
3个O口 的RED表示入局电话线没有信号(没有插电话线)。

lspci
02:09.0 Network controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface
可以看到TDM400P卡的中断号码




PRI

asterisk cli  pri show spans
PRI span 1/0: Provisioned, In Alarm, Down, Active (没通)
PRI span 1/0: Provisioned, Up, Active (通了)
日志 /var/log/asterisk/full

prilocaldialplan
pridialplan

  1. ; unknown: Unknown
  2. ; private: Private ISDN
  3. ; local: Local ISDN
  4. ; national: National ISDN
  5. ; international: International ISDN
  6. ; dynamic: Dynamically selects the appropriate dialplan
  7. ; redundant: Same as dynamic, except that the underlying number is not
  8. ; changed (not common)





pridialplan: Sets an option required for some (rare) switches that require a dialplan parameter to be passed. This option is ignored by most PRI switches. It may be necessary on a few pieces of hardware. Valid options are: unknown, local, private, national, and international. This option can almost always be left unchanged from the default. Default: national.
pridialplan=local 
pridialplan设置为某些需预先传入参数的交换设备设定预先传入参数选项。大多数pri交换机会忽略这个选项,很少数交换机是需要的。正确的选项值为,unknown,local,private,national以及international。

ISDN PRI Switch Configuration
If you have a PRI line, specify your type of switch here. (PRI is a type of ISDN typically used to connect a PBX to a telephone exchange. They have multiple channels on the one connection.)
如果有Pri线路,需要定义交换类型。(pri是ISDN的一种类型,用于连接交换设备,有多种通道类型)

switchtype: Sets the type of PRI switch being used. Default: national. Acceptable values are:

national: National ISDN type2 (common in the US)
ni1: National ISDN type 1
dms100: Nortel DMS100
4ess: AT&T 4ESS
5ess: Lucent 5ESS
euroisdn: EuroISDN
qsig: Minimalistic protocol to build a "network" with two or more PBX of different vendors!







lsmod | grep dahdi

driver should be 'wctdm' but is actually 'netjet'

echo "blacklist netjet" >> /etc/modprobe.d/dahdi.blacklist.conf
reboot
modprobe
wcb4xxp


Zaptel DAHDI 说明
ztcfg -vv  dahdi_cfg -vv  分析system.conf,配置语音卡参数
zttool  dahdi_tool  语音卡检测、测试
genzaptelconf  dahdi_genconf  生成Asterisk配置文件/etc/dahdi/system.conf 
ztmonitor   dahdi_monitor 监控录音某个通道
ztscan  dahdi_scan 扫描通道状态
ztspeed  dahdi_speed 测试CPU占用率
zttest  dahdi_test 中断稳定性测试
ztloop  dahdi_loop 自环测试E1数字中继语音卡
dahdi_hardware,显示检测到的DAHDI 硬件列表。

Zaptel 文件名 DAHDI 文件名 说明
/etc/zaptel.conf  /etc/dahdi/system.conf  主要的配置文件 
/etc/sysconfig/zaptel  /etc/dahdi/modules, /etc/dahdi/init.conf  开机启动参数设置 
/etc/init.d/zaptel  /etc/init.d/dahdi  开机自动载入 
/etc/asterisk/zapata.conf  /etc/asterisk/chan_dahdi.conf  Asterisk 配置文件 

查模拟语音卡的IRQ中断
cat /proc/interrupts

85,如何用fxstest测试DAHDI FXS模块

硬件环境:A800P(2FXS+1FXO),A400P(2FXS+1FXO),步步高6082G来电显示有绳电话

软件环境:Centos5.5,dahdi-linux-complete-2.3.0.1+2.3.0

编译安装:

1.输入以下命令:

#cd /usr/src/dahdi-linux-complete-2.3.0.1+2.3.0/tools 
#make menuselect

选择“fxstest”,然后选择“Save&Exit”保存退出。

2. 开始编译dahdi。输入以下命令:

#cd /usr/src/dahdi-linux-complete-2.3.0.1+2.3.0
#make
#make install
#make config

 3. 重新加载驱动。

#service dahdi stop
#modprobe –r wctdm
#modprobe –r opvxa1200
#modprobe –r dahdi
#modprobe dahdi
#modprobe opvxa1200 opermode=CHINA
#modprobe wctdm opermode=CHINA
#dahdi_genconf
#dahdi_cfg –vvv (如果没有报错,则表示已经OK)
#dahdi_scan (此命令可以看到语音卡的基本信息及通道信息)

开始测试:

fxstest命令有两个固定参数。第一个需要指定操作的设备文件,如/dev/dahdi/1。第二个参数则是需要操作的命令。测试时,FXS口需要接上电话机,不能启动asterisk。

1. 查看电压伏特数

# fxstest /dev/dahdi/1 stats //A800P第一个通道的电压
TIP: -5.6400 Volts
RING: -54.1440 Volts
VBAT: -62.7920 Volts
#fxstest /dev/dahdi/11 stats //A400P第三个通道的电压
									

TIP: -5.6400 Volts RING: -54.8960 Volts

VBAT: -63.9200 Volts

2. 查看内核寄存器

# fxstest /dev/dahdi/1 regdump //A800P第一个通道的寄存器
Direct registers: 
0. 05 1. 28 2. 18 3. 00 4. 18 5. 00 6. 00 7. 00 
8. 00 9. 00 10. 08 11. 33 12. 80 13. 10 14. 00 15. 00 
…

Indirect registers: 
0. 55c2 1. 51e6 2. 4b85 3. 4937 4. 3333 5. 0202 
6. 0202 7. 0198 8. 0198 9. 0611 10. 0202 11. 00e5 
…

3. 播放一串音调。

# fxstest /dev/dahdi/1 tones 

这时拿起电话,可以听到一串音调。按CTRL+C中止。


4. 传送dtmfcid。

#fxstest /dev/dahdi/1 dtmfcid 
Going to send a set of DTMF tones >A5551212C<
Phone is ringing
Ringing Done

电话振铃时,可以看到来电显示传送的cid:5551212

5. 测试极性反转。(此项测试必须要在传送dtmfcid之后,才能正常显示反转信息)

# fxstest /dev/dahdi/1 polarity
 Twiddling polarity...
 Polarity is forward...
 Polarity is reversed...
 Polarity is forward...

6. 发送一串dtmf信号(“-”表示没有发送信号)。

# fxstest /dev/dahdi/1 dtmf "12324" 70
Going to send a set of DTMF tones >12324<
Using a duration of 70 mS per tone

这时可以在电话来电显示上看到发送的字符串“12324”,注意:时间要在70ms或以上才能显示完整的字符串。

7. 触发语音信箱等待指示灯、HV、NEON。(A800P不支持此项测试)

# fxstest /dev/dahdi/11 vmwi
Twiddling vmwi ...
Set 1 Voice Message...
Set 2 Voice Messages...
Set No Voice messages...
# fxstest /dev/dahdi/11 hvdc
Twiddling hvdc ...
Set 1 Voice Message...
Set 2 Voice Messages...
Set No Voice messages...
# fxstest /dev/dahdi/11 neon
Twiddling neon ...
Set 1 Voice Message...
Set 2 Voice Messages...
Set No Voice messages...



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

[trunkgroups]  ;定义一个主干组

; define any trunk groups

[channels]    ;硬件通道和他们选项信令方式.

; hardware channels  ;硬件通道

; default  ;默认 

busydetect=yes   ;增加这两行,否则FXO口不能检测到挂机信号。
busycount=5 

usecallerid=yes    ;设置来电显示

hidecallerid=no    ;设置去电不隐藏号码

callwaiting=yes   ;设置呼叫等待

threewaycalling=yes   ;开启三方通话(先闪断,再呼叫第三方,再闪断,就可以实现三方通话)

transfer=yes    ;转叫前转(需要三方通话支持)

echocancel=yes   ;回声消除

echotraining=yes   ;回音练习(会话前发个声音,用于测试回声)

; define channels  ;定义通道

context=from-internal    ; Context内执行指令需要在extensions.conf内定义 [from-internal]

signalling=fxs_ks    ;FXO通道使用FXS信令

channel => 2 ; PSTN放在端口2上


Zap Channel Module ConfigurationThe module permits Asterisk to communicate with the Zaptel device driver, used to access telephony interface cards. You configure Asterisk's Zap channel module in the zapata.conf file.
Zap channel模块允许Asterisk与zaptel驱动程序之间通讯。通过配置zapata.conf文件实现

You will need the Zaptel kernel module device driver installed. See:


Although is not directly related to Zapata hardware, it uses a pseudo-TDM engine, and gets configured here.

Using MySQL For Zap Channel ConfigurationIt is possible to store configuration settings for the Zap channel driver in a MySQL table, rather than editing the zapata.conf text file. You will have to compile a version of Asterisk with this support built in. See:
可以把zap channel而配置存储在mysql表中,而不是zapatap.conf中,这需要版本支持


The rest of this page assumes you are editing the zapata.conf file by hand.

Creating ChannelsThe format of the zapata.conf file is unfortunately not as simple as it could be. Most keywords do not do anything by themselves; they merely set up the parameters of any channel definitions that follow. The channel keyword actually creates the channel, using the settings specified before it. For example, you might create two channels like this:
zapata.conf文件,没有看上去那么复杂,大多数关键词自己不做什么,仅仅是定义通道参数,channel关键词才是真正的创建通道。

    signalling=fxo_ks
    language=en
    context=reception
    channel => 1

    signalling=fxo_ks
    language=fr
    context=sales
    channel => 2

This creates channel 1 with a default language code "en" and a context "reception". Channel 2 has a default language code "fr" and context "sales".

This is important, if you put something like echocancel=no before the channel definition, it will effect all channels unless you turn it on later with echocancel=yes. It progresses downward, but the definition must be above the channel=> statement.
非常重要的是,如果例如在通道前定义echocancel=no,会使影响所有通道,直到定义echocancel=yes,他会往下执行,因此,定义必须在channel=>前面进行定义

Available Settings
Signalling TypeThe signalling type to use with your interface is the only mandatory setting. You must set a signalling type before allocating a channel. If you are connecting analog telephone equipment, note that analog phone signalling can be a source of some confusion. FXS channels are signalled with FXO signalling, and vice versa. Asterisk 'talks' to internal devices as the opposite side. An FXO interface card is signalled with FXS signalling by Asterisk, and should be configured as such.
信令类型是唯一强制设置,在分配一个通道之前,必须定义信令类型。如果连接的模拟电话设备,注意模拟信令是导致混乱的来源。FXS通道采用FXO信令,反之,Asterisk通知内部设备采用相反方式。FXO接口卡采用FXS信令,同样须定义。

signalling: Sets the channel signaling type. These parameters should match the . The setting to use depends partly on which interface card you have. Asterisk will fail to start if a channel signaling definition is incorrect or unworkable, if the statements do not match the Zaptel driver configuration, or if the device is not present or properly configured. The correct setting to use is almost certainly one of the following four: fxs_ks, fxo_ks, pri_cpe or pri_net. This setting has no default value; you must set a value before allocating a channel. Asterisk supports the following signalling types:
signalling:设置通道信令类型,这些参数须与zaptel驱动配置匹配。设置基于采用什么样的板卡,如果通道信令设置错误,如果配置描述与zaptel驱动配置不匹配,或者如果卡不存在而配置正确,Asterisk不会工作。正确的设置通常包含下面4中信令中一种,fxs_ks, fxo_ks, pri_cpe or pri_net。该设置没有缺省值,必须在分配通道前设置信令值,下面是Asterisk支持的信令类型。

  • em: E & M Immediate Start
  • em_w: E & M Wink Start
  • em_e1: E & M CAS signalling for E1 lines
  • featd: Feature Group D (The fake, Adtran style, DTMF)
  • featdmf_ta: Feature Group D (The real thing, MF (domestic, US)) through a Tandem Access point
  • fgccama Feature Group C-CAMA (DP DNIS, MF ANI)
  • fgccamamf Feature Group C-CAMA MF (MF DNIS, MF ANI)
  • featdmf: Feature Group D (The real thing, MF (domestic, US))
  • featb: Feature Group B (MF (domestic, US))
  • fxs_ls: FXS (Loop Start)
  • fxs_gs: FXS (Ground Start)
  • fxs_ks: FXS (Kewl Start)
  • fxo_ls: FXO (Loop Start)
  • fxo_gs: FXO (Ground Start)
  • fxo_ks: FXO (Kewl Start)
  • pri_cpe: PRI signalling, CPE side
  • pri_net: PRI signalling, Network side (for instance, side that provides the dialtone)
  • sf: SF (Inband Tone) Signalling
  • sf_w: SF Wink
  • sf_featd: SF Feature Group D (The fake, Adtran style, DTMF)
  • sf_featdmf: SF Feature Group D (The real thing, MF (domestic, US))
  • sf_featb: SF Feature Group B (MF (domestic, US))
  • e911: E911 (MF) style signalling. Originating switch goes off-hook, far-end winks, originating sends KP-911-ST, far-end gives answer supervision, Originating-end sends KP-0-ANI-ST
  • The following are used for Radio interfaces:
  • fxs_rx: Receive audio/COR on an FXS kewlstart interface (FXO at the channel bank)
  • fxs_tx: Transmit audio/PTT on an FXS loopstart interface (FXO at the channel bank)
  • fxo_rx: Receive audio/COR on an FXO loopstart interface (FXS at the channel bank)
  • fxo_tx: Transmit audio/PTT on an FXO groundstart interface (FXS at the channel bank)
  • em_rx: Receive audio/COR on an E&M interface (1-way)
  • em_tx: Transmit audio/PTT on an E&M interface (1-way)
  • em_txrx: Receive audio/COR AND Transmit audio/PTT on an E&M interface (2-way)
  • em_rxtx: same as em_txrx (for our dyslexic friends)
  • sf_rx: Receive audio/COR on an SF interface (1-way)
  • sf_tx: Transmit audio/PTT on an SF interface (1-way)
  • sf_txrx: Receive audio/COR AND Transmit audio/PTT on an SF interface (2-way)
  • sf_rxtx: same as sf_txrx (for our dyslexic friends)

PRI通道存在一个空闲Extension和一个微小闲置数字,只要闲置通道是空闲的,ZAP通道模块就会尝试在该通道上进行空闲拨号,然后Asterisk就会执行定义为idelext的Context和Extension中的命令。当通道需要进行语音呼叫时,'空闲'呼叫会断开并让多数通道有效。(当然尽管有微小闲置呼叫正在运行)。主要的用途是创建动态的服务,当闲置通道绑定了multilnk ppp协议后,将比传统的多重映射提供更有效率的提供综合的语音/数据服务。

minunused: The minimum number of unused channels available. If there are fewer channels available, Asterisk will not attempt to bundle any channels and give them to the data connection. Takes an integer.
minunused:最小可用闲置通道的数量。如果有很少的通道可用,Asterisk不会尝试捆绑任何通道进行数据连接。该参数需要一个整数。
minidle: The minimum number of idle channels to bundle for the data link. Asterisk will keep this number of channels open for data, rather than taking them back for voice channels when needed. Takes an integer.
minidle:最小绑定进行数据连接的通道数量,Asterisk会为数据开启这个通道数量,而不是在需要的时候返回到语音通道的使用上。该参数需要一个整数。

idledial: The number to dial as the idle number. This is typically the number to dial a Remote Access Server (RAS). Channels being idled for data will be sent to this extension. Takes an integer that does not conflict with any other extension in the Dialplan, and has been defined as an idleext.
idledial: 空闲拨号的数量,这是用于拨叫远程访问服务器最基本的一个数字,为数据预留的闲置通道被这个分机。该参数需要一个整数,与在拨号方案中定义了idleext的分机不会产生冲突。

idleext: The extension to use as the idle extension. Takes a value in the form of exten@context. Typically, the extension would be an extension to run the command.
idleext:用于空闲分机的extension,以[url=]exten@context[/url]的用法使用,典型的用法是被作为分机运行ZapRAS命令。
   minunused=2
   minidle=1
   idledial=6999
   idleext=6999@idle

Analog Trunk Features (模拟中继特征)usedistinctiveringdetection: Whether or not to attempt to recognize distinctive ring styles on incoming calls. This does not require audio analyisis because rings are simple transitions of the analog line. It's merely a matter of matching the transition pattern.
usedistinctiveringdetection:是否尝试识别来电特殊铃音,这不需要音频分析,因为铃音在模拟线路上是非常简单转换,只需要匹配转换样本。缺省值:no
Default: no.
    usedistinctiveringdetection=yes

dring1, dring2, dring3: If you set usedistinctiveringdetection=yes, then you may define up to three different distinctive ring styles for Asterisk to attempt to recognize. Each style is defined as a comma separated list of up to three integers. Nobody has yet documented what these numbers mean, so you're on your own when it comes to trying to figure out what numbers to use for the distinctive ring syles used by your phone company in your country. But the tip is to use the Asterisk console in verbose mode, and apparently it reports numbers describing the ring patterns it sees. These patterns may be a starting point:
dring1, dring2, dring3:如果设置了usedistinctiveringdetection=yes,就需要定义三种不同特点的铃音风格,以便于Asterisk能够尝试识别。每种风格使用逗号分割三个整数来定义。没有文档说明三个数字的含义,因此需要自己测试鉴别在不同国家不同公司中,不同数字代表的风格。Asterisk控制台上也会显示识别的风格数字,具体风格可能会是以下一些情况。
    dring1=96,0,0
    dring2=325,95,0
    dring3=367,0,0

dring1context, dring2context, dring3context: Along with setting up to three distinctive ring patterns with dring1, dring2 and dring3, you also set corresponding contexts for incoming calls matching those distinctive ring patterns to jump into. If an incoming call does not match any of the distinctive ring patterns defined, then of course it will enter Asterisk with the default context defined for this channel.
dring1context, dring2context, dring3context:根据三种不同的铃音风格设置不同的context进行来电跳转,如果来电没有定义的风格匹配,就会进入该通道缺省的congtext。
    dring1context=line2incoming
    dring2context=business
    dring3context=chocolate

busydetect: If enabled, Asterisk will analyze the audio coming in on the line during a call or a dial attempt to attempt to recognize busy signals. This is useful on analog trunk interfaces both to detect a busy signal when dialing out, and for detecting when the person has hung up. See also . Be sure that you don't use this on digital interfaces like QuadBri cards and so on. Otherwise you will run in "broken calls" problems. default=no
busydetect:忙音检测,如果开启,Asterisk会拨号尝试或通话中分析在线的音频,从而尝试识别忙音信号。这非常在模拟中继接口上外呼时检测忙音信号非常有用,可以检测何时挂机。确认不能在例如QuadBri等卡上使用该参数,否则出现中断通话的问题,缺省值:no
   busydetect=yes

busycount: This option requires busydetect=yes. You can specify how many busy tones to wait before hanging up. The default is 3, but better results can be achieved if set to 6 or even 8. The higher the number, the more time is needed to detect a disconnected channel, but the lower the probability mistaking some other sound as being a busy tone.
   busycount=5
busycount:这个选项需要busydetect=yes,可以定义等待挂机的忙音信号数量,缺省值是3,但能达到的最好效果可能是设置6或者8,数字越高,检测挂机通道所需要的时间就越长,但小的数字可能会导致把其他声音错误的识别为忙音信号。

callprogress: Asterisk can attempt to monitor the state of the call to listen for a ringing tone, busy tone, congestion tone, and sounds indicating that the line has been answered. It appears that this feature is independent of the busydetect feature; it seems that both can run in parallel, and both will independently attempt to recognize a busy tone. The callprogress feature is highly experimental and can easily detect false answers, so don't count on it being very accurate. Also, it is currently configured only for standard U.S. phone tones. Default: no.
callprogress:Asterisk 可以通过尝试监控呼叫状态来侦听振铃音,忙音,拥塞音以及线路已经应答声音特征。这个特征不受busydetect特征影响,两者可以并行处理,独自尝试识别忙音信号。callprogress的特征是高实验证明更容易检测错误应答,所以不要指望它非常准确。因此,目前仅仅在标准美国电话铃音中配置,缺省值:no
   callprogress = yes

pulse: The standard installation of Asterisk does not permit you to specify that a Zaptel device use pulse dialing, even though the Zaptel driver supports pulse dialing. But you can apply a patch file to enable you to specify pulse dialing with the pulse keyword. See for the patch.
pulse:Asterisk标准安装中,没有允许定义Zaptel卡使用脉冲拨号,尽管Zaptel驱动支持脉冲拨号,但可以更新补丁文件,使用pulse关键字去开启脉冲拨号。
    pulse=yes


Analog Handset Features 模拟电话特征adsi: If your handset has ADSI (Analog Display Services Interface) capability, set set adsi=yes. The ADSI specification is system similar to Caller ID to pass encoded information to an analog handset. It allows the creation of interactive visual menus on a multiline display, offering access to services such as voicemail through a text interface.
adsi:如果手持设备支持ADSI(模拟显示服务接口),设置set adsi=yes,ADSI类似来电显示功能,传递编码信息到手持设备。它可以在多行显示的手持设备上创建交互式可视化菜单,通过文本接口提供类似语音邮件的访问服务。

immediate: Normally (i.e. with immediate set to 'no', the default), when you lift an FXS handset, the Zaptel driver provides you a dialtone and listens for digits that you dial, passing them on to Asterisk. Asterisk waits until the number you've dialed matches an extension, and then begins executing the first command on the matching extension. If you set immediate=yes, then Asterisk will instruct the Zaptel driver to not generate a dialtone when you lift a handset, instead passing control immediately to Asterisk. Asterisk will start executing the commands for this channel's . This is sometimes referred to as "batphone mode". Default: no.
immediate:通常(immediate设置为no,缺省值),当FXS话机挂机时,Zaptel驱动会马上提供拨号音,等待拨号并传递给Asterisk。 Asterisk等到接收到extension匹配号码时,就会开始执行相应的命令,如果设置 immediate=yes,Asterisk会命令 Zaptel驱动不要在FXS挂机时产生拨号音,而是把控制权交还给Asterisk,Asterisk会开始执行这个通道的s extension。这通常应用于batphone 模式(蝙蝠电话?),缺省No
    immediate=yes

callwaiting: If enabled, Asterisk will generate "call waiting pips" when you are already in a conversation on your FXS handset when someone tries to call you. If the channel has call waiting by default, you can temporarily disable it by lifting the handset and dialing *70, whereupon you will get a dialrecall tone and may then dial the intended number. There is no corresponding way to temporarily enable call waiting for channels that have it off by default. Default: no.
callwaiting:如果开启,在通话过程中如果有来电时,Asterisk就会产生呼叫等待提示音。如果通道缺省有呼叫等待,可以临时摘机按键*70取消,这种情况下,会收到重播提示音去拨打希望拨打的号码。没有合适的方法临时开启缺省设置为关闭的通道的呼叫等待。缺省为no
    callwaiting=yes

callwaitingcallerid: Sets whether Asterisk will send Caller ID data to the handset during call waiting indication. Requires also setting callwaiting=yes. Default: no.
callwaitingcallerid:设置在呼叫等待过程中是否传送主叫号码等数据,需要设置callwaiting=yes,缺省值:no
    callwaitingcallerid=yes

threewaycalling: If enabled, you can place a call on hold by pressing a hook flash, whereupon you get a dialrecall tone and can make another call. Default: no.
threewaycalling:(三方通话)如果设置开启,可以在按保持键切换话路,让原通话处于保持状态,这时会收到重拨提示音,并开启另外一方通话。缺省值:no
    threewaycalling=yes

transfer: This option has effect only when threewaycalling=yes. If threewaycalling=yes and transfer=yes, then once you've placed a call on hold with a hook flash, you can transfer that call to another extension by dialing the extension and hanging up. Default: no.
transfer:(呼叫转接)这个选项仅当三方通话=yes时有效,当设置了三方通话和呼叫转接,一旦通过或呼叫保持按键把当前话路置于保持状态,就可以拨号呼叫另外分机,把2个话路桥接起来,然后挂机。缺省值:no
    transfer=yes

cancallforward: If enabled, you may activate "call forwarding immediate" by dialing *72 (whereupon you get a dialrecall tone) followed by the extension number you wish to forward your calls to. If someone dials your extension, the call will be redirected to the forwarding number. You may disable the call forwarding by dialing *73. Default: no.
cancallforward:如果呼叫前转启用,可以通过拨号*72+想要转向的Extension,立刻激活呼叫前转(同时会有重拨提示音),这时如果有来话,那么呼叫会被重定向到设置的转移号码上,可以通过拨打*73取消呼叫前转。缺省值:no
    cancallforward=yes

callreturn: If enabled, you may dial *69 to have Asterisk read to you the caller ID of the last person to call. You will hear the dialrecall tone if there is no record of a last caller. Default: no.
callreturn:如果开启此设置,可以通过拨打*69让Asterisk读出最后呼入的主叫号码,如果没有记录最后呼叫主叫号码,将听到重拨提示音,缺省值:no
    callreturn=yes

callgroup: A channel may belong to zero or more callgroups. Callgroups specify who may answer this phone when it is ringing. If this channel is ringing, then any other channel whose pickupgroups include one of this channel's callgroups may answer the call by dialing *8#. This feature is supported by Zap, SIP, Skinny and MGCP channels. Group numbers can range from 0 to 31. The default value is an empty string, i.e. no groups.
callgroup:通道可以不属于或者属于多个呼叫群组。呼叫群组定义了当电话振铃时,谁可以接听。当一个通道振铃时,其它那些pickupgroups中包含该通道 callgroups其中之一的通道可以通过按*8#来接听电话。这个特性支持在ZAP,SIP。skinny和MGCP通道类型上使用,群组数字范围为 0-31,,缺省值是空字符串,即没有组。
   group=1
   callgroup=1,2,3

pickupgroup: A channel may belong to zero or more pickupgroups. Pickupgroups specify whose phones you may answer. If another channel is ringing, and this channel's pickupgroups include one of the ringing channel's callgroups, then this channel may answer the call by dialing *8#. Group numbers can range from 0 to 31. The default value is an empty string, i.e. no groups.
pickupgroup:通道可以不属于或者属于多个摘机群组,摘机群组定义了可以应答那些电话。如果其他通道振铃,而本通道pickupgroup是振铃通道callgroups群组其中之一,那么本通道可以通过按*8#来接听振铃通道。群组范围为0-31,缺省值为空字符串,即没有群组。
   group=1

See more about

If you dial *8# when there is more than one channel whose calls you are eligible to answer, then it just answers the "first ringing channel", i.e. you have no control which one you pick up.
如果同时不止一路通道振铃符合条件可以通过按键*8#接听,只能接听第一条振铃通道,即不能控制选择接听哪一条。
   pickupgroup=3,4

useincomingcalleridonzaptransfer: If you set this option (Use Incoming Caller ID On Zap Transfer) to 'yes', then when you transfer a call to another phone, the original caller's Caller ID will get forwarded on too. Default: no.
useincomingcalleridonzaptransfer:如果设置了这个选项(在ZAP通道上启用来电转接),可以转接来电到另外一个电话,外部呼叫的主叫号码同时跟随。
    useincomingcalleridonzaptransfer=yes




Caller ID Optionscallerid: Sets the Caller ID string to forward to the recipient when calls come in from this channel. You normally use this to set the Caller ID for handsets. Specify the Caller ID name in double quotation marks, followed by the Caller ID number in <> symbols. For trunk lines, set to "asreceived" to pass the received Caller ID forward.
callerid:当来电时设置主叫ID字符串,传送给接收者,通常为手持设备设置callerID。定义callerid:双引号名字后紧跟角括号数字,对中继线路,设置asreceived来传送主叫ID。
   callerid="Mark Spencer" <256 428-6000>
   callerid=
   callerid=asreceived

Important Note: Caller ID can only be transmitted to the public phone network with supported hardware, such as a PRI. It is not possible to set external caller ID on analog lines.
重要事项:CallerID只能在硬件支持的公共电话交换网上被传输,例如PRI。在模拟线路上设置外部CallerID是不可能的。
usecallerid: For handsets, this option will cause Asterisk to send Caller ID data to the handset when ringing it. For trunk lines, this option causes Asterisk to look for Caller ID on incoming calls. Default: yes.
usecallerid:对于手持设备,这个选项可以在振铃时让Asterisk发送CallerID数据到到手持设备,对于中继线路,该选项致使Asterisk查找来电主叫ID,缺省值:yes
    usecallerid=no

hidecallerid: (Not for FXO trunk lines) For PRI channels, this will stop the sending of Caller ID on outgoing calls. For FXS handsets, this will stop Asterisk from sending this channel's Caller ID information to the called party when you make a call using this handset. FXS handset users may enable or disable sending of their Caller ID for the current call only by lifting the handset and dialing *82 (enable) or *67 (disable); you will then get a "dialrecall" tone whereupon you can dial the number of the extension you wish to contact. Default: no.
hidecallerid:主叫ID隐藏(不能应用于FXO中继线路),对于PRI通道,在外呼时停止传送主叫ID。对于FXS端外呼时,会停止发送主叫ID信息到被叫方。FXS端可以在话机上按*82(启用)*67(关闭)可以控制是否传送主叫ID传送。
    hidecallerid=yes

restrictcid: (PRI channels only) This option has effect only when hidecallerid=no. If hidecallerid=no and restrictcid=yes, Asterisk will prevent the sending of the Caller ID data as a presentation number when making outgoing calls (ANI data is still sent). Default: no.
restrictcid: (仅用于PRI通道),该选项在hidecallerid=no时可以有效设置,如果hidecallerd=no并且restrictcid=yes,外呼时,asterisk会阻止以显示号码方式发送主叫id,但ANI消息数据仍然发送),缺省为no
    restrictcid=yes

usecallingpres: (PRI channels only) Whether or not to use the Caller ID presentation for the outgoing call that the calling switch is sending. See also the command. Read more in this discussion from 2003.
usecallingpres:(仅PRI通道有效)不管是否把callerid作为外呼的显示号码,交换机都会传送。
    usecallingpres=no

Audio Quality Tuning Options (音频质量调整选项)These options adjust certain parameters of Asterisk that affect the audio quality of Zapata channels. See also:

relaxdtmf: If you are having trouble with DTMF detection, you can relax the DTMF detection parameters. Relaxing them may make the DTMF detector more likely to have "talkoff" where DTMF is detected when it shouldn't be. Default: no.
relaxdtmf:如果DTMF检测有问题,可以放宽DTMF检测的参数。
    relaxdtmf=yes

echocancel: Disable or enable echo cancellation (default is 'yes'). It is recommended that you do not turn this off. You may specify echocancel as 'yes' (128 taps), 'no' (0 taps, disabled), or a preset number of taps which are one of 16, 32, 64, 128, or 256. Each tap is one sample from the data stream, so on a T1 this will be 1/8000 of a second. Accordingly the number of taps equate to a 2ms, 4ms, 8ms, 16ms or 32ms tail length. Beware that if you set echocancel to a different value, Asterisk will fall back to the default of 128 taps without warning.
echocancel: 开启或关闭回音消除(缺省值:是),建议不要关闭该设置,可以定义回音消除yes(128滤波参数)或者no(0滤波),或者定义参数为 16,32,64,128,256中一个,每种滤波参数都是一种数据流样本,在T1线路上会是每秒1/8000,因此滤波参数值等于2ms,4ms, 8ms,16ms,32ms尾长,如果设置的回音消除为不同的值,Asterisk将直接使用128而不会警告。
    echocancel=no

echocancelwhenbridged: Enables or disables echo cancellation during a bridged TDM call. In principle, TDM bridged calls should not require echo cancellation, but often times audio performance is improved with this option enabled. Default: no.
echocancelwhenbridged:开启或关闭在桥接的TDM呼叫中的回音消除,原则:TDM桥接呼叫不需要回音消除,但开启这个选项通常可以提高语音效果。
    echocancelwhenbridged=yes

echotraining: In some cases, the echo canceller doesn't train quickly enough and there is echo at the beginning of the call which then quickly fades out. Enabling echo training will cause Asterisk to briefly mute the channel, send an impulse, and use the impulse response to pre-train the echo canceller so it can start out with a much closer idea of the actual echo. However, the characteristics of some trunks may change as the endpoints become connected and, if there is a considerable delay between the circuit being 'up' and the endpoints being finalised, the training impulse may measure the characteristics of the open trunk rather than the completed circuit. Accordingly you may either specify a value between 10ms and 4000ms to delay before starting the impulse response process or 'yes', which equates to 400ms. Default: undefined.
echotraining:有时回音消除不能够很快的自学习,通话开始时会有回音,然后很快消除。开启回音训练可以让Asterisk使通道暂时无声而发送一个刺激信号,并根据响应效果预训练回音消除,从而能够更接近真实的回音。然而如果在电路up和终端响应定位之间有相当的延时,某些典型中继被会作为终端进行连接,训练刺激信号会检测open中继的特性而不是实际电路。因此,在开始响应刺激信号处理之前,可以在10ms和4000ms延时之间定义一个值,或者定义yes,缺省就是 400ms。默认值没有定义。
    echotraining=no

rxgain: Adjusts receive gain. This is the audio recieved by Asterisk from the device. E.g: in a phone connected to a FXS channel, this would control the audio that is sent from the phone to Asterisk. This can be used to raise or lower the incoming volume to compensate for hardware differences. You specify gain as a decimal number from -100 to 100 representing dB. 10 is significantly high. Change these options by only a few dB at a time. Default value: 0.0
rxgain:调整接收获取强度值,这是指Asterisk从例如连接到FXS通道上的电话设备上接收到的音频,该选项能控制由电话发送给Asterisk的音频,可以用于提高或降低进入的声音音量,从而补偿硬件损耗。可以定义获得值从-100db到100db,10db就意味着很高了。修改时应进行微调。
    rxgain=4.2

txgain: Adjusts transmit gain. This is the audio transmitted by Asterisk to the device. E.g: in a phone connected to a FXS device this would control the audio that is heard in the handset. This can be used to raise or lower the outgoing volume to compensate for hardware differences. Takes the same type of argument as rxgain. Default: 0.0
txgain:调整传出强度值,这是指由Asterisk发送给连接到FXS上的电话等设备的音频,Asterisk可以控制音频音量传送给手持设备端收听。这用于提高或降低外呼音量从而降低设备损耗。使用方法参数雷同fxgain,缺省值为0.0
    txgain=-10.2

See:

Call Logging OptionsAsterisk normally generates Call Detail Records (CDR), being a log or database of the calls made through Asterisk. This data can be used for Automated Machine Accounting (AMA). See .
Asterisk通常会产生详单记录,记录是由Asterisk呼叫产生的,以日志或数据库存储。通话详单记录可以用作自动记账AMA。

accountcode: Sets the data for the "account code" field in the CDR for calls placed from this channel. The account code may be any alphanumeric string. It may be overridden at call time with the command.
accountcode:设置通话详单中account code字段的数据,用于通道呼叫处理。计费代码可以是数字和文字字符串,可能在呼叫时被Asterisk命令setaccount重置。
   accountcode=spencer145

amaflags: Sets the AMA flags, affecting the categorization of entries in the call detail records. Possible values are:
amaflags:设置AMA自动记账标记,影响通话详单中的分类条目。
  • default: Let the CDR system use its default value. (CDR采用缺省值)
  • omit: Do not record calls. (不记录)
  • billing: Mark the entry for billing (产生记账条目)
  • documentation: Mark the entry for documentation. (标记条目文档)

   amaflags=billing

Timing Parameters (定时参数)
These keywords are used only with (non-PRI) T1 lines. All values are in milliseconds. These do not need to be set in most configurations, as the defaults work with most hardware. It has been noted that the common Adtran Atlas uses long winks of about 300 milliseconds, and channels from them should be configured accordingly.
这个关键字仅用于T1线路,不包含pri。
prewink: Sets the pre-wink timing.
preflash: Sets the pre-flash timing.
wink: Sets the wink timing.
rxwink: Sets the receive wink timing.
rxflash: Sets the receive flash timing.
flash: Sets the flash timing.
start: Sets the start timing.
debounce: Sets the debounce timing. "The debounce settings in the Asterisk configuration affects how Asterisk
handles hookswitch transitions on its FXO/FXS interfaces." —

   rxwink=300
   prewink=20~~

Other Featuresmailbox: If this option is defined for a channel, then when the handset is lifted, Asterisk will check the voicemail mailbox(es) specified here for new (unheard) messages. If there are any unheard messages in any of the mailboxes, Asterisk will use a stutter dialtone rather than the ordinary dialtone. On supported hardware, the will also be activated — this probably requires that you also set adsi=yes. Update: This option does NOT require ADSI. It will send a standard FSK tone down the line that lights up the MWI on any capable analog phone.
mailbox:这个选项为通道定义的。当摘机时, Asterisk会检测语音邮箱中未读的邮件。如果有未读邮件,Asterisk会有摘机警告音而不是通常的拨号音。在支持的硬件上,等待消息同样激活,这需要设置adsi=yes。这个选项不需要ADSI支持,它会发送一个 标准的频移键控提示音(也称为移频调制和移频信号)来挂掉支持WMI(消息等待支持)的模拟线路。

The parameters to this option are one or more comma-separated mailbox numbers, as defined in .

    mailbox = 1234
    mailbox = 1,2

For each mailbox, if the mailbox is in a context other than "default", place the context after the mailbox number
separated by an at sign (@).
如果语音邮件不是在default而是在context,按照[url=]mailbox@context[/url]的格式

    mailbox = 1234@office
    mailbox = 12@office,34@home

group: Allows you to group together a number of channels so that the command will treat the group as a single channel. When Dial tries to make a call on a Zap group, the Zap channel module will use the first available (i.e. non-busy) channel in the group for the call. Multiple group memberships may be specified with commas, and to signify no group membership, the portion after the equals sign may be omitted. Group numbers can range from 0 to 31. The default value is an empty string, i.e. no groups.
group:允许把多个通道组成一组,Dial命令拨号的时候把群组视为一个单一通道。当Dial试图在ZAP组上拨号时,Zap通道模块使用组中第一个可用通道。多群组关系可以通过逗号来定义,等号后面省略表示没有群组。群组范围从0-31,缺省值时空字符串,即没有群组。

    group=1
    group=2,3
    group=

See more about

language: Each channel has a default language code that affects which language version of prerecorded sounds Asterisk uses for this channel. See . The default is an empty string.
language:每个通道有一个缺省的语言编码,这是由预先录制声音的语言版本来定义的
    language=en

progzone: This defines the timing and frequencies for call progress detection, which are buried in the sources in asterisk/dsp.c. This is DIFFERENT than the call progress timing defined in zaptel/zonedata.c and in /etc/asterisk/indications.conf, and so far only options you can use (defined in dsp.c) are us, ca, br, cr and uk. (This was added sometime between 1.0.9 stable and 1.2 beta). Default is: us
progzone:该选项为呼叫处理检测(在asterisk/dsp.c源代码中)定义了时间和频率,这与在zaptel/zonedata.c和 /etc/asterisk/indications.conf中的定时呼叫处理不同。到目前为止该参数只能是:us,ca,br,uk,缺省是us

Important Stuffcontext: This specifies which a call will start in. The context controls how Asterisk will handle the call. Contexts are defined in the . Default: "default".
context:定义了呼叫开始的context,context控制Asterisk如何处理呼叫。Context在dialplan中定义,缺省为"default"
    context=internal

channel: This keyword is unlike all the other keywords in this configuration file, because where all the other keywords merely specify settings to use, this keyword causes Asterisk to actually allocate a channel with the settings that have been specified earlier in the file.
channel:这个关键字与配置文件中的其他关键字不同。原因是其他关键字仅仅定义设置来使用,这个关键字可以使Asterisk把前面定义的设置分配到通道中。

The channel keyword defines one or more channels. Each channel definition will inherit all options stated ahead of it in this file. Channels maybe specified individually, separated by commas, or as a range separated by a hyphen. Allocating a channel will not "clear" the settings, so any channels defined later on in this file will inherit the options for this channel unless you override settings.
通道关键字定义一个或多个通道,每行通道定义都会继承前面所有的选项配置状态。通道可以通过逗号分离单独定义,或者用连接符连接一组,分配通道不会清空设置,所以任何在后面定义的通道都会继承前面的选项除非覆盖设置。

    channel => 16
    channel => 2,3
    channel => 1-8

Obsolete Settingsstripmsd: (Obsolete) Strip the 'Most Significant Digit,' the first digit or digits from all calls outbound on the given trunk channels. Takes as an argument the number of digits to strip. Use for this functionality.

 

转自:http://www.cppblog.com/byc/archive/2011/11/24/160887.html

阅读(3345) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~