Sangoma Wanpipe: Asterisk SMG/BRI Install
Sangoma AFT A500 BRI is compatible with Asterisk and Callweaver. Support for FreeSwitch is coming soon.
Sangoma AFT-A500 + SMG/Netbricks BRI + Sangoma MGD solution obtains TBR3 Certification with any version of Asterisk.
The A500 BRI card can operate with Asterisk in following mode:
- Asterisk + SMG/Netbricks BRI + TDM API + Wanpipe Hardware Drivers
The A500 cards operates under TDM API (not zaptel). The TDM API is Sangoma open source TDM kernel driver.
Asterisk connects to a Sangoma Media Gateway daemon (SMG) that contains a proprietary certified BRI stack from Netbricks, and SMG connects to TDM API and A500 card.
This document will discuss how to configure and install the A500 BRI
card with Asterisk and Sangoma's new SMG (Signal Media Gateway) that
contains a proprietary, certified BRI stack!
The Sangoma SMG/BRI A500 card with Asterisk:
- Download drivers
- Hardware Installation
- Asterisk Installation
- Sangoma Wanpipe Installation
- Sangoma SMG/BRI Installation
- Sangoma SMG/BRI Configuration/Operation
- Asterisk SMG/BRI Debugging
- A500 Driver Change Log
- A500 BRI Support
- Advanced BRI stack options
- A500 BRI Cable Pinouts
- A500 BRI as Timing source for Asterisk
Wanpipe drivers for BRI
Stable drivers:
It is always recommended to use the stable drivers unless you require a feature that is only available in the BRI beta drivers.
Stable: latest 3.3.X Release. [ChangeLog]
Beta drivers:
Wanpipe BRI beta drivers include the stable Wanpipe hardware drivers with updated Sangoma MGD and BRI protocol stack.
Beta: wanpipe-3.3.10.bri.p4.tgz [ChangeLog]
ChangeLog
[07-04-2008] - Wanpipe-3.3.120.bri.p4
- Support for test mode (smg_ctrl test)
- Uses wanpipe-3.3.10 hardware drivers. [Changelog]
[07-04-2008] - Wanpipe-3.3.120.bri.p3
- Support for non-syslog logging
- Uses wanpipe-3.3.10 hardware drivers. [Changelog]
[06-24-2008] - Wanpipe-3.3.10.bri.p2
- Fixed some scripting issues that would cause compilation errors on Ubuntu
- Uses wanpipe-3.3.10 hardware drivers. [Changelog]
[06-17-2008] - Wanpipe-3.3.10.bri.p1
- New smg_brid version 1.40
- Fix for some cases where network release cause would be specified as normal (16) due to line being disconnected.
- Uses wanpipe-3.3.10 hardware drivers. [Changelog]
Hardware Installation
For an animated demo of how to install the A500, go to:
http://sangoma.com/datasheets/A500BRI
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.

Asterisk Installation
- 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 package name> /usr/src
Untar asterisk release:
#> tar xvfz <asterisk release name>
- Asterisk pre-installation Check
If you already have an old asterisk installation make sure to remove old asterisk modules.
#> cd /usr/lib/asterisk
#> rm -rf modules
- Asterisk installation
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 newly untarred asterisk 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 fist time you are installing asterisk also run:
#> make samples
Sangoma Wanpipe Installation.
Note: You need to install Asterisk before installing Wanpipe + SMG.
- Download Latest Sangoma BRI Release:
--> Latest 3.3.X Release
--> ChangeLog
- Copy and Untar the wanpipe package into /usr/src directory:
#> cp <wanpipe package tgz file> /usr/src
#> cd /usr/src
#> tar xvfz <wanpipe package tgz file>
- Change directory into newly created wanpipe source directory:
#> cd wanpipe-<version>
- Start Wanpipe installation:
#> cd wanpipe-<version>
#> ./Setup install
Select option #6 SMG (BRI)
For the rest of the options please choose Default values.
Proceed with installation Select "Y" for each option.
- At this point Wanpipe drivers have been installed properly:
#> wanrouter hwprobe
You should see list of A500 ports installed on your machine
#> wanrouter hwprobe verbose
You should see list as above along with detailed port info like TE/NT mode
Sangoma SMG/BRI Installation
Note: SMG/BRI is installed automatically if option 6 is selected on Wanpipe-3.3.0.2 drivers or later. Skip this step if you selected option 6 or 7 for the compilation options when running ./Setup install .
- 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.
If the SMG/BRI installation step fails please contact Sangoma Support!
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:
#> wanrouter start
Usage: wanrouter [start|stop|restart]
2. smg_ctrl start
Starts SMG/BRI daemons. (equivalent to ztcfg step when working with zaptel):
#> smg_ctrl start
Usage: smg_ctrl [start|stop|restart]
3. asterisk
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:
If you have only one ISDN line from the telco insure that both B channels (S/T) is going to our card. If telco splits the ISDN line into 2 U interfaces then insure that our card is configured for point to multi point and the MSN's are configured correctly. Please see http://wiki.sangoma.com/BriAdvancedOptions#msn to configure the MSN values.
A500 BRI Support
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
|