How to configure sangoma E1/T1/ISDN/PRI cards in Asterisk

Topic: Configuring Sangoma E1 cards in asterisk - vicidial

    Step by step guide to configure the sangoma E1/ISDN/PRI cards in asterisk based PBX and dialers like Freepbx, Issable, vicidial, Goautodial. This article applicable to all sangoma digital cards like A101, A102, A104, A108, A116.

how to configure sangoma E1/ISDN/PRI cards

Who is Sangoma?

    Sangoma is a leading, global Communications as a Service (CaaS) provider that empowers businesses of all sizes to connect to the people and processes that matter. Since 1984, Sangoma has been recognized as a trusted leader in the communications industry and continues to offer a stable, global presence, future-forward vision, and diverse portfolio of solutions, service, and support.

What is E1/T1/ISDN/PRI?

    E1/T1 is known as Primary Rate Interface (PRI), is an Integrated Services Digital Network (ISDN) access method, which enables traditional phone lines to carry voice, data and video traffic, among others.

E1 - Contains 30 B-channels and 2 D-channel and used in Europe, China and most of the Asia countries.

T1 - Contains 23 B-channels and one D-channel and used in the USA, Canada and Hong Kong.

J1 - It is almost the same as T1 but used in Japan with some slight modifications, this is the Japanese standard for PRI.

What is Wanpipe?

    Wanpipe is Sangoma's suite of Linux/windows kernel device drivers and utilities that enable all Sangoma TDM boards. Sangoma kernel device driver (WanpipeTM) is a unified linux & windows code base offering OS agnostic hardware support for all Sangoma TDM boards

How to configure sangoma card

Step 1: Checking Wanpipe Preinstalled

Step 2: Wanpipe Dependencies installation

Step 3: Wanpipe driver Latest download and install

Step 4: Wanpipe configuration Wizard 

Step 5: Checking Trunk Status

Step 6: Asterisk Dialplan

Step 7: Troubleshoot

Step 1: Checking Wanpipe Preinstalled

    Check whether the wanpipe is pre-installed in your server by running the below command, most of the pre-compiled asterisk based ISO's like vicibox, Freepbx, issable will come with wanpipe pre-installed, Either you can use them or upgrade to the latest.

Command to check wanpipe pre-installed

wanrouter version
wanrouter status

If wanpipe is already installed proceed with step 4, if not installed proceed with next step.

Step 2: Wanpipe Dependencies installation

    Before proceeding with wanpipe latest driver installation, you need to install the dependencies required for the wanpipe driver
Copy paste the below command to install the wanpipe dependencies

yum -y install kernel-devel-$(uname -r) libtool* gcc make patch perl bison gcc-c++  ncurses-devel flex libtermcap-devel autoconf* automake*

Apart from the above dependencies wanpipe also needs Dahdi driver to be installed in your asterisk server before proceeding with wanpipe driver installation. Check out my dahdi installation post in my blog.

Step 3: Wanpipe driver Latest download and install

    Its always best practice to install the latest wanpipe driver , download the latest wanpipe driver from the sangoma repository link provided below

https://ftp.sangoma.com/linux/current_wanpipe/

or run below command to download the latest wanpipe driver

wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz  

Installing wanpipe 

cd /usr/src/
wget https://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz
tar -xvzf wanpipe-current.tgz
cd wanpipe-7.0.34
./Setup install

Note: Make sure to replace the wanpipe version above i am using 7.0.34 

also if you are using A116 card then run ./Setup install –dahdi-chunk=40

If you have any issue while installing or need to remove old wanpipe check out the steps to remove wanpipe in my blog

Step 4: Wanpipe configuration Wizard

    Sangoma wanpipe have provided a wizard command(wancfg_dadhi)  to configure the Sangoma pri cards
    wancfg_dahdi commands prompts with necessary questions to configure the card either as E1 or T1 and other signaling modes.
    Before proceeding with the wancfg_wizard make sure you have inserted the sangoma card in necessary PCI slots in server and run the below command to make sure the card is detected by the linux OS.

lspci -v

the above command results with the card details as shown below

Sangoma Technologies Corp. A200/Remora FXO/FXS Analog AFT card

If the card is detected proceed with the wancfg_dahdi wizard, if not check the card for any damage or insert in another PCI slots and check

wancfg_dadhi wizard

    Run the command wancfg_dahdi, you will promoted few questions as shown below proceed with the necessary details, as per this tutorial i have E1 connection

wancfg_dadhi
would you like to generate /etc/asterisk/chan_dahdi.conf
1. YES
 2. NO
[1-2]:1
Select media type for AFT-A101 on port 1 [slot:4 bus:4 span:1]
 1. T1
 2. E1
 3. Unused
 4. Exit
[1-4]:2

Note: for the above option select 1 if you are using T1 like example US based ISDN lines

Configuring port 1 on 101 as E1, line coding:HDB3, framing:CRC4
 1. YES - Keep these settings
 2. NO  - Configure line coding and framing
[1-2, ENTER='YES']:1

note: for the above option you need to ask your provider for the details like crc4 to be enabled or disabled from your side, if its enable from provide side you need to disable in your pbx.

Select clock for AFT-A101 on port 1 [slot:4 bus:4 span:1]
 1. NORMAL
 2. MASTER
[1-2]:2

note: if this is the first card select master, if it is second cards select 1

Select signaling type for AFT-A101 on port 1 [slot:4 bus:4 span:1]
 1. Zaptel/Dahdi - PRI CPE
 2. Zaptel/Dahdi - PRI NET
 3. Zaptel/Dahdi - E & M
 4. Zaptel/Dahdi - E & M Wink
 5. Zaptel/Dahdi - FXS - Loop Start
 6. Zaptel/Dahdi - FXS - Ground Start
 7. Zaptel/Dahdi - FXS - Kewl Start
 8. Zaptel/Dahdi - FX0 - Loop Start
 9. Zaptel/Dahdi - FX0 - Ground Start
 10. Zaptel/Dahdi - FX0 - Kewl Start
 11. Sangoma SMG/sangoma_prid- PRI CPE
 12. Sangoma SMG/sangoma_prid- PRI NET
[1-12]:1
note: if the line is from the provider select 1 , if you are connecting card to another pbx select 2

Select switchtype for AFT-A101 on port 1
 1. National ISDN 2
 2. Nortel DMS100
 3. AT&T 4ESS
 4. Lucent 5ESS
 5. EuroISDN
 6. Old National ISDN 1
 7. Q.SIG
[1-7]:5
Configuring port 1 on AFT-A101 as a full E1
 1. YES - Use all channels
 2. NO  - Configure for fractional
[1-2, ENTER='YES']:1
Select dialplan context for AFT-A101 on port 1
 1. from-pstn
 2. from-internal
 3. Custom
[1-3]:3
Enter the Context:trunkinbound

note: For above option , if you are using freepbx select option 1, as i am using vicidial which uses trunkinbound as incoming context to receive incoming calls.

Input the group for this port
:0

For the above option enter a number, like 0 , 1, 2  same number should be used in the dialplan for dahdi channel example, DAHDI/g0 or DAHDI/g1

Port 1 on AFT-A101 configuration complete...
Press any key to continue:
T1/E1 card configuration complete.
Press any key to continue:
Configuration Complete! Please select following:
 1. YES - Continue
 2. NO - Exit
[1-2]:1
Dahdi and Wanpipe configuration complete: choose action
 1. Save cfg: Restart Asterisk & Wanpipe now
 2. Save cfg: Restart Asterisk & Wanpipe when convenient
 3. Save cfg: Stop Asterisk & Wanpipe now
 4. Save cfg: Stop Asterisk & Wanpipe when convenient
 5. Save cfg: Save cfg only (Not Recommanded!!!)
 6. Do not save cfg: Exit
[1-6]:1
Would you like wanrouter to start on system boot?
 1. YES
 2. NO
[1-2]:1
Would you like to execute 'dahdi_cfg' each time wanrouter starts?
 1. YES
 2. NO
[1-2]:1

Step 5: Checking Trunk status

    Once the configuration completed, reboot the server once to effect all the configuration,
    once the Server is up , run the below command to check the trunk status 

Wanrouter status   ; it should show connected
Run below command to check the channels configured
dahdi_cfg -v

Checking the Trunk status from asterisk cli 

 asterisk -vvvvr
 dahdi show status
 dahdi show channels
 pri show spans

Step 6: Asterisk Dialplan for wanpipe

    Once the Card is configured and Trunk status is up and running proceed with the asterisk dialplan, if you are using Freepbx you have to use the Freepbx gui to configure the Trunk and outbound routes.

If you are using Vicidial based dialers proceed with below dialplan

exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,n,Dial(DAHDI/g0/${EXTEN:1},,Tto)
exten => _9X.,n,Hangup()

Step 7 : Troubleshoot Trunk issue

    As per the Step 5 if the Trunk status is not connected or showing down, you need to check the below list
1. PRI trunk cabling
    Make sure cable used is as per PRI cabling standard
2. CRC4 enabled or disabled
3.  run wanrouter restart 
4. Make sure latest dahdi and wanpipe driver installed.

Support

    Hope the article is helpful in configuring your sangoma E1/T1/ISDN/PRI digital telephony cards in asterisk , For professional support reach me on skype or telegram :striker24x7

1 Comments
  • Ajit Kumar
    Ajit Kumar April 4, 2022 at 11:41 AM

    Sangoma Card Asterisk , goautodial, vicidial , Freepbx

Add Comment
comment url