Sangoma Media Gateway BRI - EOL
Sangoma AFT A500/B700 BRI is compatible with Asterisk and Callweaver and FreeSwitch
Sangoma AFT-A500/B700 + SMG/Netbricks BRI + Sangoma MGD solution obtains TBR3 Certification with any version of Asterisk.
The A500/B700 BRI card can operate with Asterisk in following mode:
- Asterisk + SMG/Netbricks BRI + TDM API + Wanpipe Hardware Drivers
The A500/B700 BRI cards operates under TDM API (not zaptel). The TDM API is Sangoma open source TDM kernel driver.
The Sangoma SMG/BRI A500/B700 card with Asterisk:
- Download drivers
- Hardware Installation
- A500 Installation Manual - PDF
- B700 Installation Manual - PDF
- Asterisk Installation
- Sangoma Wanpipe Installation
- Sangoma SMG/BRI Installation
- Sangoma SMG/BRI Configuration/Operation
- Asterisk SMG/BRI Debugging
- Driver Change Log
- Sangoma BRI Support
- Advanced BRI stack options
- A500 BRI Cable Pinouts
- A500 BRI as Timing source for Asterisk
- Advanced BRI debugging
- FAQ
Wanpipe drivers for BRI b
Feature Frozen drivers: BRI A500 Only
It is always recommended to use the feature frozen drivers unless you require a feature that is only available in the BRI latest drivers.
Drivers: latest 3.4.X Release. [ChangeLog]
Latest drivers: BRI A500 & B700
Wanpipe BRI latest drivers include the Wanpipe hardware drivers with updated Sangoma MGD and BRI protocol stack.
Drivers: latest 3.5.X Release. [ChangeLog]
For an animated demo of how to install the A500, go to:
http://www.sangoma.com/products_and_solutions/hardware/digital_telephony_and_data/a500.html
Click on View Demo.
A500 BRI Termination resistors to switch between NT and TE modes
The A500 comes with termination resistors that have to be disabled (set to OFF) when running in TE mode and enabled (set to ON) when running in NT mode.
The resistors corresponding ports 1 and 2 are closest to the PCI base.
The ON position is closer to the NT/TE modules.
The OFF position is closer to the RJ-45 connectors.

- Confirm that your system has the required packages.
- Download and install latest asterisk 1.2 or asterisk 1.4 release from www.asterisk.org
Copy asterisk release into /usr/src/ directory
#> cp asterisk-<version>.tar.gz /usr/src
Untar asterisk release:
#> tar xvfz asterisk-<version>.tar.gz - Remove existing Asterisk libraries.
If you already have an old asterisk installation make sure to remove old asterisk modules.
#> cd /usr/lib/asterisk
#> rm -rf modules - Compile and install Asterisk.
Create a symbolic link in /usr/src/asterisk that points to your Asterisk source.
(asterisk-1.2.24 is used as an example)
#> cd /usr/src
#> ln -s asterisk-1.2.24 asterisk
Change directory to asterisk source directory
#> cd asterisk
If you are using Asterisk-1.4 or later, run:
#> ./configure
Compile asterisk:
#> make clean
#> make
#> make install
If this is very first time you are installing asterisk also run:
#> make samples
Sangoma Wanpipe Drivers Installation + BRI/SMG (Full installation)
This will install the hardware drivers, BRI protocol stack and Sangoma Media Gateway for Asterisk.
Note: You need to install Asterisk before installing Wanpipe + SMG.
- Download latest Wanpipe BRI release:
--> Latest 3.4.X Release
--> ChangeLog - Copy and untar the wanpipe package into /usr/src directory:
#> cp wanpipe-<version>.tgz /usr/src
#> cd /usr/src
#> tar xvfz wanpipe-<version>.tgz - Change directory to the Wanpipe source directory:
#> cd wanpipe-<version> - Start Wanpipe installation:
#> ./Setup install
Choose Default values. Select "Y" for each option.
If you only have AFT-A500's on your system.
Select option #6 SMG (BRI)
If you have AFT-A500's and other Sangoma TDM Voice cards (A10x/A20x/A40x).
Select option #7 SMG (BRI) + Zaptel Support.
- Confirm that the Wanpipe drivers have been installed properly.
Type:
#> wanrouter hwprobe
You should see list of A500 ports installed on your machine
#> wanrouter hwprobe verbose
You should see list as above with detailed hardware modules info (TE/NT).
Sangoma BRI protocol stack and Media Gateway Installation only.
Note: You can skip this section if you did a full Wanpipe BRI/SMG Installation. (Selected option 6 or 7 during Wanpipe drivers installation).
- At this point we are still in wanpipe source directory created by untarring the wanpipe package.
We will run the same ./Setup script from above to install the SMG and BRI Stack.
#> ./Setup smgbri
This step will proceed to build the SMG daemon and install the SMG and the BRI stack.
The installation script will check for properly setup environment:- Check for Asterisk directory in /usr/src/asterisk
This was done in the above "Asterisk installation" step so it should be there. - Check for SCTP utilities and modules
All latest distros have support for SCTP (secure udp protocol).
If SCTP is not found, install script will attempt to install them for you.
- Check for Asterisk directory in /usr/src/asterisk
Sangoma SMG/BRI Configuration/Operation
After successful SMG/BRI installation the ./Setup script will prompt you to proceed with wanpipe/smg/bri configuration.
- Run the Wanpipe configuration script:
#> /usr/sbin/wancfg_smg
The wancfg_smg script will proceed to configure each A500 BRI Port. - After wancfg_smg configures all the cards, you will have an option to stop and restart Wanpipe/SMG/BRI and Asterisk.
If you do not select the "Restart Wanpipe/SMG/BRI and Asterisk option:
The startup procedure is comprised of three steps:
1. wanrouter start
Starts all wanpipe A500 BRI ports:
2. smg_ctrl start
#> wanrouter start
Usage: wanrouter [start|stop|restart]
Starts SMG/BRI daemons. (equivalent to ztcfg step when working with zaptel):
3. asterisk
#> smg_ctrl start
Usage: smg_ctrl [start|stop|restart]
Start asterisk:
#> asterisk
Connect to asterisk CLI:
#> asterisk -r - At this point we are ready to write our Dial Plan in /etc/asterisk/extensions.conf
Asterisk will connect to the SMG daemon using a woomera channel driver.
The Dial Plan syntax is 100% identical to Zaptel but instead of using Zap as a channel identifier we will use WOOMERA.
This is an example of /etc/asterisk/extensions.conf
;Sangoma SMG Outbound context
;Place call on woomera channel to SMG/BRI
;==================================
[outb]
exten => _X.,1,noop
exten => _X.,n,Dial(WOOMERA/g1/${EXTEN}|60|o)
exten => _X.,n,Hangup
;Sangoma SMG Incoming Contexts
;Context name defined in /etc/asterisk/woomera.conf
;====================================
[sangoma]
exten => _X.,1,noop
exten => _X.,n,Playback(demo-congrats)
exten => _X.,n,Hangup
;Early Media Example
;To play a file without answering the call
[sangoma4]
exten => _X.,1,noop
exten => _X.,n,Playback(demo-congrats|noanswer)
exten => _X.,n,Hangup - At this point, the system is ready to make test calls.
Asterisk SMG/BRI Troubleshooting Debugging
Each component in the Asterisk SMG/BRI architecture has their own log file.
- Confirm that wanpipe drivers have been started.
#> wanrouter status
Confirm that all ports are in connected/connecting/disconnected state.
Note:In some countries, the physical lines start in power-saving mode, or go to power-saving after a few seconds of inactivity. Therefore, it is normal to see a BRI port in connecting or disconnected state even if a physical line is connected.
#> ifconfig
Confirm that each port device w1g1, w2g1, w3g1 exists and that Rx/Tx counts are incrementing.
Confirm that there are no overruns or errors in interface statistics.
#> tail -f /var/log/messages
All wanpipe driver errors and events are logged in /var/log/messages
To start/stop/restart wanpipe drivers run: wanrouter [start|stop|restart] - Confirm that SMG/BRI stacks are up
#> ps fax | grep sangoma
Visually confirm that sangoma_mgd and sangoma_brid are running.
To start/stop/restart the SMG/BRI use smg_ctrl script:
#> /usr/sbin/smg_ctrl [start|stop|restart]
All events, errors or logs for SMG are logged in /var/log/sangoma_mgd.log
All BRI protocol events and traces are logged in /var/log/sangoma_bri.log
- Increase the BRI Daemon/Sangoma Media Gateway verbosity to 5
Open a separate SSH window and type:
#> tail -f /var/log/sangoma_mgd.log
This should output the debugging of Sangoma Media Gateway
In the original SSH window, type:
#> smg_ctrl v+
You should see the message "Verbose level set to N" in the sangoma_mgd.log
Repeat this command until the verbosity is at least 5. - Enable protocol capture.
#> smg_ctrl capture
This will enable logging of the BRI protocol in /var/log/sangoma_bri.log
You should see "Protocol capture enabled" in /var/log/sangoma_mgd.log - Make an outgoing call from Asterisk.
You should see a message like:
(sN) Outgoing call (N-Id:X S-Id:X)
(sN) Called Nb: [.....] Calling Nb:[.....] .....
where N is the span number , in your /var/log/sangoma_mgd.log
Once the remote party answers the call, you should see "Call connected"
If the call fails, and your port was in connecting or disconnected state in step 1 (wanrouter status), confirm that the port went to connected state while attempting to make the outgoing call. I
If the port stayed in connecting or disconnected state, you have a physical layer problem, check your cables.
If the port switched to connected state, but the call failed, you have a protocol problem. Check /var/log/sangoma_mgd and /var/log/sangoma_bri.log for protocol errors. If you cannot determine the protocol errors, email your configuration and log files to Sangoma Tech Support. List of files and info required when contacting Techdesk
- Make an incoming call from Asterisk:
You should see a message like:
(sNcX) Incoming call on Trunkgrp:X....
Once the remote party answers the call, you should see "Call connected"
Note:
With some ISDN lines the telco provides you with two sperate jacks, this is so you can plug an ISDN phone into each and utilize both B channels. Now when you connect our card to these jacks insure one jack remains empty and the other our card is plugged into. Now if you are plugging two different devices into one ISDN line (2B+1D) then insure you configure each device to have its own MSN. Please see http://wiki.sangoma.com/BriAdvancedOptions#msn to configure the MSN values.
Advanced BRI Debugging Option : For Span and Call States
Note : This feature will be supported from Sangoma BRI Daemon Version: v1.39 . (Wanpipe-3.3.9 and newer version will have this feature)
- Add following line in /etc/syslog.conf or /etc/rsyslog.conf ( Some distro uses rsyslog instead of syslog )
----------------------------------------cut here----------------# Sangoma BRI Daemon (smg_bri) log
local4.* /var/log/sangoma_bri_debug.log
--------------------------------------------cut here-------------- To apply changes run following commands
# /etc/init.d/syslog restart or #/etc/init.d/rsyslog restart
- Run following command to check configured spans status
# smg_ctrl show_spans
#tail -f /var/log/sangoma_bri_debug.log
May 1 11:11:08 trixbox1 smg_bri[12482]: ==========================Spans==============================
May 1 11:11:08 trixbox1 smg_bri[12482]: # prot phy ch func grp
May 1 11:11:08 trixbox1 smg_bri[12482]: 1 Up Up 0 te 2
May 1 11:11:08 trixbox1 smg_bri[12482]: 2 Up Up 0 te 2
May 1 11:11:08 trixbox1 smg_bri[12482]: =============================================================
- Run following command to check active calls
# smg_ctrl show_calls
#tail -f /var/log/sangoma_bri_debug.log
May 1 11:12:02 trixbox1 smg_bri[12482]: ==========================Calls==============================
May 1 11:12:02 trixbox1 smg_bri[12482]: ID state span chan n-id s-id
May 1 11:12:02 trixbox1 smg_bri[12482]: 1 up 1 1 1 7
May 1 11:12:02 trixbox1 smg_bri[12482]: 2 up 2 1 3 0
May 1 11:12:02 trixbox1 smg_bri[12482]: =============================================================
- Each time one of the command is run appropriate info will be logged in to /var/log/sangoma_bri_debug.log
For initial support and questions contact Sangoma Techdesk:
http://wiki.sangoma.com/SangomaTechSupport
See the "Asterisk and BRI" section for list of required information
You can also email new feature requests to:
Nenad Corbic <ncorbic@sangoma.com> - Project Manager
David Yat Sin <davidy@sangoma.com> - BRI Stack Developer/Engineer
- Why can not call out on my BRI phone connected to the A500?
The is a default minimum number of digits is 8, to change this edit your "/etc/wanpipe/smg_bri.conf" and add the line "num_digits=1" or whichever number you would like. After this change is made run "smg_ctrl restart" and this will apply the changes.







