Feb 12 2008

Zapata Configuration for PRI

Category: AsteriskBipin Balakrishnan @ 4:08 pm

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.The file

is located in the path /etc/asterisk/zapata.conf.

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

Almost all of the things described in zapata.conf can be put as the
default values.The rest to be configured is mentioned here.
A sample zapata configuration having double span E1 card

switchtype = euroisdn           //the type of switch using
signalling = pri_cpe              // signalling used
context=torque  // context in the extensions.conf
group = 2 //grouping the channels
channel => 1-15,17-31,32-46,48-62      //channels avilable

Tags: , , ,


Feb 12 2008

Zaptel configuration for Asterisk

Category: AsteriskBipin Balakrishnan @ 3:19 pm

syntax is as folows:

span=<"spannum">,<"timing">,<"LBO">,<"framing">,<"coding">

Before going any further, lets have a closer look at these options:

spannum:

This defines the number of the span (=port). This is counted across the cards. (have a look at the picture of the te4xxp cards to see where it starts counting.

E.g.:

If you have a quad e1/t1 card, and a single port e1/t1 card, you will need 5 spans.

Span 1 might be on the first card or on the second card, so there are two options:

span 1 = first port on the single port card.
span 2,3,4,5 = the ports on the quad port card.

or span 1,2,3,4 = the ports on the quad port card
span 5 = the first port on the single port card.

LBO= Line Build Out – Length of cable between Zap card and SmartJack/telco provided modem. Almost always should be set to 0 unless you have a long cable. This distance does NOT include the copper in the street to the CO/exchange.
0: 0 dB (CSU) / 0 – 133 feet (DSX-1)
1: 133 – 266 feet (DSX-1)
2: 266 – 399 feet (DSX-1)
3: 399 – 533 feet (DSX-1)
4: 533 – 655 feet (DSX-1)
5: -7.5 dB (CSU)
6: -15 dB (CSU)
7: -22.5 dB (CSU)

Framing and coding:

Lets have a look at the possible options for a T1 setup:

- Framing: how to communicate with the hardware at the other end of the line.
D4 or ESF

- Coding:another parameter of the communication with the other end of line hardware.
AMI or B8ZS

Usually when the line is ESF framing, the line coding is B8ZS and when the line is D4 SF framing, the line coding is usually AMI.

e.g.: span=1,1,0,esf,b8zs

Lets have a look at the possible options for an E1 setup:

- Framing:
CCS or CAS

- Coding:
AMI or HDB3

On an E1 card, you can optionally enable CRC checking.

e.g : span=1,1,0,CCS,HDB3,crc

Timing:

As mentioned before, every line needs to have a synching time source on one of both ends. (An asterisk PRI line can be clocked internally or can be clocked by the telco or the PBX it is connected to.)

Lets rephrase this to make this a little more clear:

Internal timing is when the timing is taken from the clock in the card.
External timing is when the timing is taken from the line on the PRI.

Timing is done PER card, so every card needs its own timing sources defined. (they can NOT be shared across cards.)

The timing parameter in the span definition in zaptel.conf determines the selection of primary, secondary, and so on sync sources. If the span you are defining should be considered a primary sync source, then give it a value of “1″.
(This means, zaptel will take the timing as received on the line connected to this port (span). This is called external clocking. if no timing was received on this line, it will fallback to internal clocking, meaning it will look at its own clock chip and generate timing,)

To define a secondary clock source, use “2″, to define a 3rd one, use 3, and so on.

span=1,1,0,esf,b8zs – This is the FIRST digital Zaptel span on the system, has PRIMARY priority to receive timing FROM the other end of the link, the cable to the SmartJack/modem is less than 133 feet in length, this span uses ESF framing and B8ZS line encoding. A fairly typical T1 span definition.

span=2,2,0,ccs,hdb3,crc4 – This is the SECOND digital Zaptel span on the system, has SECONDARY priority to receive timing FROM the other end of the link, the cable to the SmartJack/modem is less than 133 feet in length, this span uses CCS framing and HDB3 line encoding, CRC4 error checking is also enabled. This is a fairly typical second E1 span definition.

A sample configuration for the zaptel.conf file having 2 spans in the E1 card

span=1,1,0,ccs,hdb3
bchan=1-15,17-31
dchan=16
loadzone = in
defaultzone= in
span=2,1,0,ccs,hdb3
bchan=32-46,48-62
dchan=47

Tags: , , , ,


Feb 12 2008

Removing Asterisk

Category: AsteriskBipin Balakrishnan @ 3:17 pm

Stop Asterisk and unload its modules
The first thing you have to do is to stop Asterisk and unload the modules it may be using, e.g Zaptel’s.

The following lines will brutally terminate Asterisk and kill all ongoing conversation. You have to kill safe_asterisk first, otherwise it will respawn Asterisk.

killall -9 safe_asterisk
killall -9 asterisk

Then you’ll have to unload the Zaptel drivers; check which ones are loaded by issuing a:

[root@localhost]# lsmod | grep zaptel
zaptel 214820 2 wcfxo,wctdm
crc_ccitt 2113 1 zaptel

This means that the submodules wcfxo and wctdm are loaded for zaptel. We’ll have to remove them in reverse order:

modprobe -r wcfxo
modprobe -r wctdm
..repeat for all zaptel submodules….
modprobe -r zaptel

If you repeat the lsmod | grep zaptel command now, it should find nothing.

Delete Asterisk files
By running the commands below, you will delete with no possible recovery an Asterisk system. First make a backup of things you’d like to keep, lik ethe log files or the configuration files.
star Remember: once you run these commands, there’s no turning back!

rm -rf /etc/asterisk
rm -f /etc/zaptel.conf
rm -rf /var/log/asterisk
rm -rf /var/lib/asterisk
rm -rf /var/spool/asterisk
rm -rf /usr/lib/asterisk

Now your Asterisk system has been completely removed.

Tags: , ,


Feb 12 2008

Asterisk “zttool”

Category: AsteriskBipin Balakrishnan @ 2:57 pm

Zaptel Tool: Shows status of Digium’s interface cards; can run a loop test. zttool shows the current status the Digium Zaptel inteface cards plugged to the computer.
It displays values like Current Alarms, SyncSource, Tx/Rx Levels for each Zaptel interface.

* requires libnewt (e.g. libnewt-dev package on Debian; aka newt-devel on CentOS 4.4)
* change into your zaptel source directory and issue a ‘make zttool’ (followed by ‘make install’)

Indications

Red : Not configured
Yellow: Sync problem
Green : Everything is ok

zttool on terminal

Tags:


Feb 12 2008

PRI Troubleshooting

Category: AsteriskBipin Balakrishnan @ 2:55 pm

When the PRI card was purchased from Digium, Digium has provided free
technical support for configuring the card.

The lights on the PRI card can be red, amber/green or green. When all is
well they are green.

If Asterisk aborts when you try to start it, there are several things you
can check:

The Linux modules for your Zapata cards have to be loaded in order for the
connections to work. You load the PRI driver, wct4xxp, before you load the
FXS/FXO driver, wctdm.

You also have to execute the program ztcfg to get things to work. If all is
well, when you run ztcfg it should not produce any output unless you
specify verbose output (”ztcfg -vv”). When you run ztcfg, the lights should
change to green, even if Asterisk has not been started.

Loading of the modules may or may not be done automatically by the system.

Digium says it is possible to construct a loop-back plug to test your
PRI card. You do this using an RJ45 plug, connecting pin one to pin four
and pin two to pin five. When the loop-back connector is connected to the
card, the light should turn green. Again, the modules have to be loaded
and possibly ztcfg has to have been run.

The B channels listed in zaptel.conf must agree with the channels listed in
/etc/asterisk/zapata.conf, otherwise Asterisk may abort when you try to
start it. Zapata channels are indexed starting at one rather than zero
(Zap/1, Zap/2, etc.)

Tags: , , ,