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

Sangoma E1/T1/ISDN/PRI Card Configuration

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

how to configure sangoma cards

  Overview: Sangoma E1 card - Asterisk -Vicidial

    In this blog article i have provided the step by step guide to install and configure the sangoma Telecom cards (E1/T1/ISDN/PRI) in asterisk based Telecommunication software's like Vicidial, Freepbx, Issabel, Goautodial etc.

  About: 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.

  E1/T1-PRI/ISDN

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

  Steps: 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 if you are using asterisk Telephony software, follow the below link to install dahdi if it is not installed.

  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

Installing wanpipe 

cd /usr/src/
wget https://ftp.sangoma.com/linux/current_wanpipe/wanpipe-7.0.34.tgz
tar -xvzf wanpipe-7.0.34.tgz
cd wanpipe-7.0.34
./Setup dahdi
Refer below link if you want to install or reinstall wanpipe

  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

    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
    check the below post for the PRI cabling for E1
2. CRC4 enabled or disabled
3.  run wanrouter restart 
4. Make sure latest dahdi and wanpipe driver installed.

  Support

    For professional support reach me on skype:striker24x7

Next Post Previous Post
1 Comments
  • gopi baskar
    gopi baskar April 4, 2022 at 11:41 AM

    Sangoma Card Asterisk , goautodial, vicidial , Freepbx

Add Comment
comment url