Goal (short description)
Goal of this HOWTO is to configure VoIP gateway between SIP and E1 using opensource PBX Asterisk.
Applicability
It is applicable for:
- VoIP provider who wants to offer services for customers unsing EuroISDN PRI as conectivity to PSTN
- Organisation whichs want to connect their existing PBX with EuroISDN PRI or QSIG port(s) to SIP provider
- Organisation which wants to interconect two existing PBXes with EuroISDN PRI or QSIG connectivity using IP and SIP
Prerequisites (OS, dependencies on other software)
- Server with some linux distribution
- ISDN30 PCI card inside this server
- PBX with EuroISDN or QSIG connectivity or EuroISDN PRI connectivity to PSTN
Configuration (OS agnostic)
Install Asterisk
First it is needed to install Asterisk. In most distributions, this should be easy because Asterisk is packaged with your distro. So use your distribution package manager to install. This howto is not made to focus on installation step. See 3.1.2. Setting up SIP voice services for an institution with Asterisk
Install HW drivers
You have to be sure that drivers for your ISDN PRI card are working. Simplest way is probably to install zaptel drivers (or it is together with your Asterisk package from your distro). See 3.1.2. Setting up SIP voice services for an institution with Asterisk
Ensure that hardware is working
If your hardware is working, you should be able to see something like:
cat /proc/zaptel/1 Span 1: WCT1/0 Digium Wildcard TE110P T1/E1 Card 0 HDB3/CCS/CRC4 ...
Please ensure that /proc/zaptel exists and that there are enaught rights to /dev/zap/* for your asterisk process.
Configure Layer1 and Layer2 parameters
This parameters are set by /etc/zaptel.conf (change xx to your country code (eg. uk or de). Disable crc4 if your operator or PBX does not support it.
loadzone = xx defaultzone = xx # PRI TE span=1,0,0,ccs,hdb3,crc4 bchan=1-15 dchan=16 bchan=17-30
Next, it is needed to set layer3 parameters and PBX specific parameters. It is stored in /etc/asterisk/zapata.conf. Use same language code as above. Use swtichtype ISDN because it has best support within asterisk. Qsig is not implemented well. Select signalling (either cpe for end device and net for master device). In most situation, your asterisk gateway will act as CPE. Dialplan is unknown, it means that there will be no automatic country or PBX prefixes for calling and we will do this in dialplan (better solution). Echoparaeters are needed for echocancelation to work. But it can be time consuming process to find source of echo and cancelate it. And you can never be sure that it will not appear in some calls. See http://www.voip-info.org/wiki/view/Asterisk+echo+cancellation&view_comment_id=13700 for more informations. Immediate means if calling to your asterisk will be routed to called number into dialplan. Next, we have to setup calling groups. In this scenario, we have only one calling group which spans all available channels on card. We can group only some of them or more cards together. Any call to your Asterisk box will be routed into fpstn context (see above).
[channels] language=xx switchtype = euroisdn signalling = pri_cpe pridialplan = unknown prilocaldialplan = unknown echocancel=64 echotraining = 150 echocancelwhenbridged=yes ;txgain=-4 ;rxgain=-4 immediate=no group = 1 context = fpstn channel => 1-15,17-30 acountcode = fpstn