SANGOMA

Sangoma Wanpipe: Asterisk SMG/BRI Install


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:

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

  1. Download drivers
  2. Hardware Installation
  3. A500 Installation Manual - PDF
  4. A700 Installation Manual - PDF
  5. Asterisk Installation
  6. Sangoma Wanpipe Installation
  7. Sangoma SMG/BRI Installation
  8. Sangoma SMG/BRI Configuration/Operation
  9. Asterisk SMG/BRI Debugging
  10. Driver Change Log
  11. Sangoma BRI Support
  12. Advanced BRI stack options
  13. A500 BRI Cable Pinouts
  14. A500 BRI as Timing source for Asterisk
  15. Advanced BRI debugging
  16. FAQ

 


Wanpipe drivers for BRI

Stable drivers:  BRI A500 Only
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.4.X Release. [ChangeLog]

Beta drivers:  BRI A500 & B700
Wanpipe BRI beta drivers include the stable Wanpipe hardware drivers with updated Sangoma MGD and BRI protocol stack.
Stable: latest 3.5.X Release. [ChangeLog]


ChangeLog


 

Hardware Installation

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.
A500-resistors.jpg

 

Asterisk Installation

  1. Confirm that your system has the required packages
  2. 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  
  3. 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  
  4. 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.

  1. Download latest Wanpipe BRI release:
    --> Latest 3.4.X Release
    --> ChangeLog        
  2. Copy and untar the wanpipe package into /usr/src directory:
    #> cp wanpipe-<version>.tgz  /usr/src
    #> cd /usr/src
    #> tar xvfz wanpipe-<version>.tgz  
  3. Change directory to the Wanpipe source directory:
    #> cd wanpipe-<version>   
  4. 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.
  5. 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).

  1. 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:
    1. Check for Asterisk directory in /usr/src/asterisk 
      This was done in the above "Asterisk installation" step so it should be there.  
    2. 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.

  1. Run the Wanpipe configuration script:
             #> /usr/sbin/wancfg_smg

    The wancfg_smg script will proceed to configure each A500 BRI Port.
  2. 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

  3. 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

  4. 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.

  1. 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]  
  2. 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

  3. 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.
  4. 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
  5. 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

  6. 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)

 

  1.  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-------------

  2. To apply changes run following commands
    # /etc/init.d/syslog restart  or  #/etc/init.d/rsyslog restart

  3. 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]: =============================================================

  4. 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]: =============================================================

  5. Each time one of the command is run appropriate info will be logged in to /var/log/sangoma_bri_debug.log


Sangoma 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 



FAQ

  • 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.

 

Comments

From afaiz - 7/13/09 11:02 AM

Here are some settings that worked for me for an A500 BRI installation in China. It took me a really long time to get this right - due to some non-existent documentation of the ISDN NT1 device at the customer premises.

The NT1 device accepts a U-interface (2-wire) input from telco. From there, it had two ST-interface (NT2) outputs. On the other side of the connection was an A500 on TE mode.

The cable used to connect both sides can be either one of:

a) The Y-cable supplied by Sangoma
b) A normal RJ45 network cable

The following applies:

1) Use ONLY one of the two ST ports to connect to an A500
2) If you use a single RJ45 cable, the odd-numbered channel on the A500 port will be used. E.g. plugged into port #2, WOOMERA/3 will be active.

Wanrouter version: 3.4.1

/etc/wanpipe/smg_bri.conf settings that worked for me:

    verbose=5
    prot_capture=yes
    dchan_log=no
    dialplan=subscriber
    numberingplan=unknown
    servicetype=voice

    group=1
    country=taiwan
    connection_type=point_to_multipoint
    signalling=bri_te
    spans=1,2,3,4,5,6


Hope this helps those of you out there!

 

From karsten - 5/1/09 7:56 PM

Figure out the correct resistors for NT mode. If the Module is in SLOT 1 (the slot near the breakout) then you need SW1 and SW2 to ON position (default = OFF) like the picture below.
For the middle (SLOT 2) you need SW3 and SW4 in ON position (if NT enabled).

And for the last Module 3 in NT mode (near the 12V connector) you need SW5 and SW6 in ON mode. A500 resistors.

Site

Changes
Index
Search

 

User

 

Log In
Register

 
 

Last Modified 6/24/09 10:51 AM