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.
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.tgztar -xvzf wanpipe-current.tgzcd 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
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
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
1. YES2. NO[1-2]:1
1. T12. E13. Unused4. Exit[1-4]:2
Note: for the above option select 1 if you are using T1 like example US based ISDN lines
1. YES - Keep these settings2. 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.
1. NORMAL2. MASTER[1-2]:2
note: if this is the first card select master, if it is second cards select 1
1. Zaptel/Dahdi - PRI CPE2. Zaptel/Dahdi - PRI NET3. Zaptel/Dahdi - E & M4. Zaptel/Dahdi - E & M Wink5. Zaptel/Dahdi - FXS - Loop Start6. Zaptel/Dahdi - FXS - Ground Start7. Zaptel/Dahdi - FXS - Kewl Start8. Zaptel/Dahdi - FX0 - Loop Start9. Zaptel/Dahdi - FX0 - Ground Start10. Zaptel/Dahdi - FX0 - Kewl Start11. Sangoma SMG/sangoma_prid- PRI CPE12. Sangoma SMG/sangoma_prid- PRI NET[1-12]:1
1. National ISDN 22. Nortel DMS1003. AT&T 4ESS4. Lucent 5ESS5. EuroISDN6. Old National ISDN 17. Q.SIG[1-7]:5
1. YES - Use all channels2. NO - Configure for fractional[1-2, ENTER='YES']:1
1. from-pstn2. from-internal3. 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.
: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
Press any key to continue:
Press any key to continue:
1. YES - Continue2. NO - Exit[1-2]:1
1. Save cfg: Restart Asterisk & Wanpipe now2. Save cfg: Restart Asterisk & Wanpipe when convenient3. Save cfg: Stop Asterisk & Wanpipe now4. Save cfg: Stop Asterisk & Wanpipe when convenient5. Save cfg: Save cfg only (Not Recommanded!!!)6. Do not save cfg: Exit[1-6]:1
1. YES2. NO[1-2]:1
1. YES2. 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
dahdi_cfg -v
Checking the Trunk status from asterisk cli
asterisk -vvvvrdahdi show statusdahdi show channelspri 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()
Sangoma Card Asterisk , goautodial, vicidial , Freepbx