Asterisk®-based PBX Solutions

TwinStar: Full PBX Redundancy

Xorcom's dual-server high availability solution for Asterisk-based PBX Best of Show Award for TwinStar
received the "Best of Show" award. Find out why!
Join the Xorcom Partner Channel
 

Astribank 2 Drivers: Zaptel Notes

On this page:

Go to... How to Reset the Astribank 2 Device When Zaptel is Used

Go to... How to Configure the Zaptel Channels

pdf Download Complete Instructions as PDF File (423.27 Kb)

How to Reset the Astribank 2 Device When Zaptel is Used

  1. Stop Asterisk:
    amportal stop
    Please be aware that the 'amportal' command does not always stop Asterisk. Therefore, you must verify that Asterisk has indeed been stopped. You can use command:
    ps -A | grep asterisk to check if the asterisk and safe_asterisk processes have been terminated. You also can stop Asterisk by running the Asterisk initialization script:
    /etc/init.d/asterisk stop
  2. Once Asterisk is stopped you can stop Zaptel:
    /etc/init.d/zaptel stop
  3. Now you can reset the Astribank firmware. The simplest way is just to switch off/on the Astribank devices. If you are not able to do this, then:
    cd /tmp
    wget
    http://svn.digium.com/svn/dahdi/tools/trunk/xpp/astribank_upgrade
    chmod +x astribank_upgrade
    ./astribank_upgrade /usr/share/zaptel

    Please note, that the astribank_upgrade script is needed only for this particular version upgrade. For future upgrades the /usr/share/zaptel/xpp_fxloader utility will be used, as it was in the past. Wait 10-20 seconds and then make sure that the devices are initialized:
    /usr/share/zaptel/waitfor_xpds
  4. Start Zaptel and Asterisk:
    /etc/init.d/zaptel start amportal start

How to Configure the Zaptel Channels

You can configure the Zaptel channels either manually or by using the detect_zap script that is provided by the freepbx-module-zapauto package. The minimum version number of freepbx-module-zapauto package is 0.7.3-1.

  1. Define the desired order of the Zaptel channels to be registered. By default, the channels related to the installed Zaptel equipment will be registered in the Zaptel framework in the following order:
    1. all non-Astribank related channels (e.g., Digium PCI boards, etc.)
    2. all Astribank related channels.
    All of the connected Astribank devices will be sorted alphabetically, based on the USB connector strings. So, if you swap Astribank devices or add a new device, then the order of the channels will get mixed up. In order to avoid this problem and put the Zaptel channels registration under control, you can list the device labels or/and USB connector strings in the desired order in the /etc/xpp_order file. You can see the Astribank labels and USB connectors in the output of the zaptel_hardware -v command. For example:

    # zaptel_hardware -v
    usb:001/007     xpp_usb+      e4e4:1152 Astribank-multi FPGA-firmware
      LABEL=[usb:000169]     CONNECTOR=usb-0000:00:03.3-5
         XBUS-01/XPD-00: FXS      Span 5
         XBUS-01/XPD-10: FXS      Span 6
         XBUS-01/XPD-20: FXS
         Span 7
         XBUS-01/XPD-30: FXS
         Span 8
    usb:001/008
         xpp_usb+      e4e4:1152 Astribank-multi FPGA-firmware
      LABEL=[usb:0000149]
       CONNECTOR=usb-0000:00:03.3-4
         XBUS-02/XPD-00: E1_TE   Span 1 DAHDI-SYNC
         XBUS-02/XPD-10: FXS       Span 2
         XBUS-02/XPD-20: FXS       Span 3
         XBUS-02/XPD-30: FXS       Span 4

    The simplest way to create the /etc/xpp_order file is to run:
    zapconf xpporder


    and then to edit the file manually. Following is an example of the file content:

    # Autogenerated by /usr/sbin/zapconf on Sun May 3 08:38:15 2009
    # If you edit this file and execute /usr/sbin/zapconf again,
    # your manual changes will be LOST.
    #
    # This is an optional configuration file for ordering
    # Zaptel registration.
    #
    # It is read from /etc/xpp_order. This location
    # may be overwritten via the environment variable XPPORDER_CONF
    #
    # Lines may contain:
    # - The Astribank label (verbatim)
    # - The Astribank connector string (prefixed with @)
    # Ordering number of each listed Astribank is determined
    # by its position in this file.
    # Astribanks not listed in this file, get an ordering
    # number of 999 (last).
    #
    # Astribanks with same ordering number are sorted by their
    # connectors (to preserve legacy behavior).
    #
    # Examples:
    # usb:TWS-08
    # @usb-0000:06:02.2-2usb:000169
    # @usb-0000:00:03.3-5 usb:0000149
    # @usb-0000:00:03.3-4


    Please note that channels of the Astribank devices that are not listed in the file will be registered following the Astribanks listed in the xpp_order file, based on the order of their USB connector strings.
  2. Install the freepbx-module-zapauto If the xorcom.repo repository is configured on the server then you can install the package as follows: yum install freepbx-module-zapauto Alternatively, you can download the latest freepbx-module-zapauto package from http://updates.xorcom.com/astribank/elastix/repo.
  3. Now you can perform the hardware detection. Be aware that the command below will remove all Zaptel related settings from the server. Please read the explanation below before you run the following detect_zap script:
    /var/lib/asterisk/bin/detect_zap

    The detect_zap performs the following actions:
  1. removes all of current Zaptel-related configuration settings
  2. performs Zaptel hardware detection
  3. puts all trunk channels (FXO, PRI, BRI) in /etc/asterisk/zapata-channels.conf
  4. creates FreePBX extensions for Zaptel channels (FXS). By default, detect_zap will assign consecutive extension numbers starting with 401 to each Zaptel extension it detects. If those numbers are already in use by non Zaptel extensions, detect_zap will fail to work properly. You can define a new starting extension number in variable ZAP_FIRST_CHANNEL in the /etc/amportal.conf file. For example, if you want detect_zap to create extensions with numbers starting with 1001 then you must define:
    ZAP_FIRST_CHANNEL=1001
  5. causes the FreePBX to re-build the configuration including zapata_additional.conf (where Zaptel extensions are configured)
  6. rebuilds /var/lib/asterisk/bin/astdb
  7. assigns all trunk channels (FXO, PRI) to group 0, and creates a trunk in FreePBX
  8. creates an outbound rule in the FreePBX configuration with dial pattern '9|.'

Other Astribank Configuration Parameters

For a detailed explanation of other Astribank configuration parameters, please refer to the README.Astribank file, found in the sources of Zaptel (http://svn.digium.com/svn/zaptel/branches/1.4/kernel/xpp/README.Astribank). We have chosen to describe the most important parameters here:

File /etc/xpp.conf

Information from this file is used by the Astribank drivers during their initialization. If you are using Astribank E1/T1 and you want to configure it for the T1 mode, then define parameter:

pri_protocol T1

If you need to define the country specific settings for the FXO ports then define the 'opermode' parameter. For example:

opermode FRANCE

File /etc/genconf_parameters

Information from this file is used by zapconf utility. This is standard Zaptel utility used for the hardware detection and automatic configuration building. This utility is called by detect_zap. The most important parameters that may be defined in this file are as follows: pri_termtype – defines the function group for a particular PRI port (TE or NT). If the parameter is not defined, then zapconf utility will consider all ports as TE and define 'signalling = pri_cpe' in the /etc/asterisk/zapata-channels.conf file.

For example, if you want to define one PRI port as TE and another as NT then you can define the pri_termtype parameter for the NT port as follows:

pri_termtype

SPAN/3 NT

Obviously, you will have to define a corresponding Span number. If you want all PRI ports to be defined as NT then you can define:

pri_termtype

SPAN/* NT

Last Updated ( Tuesday, 26 May 2009 )
 
  • Send to a friend
  •  
    Bookmark and Share

    Astribank Wins Best of Show

    Astribank, Xorcom's innovative USB-connected channel bank specifically designed for Asterisk, was awarded "Best of Show" in the "Open Source Solution" category at the IT Expo held recently in Los Angeles.
    Watch video interview from the event.

    Can You Run 300 Concurrent Calls on an Asterisk Server?

    Find out the answer and more in the results from load tests recently performed on the XR3000, and explained in the "Five Culprits that Kill Asterisk IP-PBX Performance" recorded webinar.


    U.S. & Canada Latin America EMEA APAC Africa
    Feedback Form