Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Telephony Systems With Asterisk (2005).pdf
Скачиваний:
45
Добавлен:
17.08.2013
Размер:
1.82 Mб
Скачать

Configuring Asterisk

The configuration for a channel bank will be very similar. Supposing we had a single channel bank, using ESF framing and B8ZS coding, and groundstart lines on channels 49, 50, 51, and 52, we would have:

# Channel bank to PSTN span=3,0,0,esf,b8zs fxsks=49-52

Terminals

Just as our configuration of the lines depends on the capabilities of our telephone provider, as we configure our terminals, we must keep our equipment in mind. Our settings in /etc/zaptel.conf for our terminal devices will be directly related to the type of equipment we are using.

As our analog terminal devices will be using an FXS device to connect, Asterisk must use FXO signaling to communicate. Therefore, if we have a TDM400P with FXS modules, we would use fxoks signaling. Assuming this is our second port to load during ztcfg, the entry in zaptel.conf will be:

fxoks=2

We can also connect our Asterisk server to a channel bank or other phone system. This is done just as it was for defining lines. We must first designate a span (in the same format as before) and then configure the individual channels.

For instance, suppose we have a channel bank that has 4 FXO ports and 20 FXS ports. Imagine it is using ESF framing and B8ZS coding. Thus, we could have:

# Channel bank to PSTN and Terminal Devices span=3,0,0,esf,b8zs

fxsks=49-52 fxoks=53-72

No problem, right? Remember: as we make mistakes, when we run ztcfg, we will get some useful error messages. The more verbose the output, the more likely we are to get a hint as to what is causing any problems we may experience.

zapata.conf

Now that we have configured /etc/zaptel.conf, we have our telephony devices starting. If our FXO or FXS device is not starting yet, we need to go back to the previous section, as this is one of the few configuration files that depend on the success of another. Until we have our interfaces loading, we will not have much success in /etc/asterisk/

zapata.conf.

This configuration file is read by Asterisk. Therefore, to read changes made to this file, we can issue a reload in the Asterisk console. Zaptel will NOT have to be restarted to apply any changes we make in zapata.conf.

48

Chapter 4

At the top of our file, we will see a [channels] section. In fact, that is the only section we will have. At the beginning, we will set certain characteristics that we want to be consistent between all of our lines and terminals. We must exercise great care when working with this file. When we set any variable, it stays in force during all of the later channel declarations until we set it otherwise. For those of us who program, it is much like a switch statement without breaks at the end of cases: sometimes useful, always dangerous!

Each of these settings that we discuss can be reset at any point in the file, whether for incoming or outgoing interfaces. As we reset it while defining one interface, all of the next lines will have the same setting. Therefore, it behooves us to group lines of similar configuration together so that we won't need to reset variables as often.

Not every setting will be needed for every channel. In fact, most installations probably don't even use half of the settings available. However, we should go over all of the possibilities, as every installation is a little bit different, and one of these settings might be just what we need!

As there are so many options that must be set, we will go through them in list format.

Language: This is the default language to use. The default is "en" for English.

context: This is how we tell Asterisk which context to put new calls in. The

default value is "default".

switchtype: Used only for Primary Rate ISDN, the valid options are:

o 4ess: AT&T's 4ESS protocol o 5ess: Lucent's 5ESS protocol o dms100: Nortel DMS100

o euroisdn - EuroISDN

o national: National ISDN 2 (default)

oni1: Old National ISDN 1

pridialplan: This setting is only occasionally used for PRI connections.

The options are: o unknown o private o local

o national

ointernational

overlapdial: This setting decides whether or not to send overlapping digits

while dialing. Valid options are "yes" and "no".

signalling: This setting chooses the signaling method. Valid options are:

o em: E&M signaling

49

Configuring Asterisk

o em_w: E&M Wink

o featd: Feature Group D, Adtran style o featdmf: Feature Group D, US

o featb: Feature Group B, US

ofxY-ZZ, where Y can be o or s (this will be the same as in zaptel.conf), and ZZ can be ks for Koolstart, gs for

Groundstart, or ls for Loopstart

o pri_cpe: PRI signaling, Customer Premises Equipment (CPE) side o pri_net: PRI signaling, Network side

o sf: SF Signaling o sf_w: SF Wink

o sf_featd: SF Feature Group D, Adtran style o sf_featdmf: SF Feature Group D, US

osf_featb: SF Feature Group B

prewink: a prewink time, defaults to 50 ms.

preflash: a preflash time, defaults to 50 ms.

wink: wink time, defaults to 150 ms, while Atlas uses 250 ms.

flash: flash time, defaults to 750 ms.

start: start time, defaults to 1500 ms.

rxwink: receiver wink time, defaults to 300 ms.

rxflash: receiver flash time, defaults to 1250 ms.

debounce: debounce, defaults to 600 ms.

usedistinctiveringdetection: set this to "yes" for our FXO interface if

our phone company sends us distinctive ring.

usecallerid: set this to "yes" if we wish to use caller ID. One note: this may

cause a delay between rings and the pickup of Asterisk on calls, as Asterisk will have to wait for caller ID information to be available. If our installation cannot handle this, then we will have to set it to "no".

hidecallerid: set this to "yes" if we will want to mask our caller ID on

outgoing phone calls.

callwaiting: set this to "yes" to enable call waiting on FXO devices.

restrictcid: this sends caller ID as ANI (Automatic Number Identification)

only, and not available for the user.

50

Chapter 4

usecallingpres: this toggles whether we want to use the caller ID

presentation for outgoing calls that the calling switch is sending.

callwaitingcallerid: this sets if we support caller ID for call waiting.

threewaycalling: this sets if we support three-way calling.

transfer: here we can decide if we're supporting flash-hook transfers. The

use of this feature requires three-way calling.

cancallforward: set this to "yes" if we want to be able to forward calls.

callreturn: whether or not to support *69 for call return.

mailbox: here we set the voicemail number of the mailbox. If this is set to a

valid voicemail number, and that account has a new message, then our user will hear a stutter dialtone when he or she picks up the phone. If there is more than just one context for voicemail, we can specify it by

user@context.

echocancel: this variable can be set to "yes", "no", or a number, defining

how many taps to cancellation (needs to be a power of 2).

echocancelwhenbridged: this sets whether we want to cancel echo when the

circuit is purely Time Division Multiplexing (TDM). Usually, echo canceling is unnecessary; however, the sample configuration has it set to "yes".

echotraining: this variable can be "yes", "no", or "800". It has been

reported on the User's list that a setting of 800 fixes most of the echo experienced on TDM400P and X100P interfaces.

relaxdtmf: this setting can help if Asterisk keeps detecting voice as

DTMF (digits).

Gain settings:

o txgain: in dB, sets the TX gain, default of 0.0

orxgain: in db, sets the RX gain, default of 0.0

group: we can assign groups to our lines. This allows rollover when making

outgoing calls.

callgroup: this is a ring group.

pickupgroup: this is a pickup group. If another phone in your pickup group

rings, you can pick it up by dialing *8#.

immediate: this sets if we want calls picked up immediately, or if we want to

provide dialtone. Default is "no", meaning we will provide dialtone, read digits, and complete the call.

callerid: we can set the caller ID number to "asreceived" or override it with

a specific number. "asreceived" only makes sense on trunk lines.

51