Zap Channel Module Configuration
The Zap channel module permits Asterisk to communicate with the Zaptel device driver, used to access Zaptel 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 TDMoE is not directly related to Zapata hardware, it uses a pseudo-TDM engine, and gets configured here.
Using MySQL For Zap Channel Configuration
It 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 Channels
The 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 Type
The 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 FXOsignalling, 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 Zaptel driver configuration. 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支持的信令类型。
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 ZapRAS 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 alsoDisconnect Supervision. 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 Pulse Dialing on Zap Channels 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 “s” extension. 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 |