SANGOMA

Wanpipe Asterisk Appendix

Appendix

  1. Zaptel Adjustable Chunk Size
  2. RTP TAP Call Recording Feature
  3. Sample Zaptel Config Files ( /etc/zaptel.conf )
  4. Sample Zapata Config files ( /etc/asterisk/zapata.conf )
  5. HOTPLUG Conflicts with WANPIPE (Linux only)
  6. Exec "ztcfg" after wanrouter start
  7. Updating FLASH on AFT Cards
  8. Multiple ZAPTEL Releases AND Wanpipe Crashing
  9. Multiple ZTCFG executions on bootup
  10. UDEV Conflicts with ZAPTEL
  11. A101/2/4/8 TE1 Clock Synchronization
  12. Cable Pin Outs
  13. Firmware Version 
  14. Asterisk PRI Fails to Come Up or Oscillates up and down
  15. PRI got event: HDLC Bad FCS, D-Channels oscillates up and down
  16. Noise on A104D when running Voice & Data Channels
  17. Everything loads, but Asterisk does not see incoming call or off-hook state on analog cards.
  18. Installing Wanpipe on Suse
  19. Using PRI and T1/E1: Incoming calls work fine, but cannot dial out
  20. Cannot Load Zaptel module because crc_ccitt table not found
  21. Patlooptest
  22. Ouch ... error while writing audio data: : Broken pipe
  23. Compile Warning on 2.4 kernels: DEVFS HWEC not supported
  24. Failed to start echo canceller after improper shutdown
  25. Zaptel not compiling on Trixbox, RedHat and CentOs 
  26. Wanpipe Drivers experiencing Overruns
  27. Is my hardware echo canceller running?
  28. Wanpipe crashes the system on Trixbox 1.2
  29. DTMF detection
  30. Script to get notified when your T1/E1 PRI lines are down by Paul Norris
  31. System load simulation using SIPp
  32. MFC/R2 Configuration
  33. Install wanpipe driver on AsteriskNOW or Asterisk Business Edition 
  34. Zaptel Adjustable Chunk Size
  35. Asterisk Hardware DTMF
  36. Woomera configuration using FreePBX
  37. Sample Configuration of Sangoma card with other TDM Card
  38. Sample Configuration files for a J1 implementation
  39. Configuring A500 BRI as Timing source for Asterisk

 

Linux paths:
                Wanpipe configuration directory:         /etc/wanpipe
                Wanpipe executable/script directory:   /usr/sbin
                Asterisk configuration directory:           /etc/asterisk
                Zaptel configuration file:                       /etc/zaptel.conf

FreeBSD paths:
                Wanpipe configuration directory:          /usr/local/etc/wanpipe
                Wanpipe executable/script directory:    /usr/local/sbin
                Asterisk configuration directory:           /usr/local/etc/asterisk
                Zaptel configuration file                        /usr/local/etc/zaptel.conf




Sample Zaptel Config files ( zaptel.conf )

 

For additional information, you can find the original zaptel.conf file here.

Your zaptel.conf and zapata.conf should match your wanpipe configurations. The syntax for the span definitions are as follows:
      span=<span num>,<timing source>,
              <line build out (LBO)>,<framing>,<coding>[,yellow]

Note: If you are using wanpipe-beta2-2.3.4 or later, you can automatically configure our hardware based on your zaptel.conf file. Please refer to: http://sangoma.editme.com/wanpipe-asterisk-configure#auto for additional information.
 
 2 PRI T1 spans with B8ZS line decoding, ESF framing
   (A101/2/3/4/4D Cards)
   for example: 2 PRI telco lines in North America

   ---------cut here--------------------------- 
           loadzone = us
           defaultzone = us
 
           #span definitions
           span = 1,1,0,esf,b8zs
           span = 2,2,0,esf,b8zs
 
           #channel definitions
           #span 1
           bchan = 1-23
           dchan = 24
           #span 2
           bchan = 25-47
           dchan = 48
---------cut here--------------------------- 

2 RBS T1 spans with B8ZS line decoding, ESF framing
   (A101/2/3/4/4D Cards)
   for example: 2 E & M telco lines in North America

   ---------cut here--------------------------- 
           loadzone = us
           defaultzone = us
 
           #span definitions
           span = 1,1,0,esf,b8zs
           span = 2,2,0,esf,b8zs
 
           #channel definitions
           #span 1
           e&m = 1-24
           #span 2
           e&m = 25-48 
    ---------cut here---------------------------  
 
 2 PRI E1 spans with HDB3 line decoding, CCS framing, CRC4
   (A101/2/3/4/4D Cards)
   for example: 2 PRI telco lines outside of North America
 
   ---------cut here--------------------------- 
           loadzone = uk
           defaultzone = uk
 
           #span definitions           
           span = 1,1,0,ccs,hdb3,crc4,yellow
           span = 2,2,0,ccs,hdb3,crc4
 
           #channel definitions
           #span 1
           bchan = 1-15,17-31
           dchan = 16

           #span 2
           bchan = 32-46,48-62
           dchan = 47
   ---------cut here--------------------------- 
 
 T1 span with FXS kewlstart signalling
   (A101/2/3/4/4D Cards)
   For example: connection to a channel bank
 
   ---------cut here--------------------------- 
           loadzone = us
           defaultzone = us
 
           span = 1,1,0,esf,b8zs
 
           fxsks = 1-24
   ---------cut here--------------------------- 
 
 FXO/FXS signalling with analog card
   (A20x Cards)
   for example: using analog fxo/fxs card (A204 with 1 fxo + 1 fxs modules)
   Note: FXO ports use FXS signalling and FXS ports use FXO signalling.
   Note: Analog Cards will register 24 channels, even if less ports are used.
   
   Note: No span definitions.
    ---------cut here--------------------------- 
           loadzone = us
           defaultzone = us
 
           fxsks = 1-2
           fxoks = 3-4
   ---------cut here---------------------------

Using a combination of Analog Cards and T1/E1 Cards
  Analog Cards register 24 channels, even if less ports are used, so the first T1/E1 channel will start at 25.
  Note: in this example, the analog card is loaded first, and therefore takes the first span.
  Note: No span definitions for analog card.
    ---------cut here--------------------------- 
           loadzone = us
           defaultzone = us           

           # ports for analog card
           fxsks = 1-2
           fxoks = 3-4

            #ports and span definitions for T1 card
            #note: span number is 2
            span = 2,1,0,esf,b8zs
            bchan = 25-47
            dchan = 48

   ---------cut here--------------------------- 
 
Top



Sample Zapata Config files ( zapata.conf )
 
For original zapata.conf, click here
Zapata.conf section with detailed explanation from voip-info.org, click here

Your zaptel.conf and zapata.conf should match your wanpipe configurations.

 

Note: If you are using Asterisk@Home/Trixbox, copy the following configurations to zapata_additional.conf and omit the [channels] because zapata_additional.conf is already in the [channels] section.
 
 2 PRI T1 spans with B8ZS line decoding, ESF framing (A10x/A10xD Cards)
 
   ---------cut here--------------------------- 
 [channels] ;omit this line if you are including these lines in zapata_additional.conf

         context = from-pstn
         switchtype = national
         usecallerid = yes
         callerid=asreceived       
         echocancel = yes
         echocancelwhenbridged = yes
         ;add the is option if you are problems with DTMF detection
         relaxdtmf = yes    
         rxgain = 0.0
         txgain = 0.0
 
         signalling = pri_cpe
         group = 1
         channel => 1-23, 25-47

 ---------cut here--------------------------- 

2 RBS T1 spans with B8ZS line decoding, ESF framing (A10x/A10xD Cards)
 
   ---------cut here--------------------------- 
 [channels] ;omit this line if you are including these lines in zapata_additional.conf

         context = from-pstn
         switchtype = national
         usecallerid = yes
         callerid=asreceived       
         echocancel = yes
         echocancelwhenbridged = yes
         ;add the is option if you are problems with DTMF detection
         relaxdtmf = yes    
         rxgain = 0.0
         txgain = 0.0
 
         signalling = em
         group = 1
         channel => 1-48

 ---------cut here---------------------------  

 2 PRI E1 spans with HDB3 line decoding, CCS framing, CRC4 (A10x/A10xD Cards)

   ---------cut here--------------------------- 
  [channels] ;omit this line if you are including these lines in zapata_additional.conf
         context = default
         switchtype = Euroisdn
         usecallerid = yes
         callerid=asreceived      
         echocancel = yes
         echocancelwhenbridged = yes
         ;add the is option if you are problems with DTMF detection
         relaxdtmf = yes 
         rxgain = 0.0
         txgain = 0.0
 
        signalling = pri_cpe
        group =1
        channel => 1-15,17-31
        channel => 32-46,48-62

 

       ;Note: Customers in the UK connected to BT might require this parameter:
       pridialplan=local
   ---------cut here---------------------------   

 T1 span with FXS kewlstart signalling
(A10x/A10xD Cards)

  ---------cut here--------------------------- 
 [channels]
         context = from-pstn
         switchtype = national
         usecallerid = yes        
         echocancel = yes
         echocancelwhenbridged = yes
         ;add the is option if you are problems with DTMF detection
         relaxdtmf = yes 
         rxgain = 0.0
         txgain = 0.0

        signalling = fxs_ks
        group = 1
        channel => 1-24
  ---------cut here--------------------------- 
 
 FXO/FXS signalling with analog card
 (A20x/A20xD Cards)

  ---------cut here--------------------------- 
 [channels] ;omit this line if you are including these lines in zapata_additional.conf
        context = from-pstn
         switchtype = national
         usecallerid = yes
         callerid=asreceived
         echocancel = yes
         echocancelwhenbridged = yes
         ;add the is option if you are problems with DTMF detection
         relaxdtmf = yes 
         rxgain = 0.0
         txgain = 0.0

        signalling = fxs_ks
        group = 1
        channel => 1-2
 
        signalling = fxo_ks
        group = 2
        channel => 3-4

       ;Note: Customers in the UK may require these additional parameters for callerID.
       cidsignalling=v23
       cidstart=polarity
  ---------cut here--------------------------- 

 Top

 


HOTPLUG Conflicts with WANPIPE (Linux only)
 
 On systems that use HOTPLUG note that HOTPLUG can conflict with startup of TDMV drivers.
 
 Important: 
 Hotplug issues only affect old A101 and A102 cards. 
 The Hotplug issues have been resolved for A101d/2d/4d/8d and analog cards.
 
 Solution:
 Insert wanpipe interface name into the hotplug interface list, and restart hotplug.
 
   #>vi /etc/hotplug/net.agent    (if you are using a redhat style distro)
   #>vi /etc/sysconfig/network-scripts/net.hotplug (if you are using newer redhat style distro)
   #>vi /etc/hotplug.d/net/50-ifup.hotplug   (if you are running Suse)
 
Insert wanpipe interface name into the ignore list:
Look for:  

 

        add|register)
        case $INTERFACE in
            (dsl*|ppp*|....................|tun*|tap*|wifi*)


And add w* to the list
            (dsl*|ppp*|....................|tun*|tap*|wifi*|w*)

         Where w* relates to all wanpipe interfaces starting with letter "w".
On some systems, there is also a list of interfaces to be ignored when unregistering, and the w* interfaces must be added to this list also.
Look for:   

    remove|unregister)
        case $INTERFACE in
             (dsl*|ppp*|....................|tun*|tap*|wifi*)


and add w*

On some systems, you need to restart hotplug agent to apply changes:
 /etc/init.d/hotplug restart
   
  Top

 

 


Exec "ztcfg" after wanrouter start
 
 The "ztcfg" tool must be executed before starting asterisk. WANPIPE's "wanrouter" script has the capability to execute an external script after "wanrouter start" command is competed.
 
 The wanrouter looks to /etc/wanpipe/scripts directory for any configured bash scripts.
 
      1) Create a file called "start" (lower case)
 
        #>vi start

----------Cut Here----------------
#!/bin/sh

#Make sure that udev/devfs zaptel device
#has come up.
cnt=0
max_delay=30
for ((i=0;i<$max_delay;i++))
do
    if [ -e /dev/zap ]; then
            break;
    fi

    echo "Waiting for zaptel device /dev/zap ($i/$max_delay)..."
    sleep 2
done

if [ ! -e /dev/zap ]; then
    echo
    echo "Error: Zaptel device failed to come up";
    echo "Possible Cause: UDEV not installed!";
    echo
    exit 1
fi

sleep 1

ztcfg -vvvv  

exit 0 
----------Cut Here----------------
 
      2) Copy the file "start" into /etc/wanpipe/scripts directory (Note: the file doesn't have to have exec privileges) .
 
 The script "start" will execute each time the "wanrouter start" command executes.
 Please Refer to README.external_scripts for more info about wanrouter and external scripts.

Top  
Updating FLASH on AFT Cards
 
Please check here for instructions on flash update.
 
   Top
 
Multiple ZAPTEL Releases AND Wanpipe Crashing
 
On systems, where ZAPTEL has been upgraded from old releases, it is possible for a kernel module directory to contain MULTIPLE ZAPTEL drivers.
 
 Old Zaptel install dir: /lib/modules/$(uname -r)/zaptel
 
 New Zaptel install dir: /lib/modules/$(uname -r)/misc
 
If the old zaptel installation was NOT removed, the new installation would NOT overwrite the old kernel modules.  In this case the OLD modules would continue to be loaded, even though the new ones were installed.   
 
 Check:
 The check if this condition exists on your machine run:
 
      #>modprobe -l  | grep zaptel.*o

 
IMPORTANT: If multiple zaptel modules are found, the problem must be fixed before starting WANPIPE!
 
In this scenario, if a customer starts WANPIPE drivers based on NEW ZAPTEL sources, the WANPIPE will crash. The WANPIPE driver shares structures with ZAPTEL, thus, a result of mismatched structures is a kernel panic.
 
 Solution:
 
    The solution in this case is to REMOVE the old zaptel modules.
 
     #>modprobe -l | grep zaptel | xargs rm
     #>depmod -a

 
 Top

Multiple ZTCFG executions on bootup
 
On systems that have zaptel and digium drivers installed, one must be careful to synchronize wanpipe, digium and zaptel ztcfg on boot up.
 
Therefore, wanpipe and digium MUST start before ztcfg is executed.
 
Check your /etc/rcS.d startup scripts. Make sure that the startup numbers S## for zaptel are higher than those of wanpipe and digium.
 
  Top

UDEV Conflicts with ZAPTEL
 
UDEV is a user space daemon, which handles all /dev devices. On startup ZAPTEL schedules creation of /dev/zap device. It takes about 10 seconds for the UDEV daemon to create /dev/zap and all its devices after zaptel has been started (wanrouter start).
 
On shutdown, ZAPTEL schedules deletion of /dev/zap device. Again it takes about 1-5 seconds for UDEV daemon to delete /dev/zap device from user space.
 
A conflict can occur if one quickly starts and then stops  wanpipe/zaptel .   In this case UDEV daemon might be in process of creating /dev/zap devices, while zaptel kernel driver tries to remove them.
 
 To prevent this please install the wanpipe external start script referenced in ITEM #2 of the APPENDIX above. This script will delay wanpipe start until UDEV has created the /dev/zap devices.

On some systems, UDEV has to be configured to configure zap channels, please read README.udev from the zaptel source directory (/usr/src/zaptel) for instructions on how to do this. 
 
 Top

A101/2/4/8 TE1 Clock Synchronization:
 
TE1 Clock synchronization is used to propagate a single clock source over the T1/E1 ports on a single card.

Before configuring your system you must identify which ports should be in NORMAL (slave) clock mode and which should be in MASTER clock mode.  

All ports connected to TELCO MUST be in NORMAL mode, because Telco is ALWAYS MASTER clock (unless telco tells you otherwise).

Network Example:
      wanpipe1->Port 1 connected to TELCO
      wanpipe2->Port 2 connected to channel bank or back to back to another T1/E1 device. 
                        In this scenario Port2 must be configured as CLOCK MASTER.
 
Settings for wanpipe1, Port 1:
Port 1 must be configured for NORMAL (slave) clock mode, because TELCO is always clock MASTER.
Using wancfg, configure port1 as clock slave with TE_CLOCK=NORMAL
 So that port1 receives its clock from the TELCO.
 All ports connected to TELCO MUST be in NORMAL mode, because Telco is ALWAYS MASTER clock!
 (unless telco tells you otherwise).

  
Settings for wanpipe2, Port 2:

Port 2 must be configured for MASTER clock mode,  in order to drive the channel bank or back to back T1/E1 device.   However, in order to synchronize the port2 to port1 we use the TE_REF_CLOCK option to take the clock from port1 and pass it through to port2.   By synchronizing port 1 and port2 together with a single clock that is derived from TELCO, we will be guaranteed that FAX and VOICE calls work perfectly without any interrupt or frame slips.

Using wancfg, configure as master with
 
      TE_CLOCK=MASTER     #configure port as MASTER clock
      TE_REF_CLOCK=1        #use the incoming clock from port1 as the MASTER clock
    
The TE_REF_CLOCK parameter refers to the source of the MASTER clock for this port.
The TE_REF_CLOCK value can be set to any port that is ALREADY configured/started!
 Note: Setting TE_REF_CLOCK=0 sets the MASTER clock source as the on-board oscillator. 
 
IMPORTANT:

  • When starting and stopping wanpipe devices make sure that the wanpipe T1/E1 port that provides the synchronized clock source is started first and stopped last. This is normally done automatically by the wanrouter startup script.
     
  • If  wanpipe T1/E1 port that provides the synchronized clock source is stopped, the other devices using the clock source will behave unpredictably.  
     
  • If the wanpipe T1/E1 port looses connection to the TELCO,  it will automatically switch to its internal oscillator.  In this case all slave ports will still be synchronized.
     
  • If there is no clock coming from Telco (Port 1 in example), then the port using the referenced clock (Port 2 in example) will start using the internal oscillator. If your port 1 clock is unstable, this can cause noise and cracklings on the line as the clock source is being switched continuously between the referenced port and the internal oscillator.

 Top


Firmware Version

To find the current firmware version for your AFT card,

Drivers beta7-2.3.4 and higher

#>wanrouter hwprobe
The hardware probe output will display the card info as well as version number.
Drivers pre beta7-2.3.4
#>wanrouter start
#>wanpipemon -g
<local system debugging>
<select a wanpipe interface>
<Card status>
<Read Code Version<

it should say:

Code version : HDLC rev.XX

where XX is the current firmware version of the card.


Instruction for firmware update: Firmware update instructions

 Top


 Asterisk PRI Fails to Come UP or Oscillates Up and Down

PRI does not come up on the span, or it comes up and goes down again cyclically.
Running “pri intense debug spanX”, in Asterisk CLI, shows a sequence where only incoming frames are the "Unnumbered Frames".

< [ 02 01 7f ]
< Unnumbered frame:
< SAPI: 00  C/R: 1 EA: 0
<  TEI: 000        EA: 1
<   M3: 3   P/F: 1 M2: 3 11: 3  [ SABME
here (set asynchronous balanced mode extended) ]
< 0 bytes of data
-- Got SABME from network peer.
Sending Unnumbered Acknowledgement


Also when running wanpipemon DCHAN Trace

#>wanpipemon –i w1g1  -c trd

Notice that all the data is INCOMING, there are no OUTGOING packets.

The problem is that zaptel driver has not been recompiled after Wanpipe installation. During Wanpipe installation, zaptel sources were patched with Wanpipe HW DCHAN patch, that enables zaptel to transmit HDLC frames to Wanpipe drivers. If zaptel driver is not re-compiled and re-installed HW DCHAN option will not work properly.

To fix this problem:
Recompile and Reinstall Zaptel Sources

#>cd /usr/src/zaptel
#>make clean
#>make
#>make install

OR
Disable TDMV_DCHAN=16 or 24 option and set it to 0 in /etc/wanpipe/wanpipe1.conf file.

This will disable Wanpipe HW DCHAN option and DCHAN HDLC encoding/decoding will be done by zaptel HDLC engine.

Note: With wanpipe-3.2.2 and later (and wanpipe-3.3.x beta driver) doesn't require to zaptel patch with zaptel-1.4.x . Therefore there is no need to recompile zaptel. (In /etc/zaptel.conf d-channels are defined as 'hardhdlc' instead of 'dchan')


Asterisk displays this error: PRI got event: HDLC Bad FCS
This could be because you are using the wrong coding/framing mode in /etc/zaptel.conf. Try to change your coding and framing modes and see it if makes a difference.


Top


Everything loads, but Asterisk does not see incoming call or off-hook state on analog cards.
This could be a hotplug issue, try to configure hotplug settings so that wanpipe interfaces are ignored. (See HOTPLUG fix).

Top


Installing Wanpipe on SuSe (Only for the version before 10.1)

The wanpipe drivers assume the kernel source is located in /lib/modules/$(uname -r)/build. and in SuSe, this symbolic link points to the headers only. There is a symbolic link in /lib/modules/$(uname -r)/source that points to the kernel source.

To compile on SuSe:

1. Apply the current kernel configuration.
    Copy .config file from headers to source  
        #>cp /lib/modules/$(uname -r)/build/.config /lib/modules/$(uname -r)/source/.config
    Set the symbolic link in /lib/modules/$(uname -r)/build to point to the kernel source
             #>cd /lib/modules/$(uname -r)
             #>mv build build_old
        
Find the location of your source:
             #>ls -al source
         It will look like this:   source -> /usr/src/linux-2.6.11.4-20a (adjust for your current kernel version)
         Create a symbolic link toyour kernel source with name build
             #>ln -s /usr/src/linux-2.6.11.4-20a build
         Update current configurations from the .config file
             #>cd build
             #>make menuconfig
             #>make prepare-all

2. Install Zaptel, Libpri and Asterisk. Click here
3. Install wanpipe drivers.
5. Configure Hotplug to ignore wanpipe interfaces. Click here .
6. Configure Asterisk. Click here .        

 

Top


Using PRI and T1/E1: Incoming calls work fine, but cannot dial out
On some PRI with E1

We saw that these two settings must be added in /etc/asterisk/zapata.conf

pridialplan=local

pridialplan: Sets an option required for some (rare) switches that require a dialplan parameter to be passed. This option is ignored by most PRI switches. It may be necessary on a few pieces of hardware. Valid options are: unknown, local, private, national, and international. This option can almost always be left unchanged from the default. Default: national.

priindication=inband

priindication: Tells how Asterisk should indicate Busy() and Congestion() to the switch/user. Default: inband. Accepted values are:
inband: Asterisk plays indication tones without answering; not available on all PRI/BRI subscription lines 

outofband: Asterisk disconnects with busy/congestion information code so the switch will play the indication tones to the caller.

On some PRI with T1

We saw that some providers (CMC Telecom for example) checks for the caller's callerID so make sure your callerID is within the list of one of the DIDs or phone numbers provided by your Telco.

Top


Cannot Load Zaptel module because crc_ccitt table not found

This is because you are missing the crc_ccitt library routine.
Go to  /lib/modules/$(uname -r)/build
type:

#>make menuconfig

In the ncurses utility,
Go to Library routines
Include:
<M> CRC-CCITT functions
<save> and <exit>

to build modules, type:
make modules

This will rebuild all your modules, including crc-ccitt. After you are done, the crc-ccitt module will be located in ./lib

copy the crc-ccitt.ko (for 2.6 kernels) or crc-ccitt.o (for 2.4 kernels)to /lib/modules/$(uname -r)/kernel/lib/

 

 Top




Ouch ... error while writing audio data: : Broken pipe

This error can be caused by misconfigured asterisk config file.
For example check that all comments are properly comented out in /etc/asterisk/zapata.conf.


Top

Compile Warning on 2.4 kernels: DEVFS HWEC not supported

This is just a warning.
Your 2.4 kernel doesn't have DEVFS support and our Hardware Echo Cancellatoin on A104d needs DEVFS on 2.4 kernels in order to configure HWEC Chip.

Please enable DEVFS support on your kernel in order to use Hardware EC support.
Otherwise, you will be forced to use software echo cancellation.

The use of DEVFS on 2.4 kernels and UDEV on 2.6 kernels was added in wanpipe-beta2-2.3.4 release.

 Top


Failure to start echo canceller after improper shutdown

If you are using wanpipe-beta4-2.3.4 drivers and you get an error loading wanpipe with hardware echo cancelling, this is probably because you have invalid wan_ec_socket and wan_ec.pid files in /var/run. Delete these 2 files and try to restart wanpipe.

note: if you are using wanpipe-beta2-3.4. and wanpipe-beta3-2.3.4 drivers, these files will be in /etc/wanpipe/wan_ec 

Top 


Zaptel not compiling on some RedHat, CentOs and Trixbox systems.

If you are getting these errors when compiling zaptel:

/usr/src/zaptel/zaptel.c:384: error: syntax error before "zone_lock"
/usr/src/zaptel/zaptel.c:384: warning: type defaults to `int' in declaration of `zone_lock'
/usr/src/zaptel/zaptel.c:384: error: incompatible types in initialization
/usr/src/zaptel/zaptel.c:384: error: initializer element is not constant

:
:

There is a typo in your kernel headers.
View a file called spinlock.h in your kernel source directory:

#>vi /lib/modules/$(uname -r)/build/include/linux/spinlock.h
look for this line:

#define DEFINE_RWLOCK(x) rw_lock_t x = RW__LOCK_UNLOCK

(it is around line 407)
and change it to:

#define DEFINE_RWLOCK(x) rwlock_t x = RW__LOCK_UNLOCK

then try to recompile Zaptel again.

 


Wanpipe Drivers experiencing Overruns

If wanpipe TDM drivers are experiencing rx overruns a possilbe cause could be an increctly configured system.  Drivers for new chipsets might not be part of the standard Linux Distribution Kernel, thus a generic drivers might be installed.

The hdparm utility will show you the status of your IDE and sometines SCSI disks.
Make sure that using_dma option is set to 1:  If its not set to 1 you have to upgrade your kernel with the latest chipset drivers.

hdparm /dev/hda

/dev/hda:
 multcount    = 16 (on)
 IO_support   =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    = 256 (on)
 geometry     = 65535/16/63, sectors = 80026361856, start = 0

Test the I/O performance of your harddrive.

 hdparm -t /dev/hda (hdparm -t /dev/sda if you have a SATA drive)

 A properly configured system can transfer over 40 MB/sec


Is my hardware echo canceller running?

How to confirm that your hardware echo canceller is running and active on your Zap calls.

1. Confirm that you have a hardware echo canceller:
    After the Wanpipe drivers are installed, type:
        #>wanrouter hwprobe
    It should say:
   
    1. AFT-AXX-SH : SLOT=X : BUS=X : IRQ=X CPU=A: PORT=X : HWEC= 32 : V=X
        HWEC values should be:
            A200d : 32
            A101d : 32
            A102d : 64
            A104d : 128
            A108d : 256
            A500d : 64           
        If it says HWEC=0, and you ordered a "d" model card,
           If you purchased this card from a reseller, contact your reseller.
           If you purchased this card directly from Sangoma, contact Sangoma RMA department.

    2. If you have a hardware echo canceller,  confirm that:
          1. You have a 2.3.4 / 3.2 series driver.
          2. You have the parameter "TDMV_HWEC = YES" in your /etc/wanpipe/wanpipe*.conf
          3. You have the parameter "echocancel=yes" in your /etc/asterisk/zapata.conf

    3. After you start wanrouter start, type:
         #> wan_ec_client wanpipe1 stats
        If you do not see any output, contact Sangoma Tech Support and attach your system log file to the email (/var/log/messages).
       
        You should see:
       
        wanpipe1: Running Get stats command to Echo Canceller device... Done!
         ***** Echo Canceller Chip Get Stats wanpipe1 *****
        wanpipe1: Number of channels currently open    32
                :
                :

       This confirms that the WANPIPE drivers can communicate with the hardware echo canceller chip properly.        
          4. Make a call through Asterisk. While the call is active,
          1. In the Asterisk CLI, type:
               CLI> zap show channel N
             where N is your active channel. It should say:
                   :
                   :
                echocancel: 128 TAPS, currently ON
                   :
              if it does not say "currently ON", check your /etc/asterisk/zapata.conf, if you are bridging TDM to TDM, and you want echo cancelling to be performed, then you should also have "echocancelwhenbridged=yes"
          
            2. if it says "currently ON"
               To check if hardware EC is enabled or not , use wanpipemon -i <interface name> -c ehw 
                For example:
               #> wanpipemon -i w1g1 -c ehw
                    Sangoma HW echo canceller active on channel N
                     where N is your active channel.

                With wanpipe-3.2.x and wanpipe-2.3.4-5 or later, we have persistent hardware EC means hardware EC is enabled all the times, there                    fore you should see following for all the voice channels

                    #>  wanpipemon -i w1g1 -c ehw
                            Sangoma HW Echo Canceller is enabled for channel N  ( N: is your channel number)


Wanpipe crashes the system on Trixbox 1.2 

 

Wanpipe driver crashes the system on Trixbox 1.2 if you compiled new Zaptel modules, but your older Zaptel module are still loaded in the kernel. To replace your existing Zaptel module:

      1. Unload the Zaptel module from the kernel.
                #> rmmod zaptel
               
                Note: Sometimes the zaptel module is used by other modules (wctdm, wct4xxp etc....), you will need to unload those modules before unloading zaptel.

      2. Remove current Zaptel module
                  modprobe -l | grep zaptel | xargs rm
                  depmod -a

      3. Change directory to Zaptel source and run
                 make
                 make install

      4. Reconfirm that new zaptel module is there
                 modprobe -l | grep Zaptel

      5. Install Wanpipe driver

   


 

 DTMF Detection

     DTMF detection can be solved in the following ways:

     1. Enable relaxdtmf=yes in zapata.conf. Relaxing them may make the DTMF detector more likely to have "talkoff" where DTMF is detected when it shouldn't be.

     2. Increase rxgain in zapata.conf as well

     3. If the above two steps don't help at all and you have hardware echo canceller enable on Sangoma cards(A102d/A104d/A108d), please try to disable it by setting TDMV_HWEC=NO in wanpipe#.conf

    4. If disabling HWEC solves the problem, this means hardware echo canceller may corrupt DTMF data. You need to reenable HWEC and continue the debugging in the following link: http://wiki.sangoma.com/wanpipe-linux-asterisk-debugging#a104d_echo_debug  

 


  MFC/R2 Configuration

Note: Please see the following link for instructions on how to configure MFC/R2 and Asterisk                    http://www.soft-switch.org/unicall/installing-mfcr2.html

 

Sample zaptel.conf 
   ---------cut here---------------------------  
span=1,0,0,cas,hdb3
cas=1-15:1101
cas=17-31:1101
loadzone=us
defaultzone=us
   ---------cut here---------------------------  

 Sample unicall.conf
   ---------cut here---------------------------  
[channels]
loglevel=1023
context=default
usecallerid=yes
hidecallerid=no
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
relaxdtmf=yes
callgroup=1
pickupgroup=1
immediate=no
callerid=asreceived
musiconhold=default
protocolclass=mfcr2
protocolvariant=br,20,4,8
protocolend=cpe
group=1
channel => 1-15
channel => 17-31
protocolclass=mfcr2
   ---------cut here---------------------------  

This is a comment for a customer in Brazil

I've got the problem solved after several changes in the software
components used.

Just for your reference, I will summarize what I did:

  • I had to downgrade spandsp library to versin 0.0.2 because
    version 0.0.3 was not fully compatible with current libmfcr2
    and unicall libraries
  • I had to stop installing asterisk from ports collection and
    to compile it from source, because current asterisk port uses
    a codec-negociation path which is completely incompatible with
    all versions of chan_unicall (Unicall channel driver).
  • I also had to use Asterisk version 1.2.14 instead of current
    because current version also showed some incompatibilities with
    unicall/mfcr2.

 



Installation of Sangoma Wanpipe driver on AsteriskNOW or Asterisk Business Edtion

1. Download the kernel source XXX (e.g 2.6.17.11) from kernel.org to /usr/src
    You need to check your kernel version first(uname -r). 

2. Make a symbolic link from /usr/src/linux-2.6.17.11 to /lib/modules/$(uname -r)/build
            #> ln -s /usr/src/linux-2.6.17.11 /lib/modules/$(uname -r)/build

3. Go to /lib/modules/$(uname -r)/build, open Makefile and change the kernel
naming parameters such as VERSION, PATCHLEVEL,SUBLEVEL and EXTRAVERSION
to match the output of "uname -r"
   
             For example:
             uname -r  ===> "2.6.17.11-1.smp.x86.i686.cmov"

             VERSION = 2
             PATCHLEVEL = 6
             SUBLEVEL = 17
             EXTRAVERSION = .11-1.smp.x86.i686.cmov

4. Copy kernel configuration file from /boot to /lib/modules/$(uname -r)/build
             #> cp /boot/config-2.6.17.11-1.smp.x86.i686.cmov /lib/modules/$(uname -r)/build/.config

5. Go to /lib/modules/$(uname -r)/build,  run "make menuconfig", exit and save the config file

6. Install byacc and flex 

        a. untar yacc tar ball
        b. run "make"
        c. manually copy "yacc" to /usr/local/bin directory
                     #> cp yacc /usr/bin
        d. untar flex tar ball
        e. run "./configure"
        f. run "make"
        g. run "make install"
        h. change directory to /usr/local/bin and make a symbolic link from flex to lex
                     #> ln -s flex lex

7. Install Zaptel from source
    Download zaptel into arbitrary directory (/usr/src) and  untar it.

#>tar xvfz zaptel(version)
        Make a symbolic link /usr/src/zaptel to the actual zaptel directory.
         #>ln -s zaptel(version) zaptel
         #>make
         #>make install

8. Install Wanpipe driver from source       

Wanpipe TDM Installation

  1. Download the appropriate WANPIPE® Release based on the Sangoma Hardware. Refer to Wanpipe Drivers section.
  2. Untar wanpipe release in arbitrary directory (/usr/src/).
    #>tar xvfz wanpipe(version)
    After untarring WANPIPE®, the wanpipe/ directory will be created.
  3. Run ./Setup install

    Proceed with installation Select "Y" for each option.

    Under compilation mode:  Select "TDM Only drivers" (Option #2).

    Setup will ask you for location of zaptel sources?
    [By default Setup will look in /usr/src/zaptel]

    Setup will ask you if you would like to add support for Sangoma HW HDLC DCHAN PRI to Zaptel.
    "Enable TDMV DCHAN Native HDLC Support & Patch Zaptel ? (y/n)"
    Select "Y" to Enable HW HDLC on DCHAN PRI in Zaptel.

    Setup will ask you if you would like to recompile/reinstall Zaptel.
    "Recompile/reinstall zaptel (recommended) ? (y/n) "
    Select "Y" to recompile/reistall Zaptel

    Proceed to compile wanpipe drivers.
  4. Proceed with Defaults for the rest of the compilation.

          If any errors are encountered during the compilation of the utilities, click here for assistance.

9. Once the driver are installed, use "wancfg" utility to manually configure the card.

10. Restart the computer and then go to your web interface and go ahead with your configuration.

 

 


ZAPTEL with Adjustable Chunk Size

By default Zaptel runs with 8 byte chunk size.  This equates to 1ms interrupt on TDM hardware! This causes congestion on the PCI bus and overal creates a bottle neck.

Sangomas hardware is able to automatically detect ZAPTEL chunk size and adjust accordingly. One can configure ZAPTEL for 8bytes (1ms - default)- 16bytes (2ms) -  40byte (5ms)  or 80byte (10ms) chunk size.  This would drastically reduce number of interrutps on your system and allow you to scale better with large number of ports.

To configure ZAPTEL for higher chunk size

 ./Setup install --zap-chunk=<CHUNK SIZE>

Where CHUNK SIZE:  8, 16 , 40 or 80
Setup will patch zaptel source for selected chunk size and will remove wct4xxx (digium) driver out of zaptel Makefile.  Reason for this is that digium wct4xxx driver does not support any chunk size other than 8bytes (1ms).

Once Setup recompiles zaptel and wanpipe drivers.  There are no other configuration needed!  Just start wanpipe and zaptel and Asterisk:
  1.  wanrouter start
  2. ztcfg -vvv
  3. asterisk
  4. asterisk -c -r

In order to confirm that you are running with new zaptel chunk size.  run:

  1. ifconfig w1g1
    -> confirm that MTU = configured chunk size.

 
IMPORTANT:
This option has been tested in production and is SAFE for T1/E1 PRI Mode.
If running meetme chunk size of 40 is suggested.
Otherwise chunk size of 80 is most efficient.
 
This option does not work very well for ANALOG and T1/E1 E&M wink!
because zaptel hard codes the chunk size to 8 in some of the Analog/RBS
timing code.  Sangoma is working on this problem. 

 
If you are having trobule with this configuraiton please contact Sangoma Support.

 

 


Asterisk & Sangoma Hardware DTMF

Sangoma hardware DTMF is now supported starting from 3.3.0 wanpipe release.  The Hardware DTMF is supported by the Octasic Hardware Echo/DTMF DSP.  Therefore in order to take advantage of hardware DTMF you must have one of Sangomas AFT A200/A400,101/2/4/8 D cards (with onboard hardware echo cancelation)

Note: These are temporary instructions while the Hardware DTMF is in test stage.

 

Requirements:

  1. Download latest 3.3.X release or greater: Latest Drivers
     
  2. Install above wanpipe release:
    -> follow standard wanpipe installation instructions
      
  3. Configure wanpipe devices using wancfg_zaptel script.
    -> run: /usr/sbin/wancfg_zaptel
    -> follow standard wanpipe config instructions
    -> select hardware dtmf option
     
  4. Start wanpipe
    -> wanrouter start
     
  5. Configure zaptel
    -> ztcfg
     
  6. Start Asterisk
    -> asterisk

 


 

 Sample Configuration files for a J1 implementation

Configuring your Sangoma A10x card for J1 is qute simple but it does require making some manul changes:

  1. First use the "wancfg_zaptel" script to quickly create a base wanpipeX.conf, zaptel.conf, and zapata.conf files.  For now select the T1 line media and take the default line configuration options (B8ZS and ESF).  Select the type of clocking to use; NORMAL, and the card will take the clocking from the line (select this for a telco connection) and MASTER if the card needs to act like the telco and generate the clocking for the line.  Next select either PRI_NET (telco/master side of a PRI connection) or PRI_CPE (slave side of a PRI connection).  Lastly direct the call to the Asterisk context of your choice.
  2. Once the configuration script has created all the files, the wanpipeX.conf files need to be modified so the driver correctly encodes the line.  Open the file "/etc/wanpipe/wanpipeX.conf", where X is the port number.  Add the line "FE_SUBMEDIA=J1" as per the following sample wanpipeX.conf file:

    #================================================
    #WANPIPE1 Configuration File
    #================================================
    #
    # Date: Wed Dec  6 20:29:03 UTC 2006
    #
    # Note: This file was generated automatically
    #       by /usr/local/sbin/setup-sangoma program.
    #
    #       If you want to edit this file, it is
    #       recommended that you use wancfg program
    #       to do so.
    #================================================
    # Sangoma Technologies Inc.
    #================================================

    [devices]
    wanpipe1 = WAN_AFT_TE1, Comment

    [interfaces]
    w1g1 = wanpipe1, , TDM_VOICE, Comment

    [wanpipe1]
    CARD_TYPE     = AFT
    S514CPU     = A
    CommPort     = PRI
    AUTO_PCISLOT     = YES
    PCISLOT     = 2
    PCIBUS      = 7
    FE_MEDIA    = T1
    FE_SUBMEDIA    = J1
    FE_LCODE    = B8ZS
    FE_FRAME    = ESF
    FE_LINE        = 1
    TE_CLOCK     = NORMAL
    TE_REF_CLOCK    = 0

    TE_HIGHIMPEDANCE    = NO
    LBO         = 0DB
    FE_TXTRISTATE    = NO
    MTU         = 1500
    UDPPORT     = 9000
    TTL        = 255
    IGNORE_FRONT_END = NO
    TDMV_SPAN    = 1
    TDMV_DCHAN    = 24
    TDMV_HW_DTMF    = NO

    [w1g1]
    ACTIVE_CH    = ALL
    TDMV_ECHO_OFF    = NO
    TDMV_HWEC    = YES
  3. Save the file and confirm that Wanpipe, Zaptel, and Asterisk start properly.  If you have any problems please following the debugging instructions at the following link: PRI Debugging

 

Sample Zaptel.conf File:

# Autogenerated by /usr/local/sbin/sangoma/setup-sangoma -- do not hand edit
# Zaptel Channels Configurations (zaptel.conf)
#
loadzone=us
defaultzone=us

#Sangoma A102 port 1 [slot:2 bus:7 span:1] <wanpipe1>
span=1,0,0,esf,b8zs
bchan=1-23
hardhdlc=24

 

Sample Zapata.conf file:

;autogenerated by /usr/local/sbin/config-zaptel  do not hand edit
;Zaptel Channels Configurations (zapata.conf)
;
;For detailed zapata options, view /etc/asterisk/zapata.conf.orig

[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1

immediate=no

;Sangoma A102 port 1 [slot:2 bus:7 span:1] <wanpipe1>
switchtype=national
context=from-pstn
group=0
signalling=pri_cpe
channel =>1-23


Configuring A500 BRI as Timing source for Asterisk
 

A500 BRI card can be used as Timing source for Asterisk , by adding following paramater in /etc/wanpipe/wanpipe1.conf .Note: This is the case when you have only A500 BRI card on the system.

Add TDMV_DUMMY_REF  =YES inside [wanpipe1] section:

[trixbox1.localdomain ~]# cat /etc/wanpipe//wanpipe1.conf
#================================================
# WANPIPE1 Configuration File
#================================================
#
# Note: This file was generated automatically
#       by /usr/local/sbin/setup-sangoma program.
#
#       If you want to edit this file, it is
#       recommended that you use wancfg program
#       to do so.
#================================================
# Sangoma Technologies Inc.
#================================================
[devices]
wanpipe1 = WAN_AFT_ISDN_BRI, Comment

[interfaces]
w1g1 = wanpipe1, , TDM_VOICE_API, Comment

[wanpipe1]
CARD_TYPE       = AFT
S514CPU         = A
CommPort        = PRI
AUTO_PCISLOT    = NO
PCISLOT         = 9
PCIBUS          = 1
FE_MEDIA        = BRI
FE_LINE         = 1
TDMV_LAW        = ALAW
TDMV_DUMMY_REF  =YES
MTU             = 1500
UDPPORT         = 9000
TTL             = 255
IGNORE_FRONT_END = NO
TDMV_SPAN       = 1

[w1g1]
ACTIVE_CH       = ALL
TDMV_ECHO_OFF   = NO
TDMV_HWEC       = YES
MTU             = 80

Comments

From yuan - 2/26/07 2:15 PM

MFC/R2 in Brazil
I've got the problem solved after several changes in the software
components used.

Just for your reference, I will summarize what I did:

  • I had to downgrade spandsp library to versin 0.0.2 because
    version 0.0.3 was not fully compatible with current libmfcr2
    and unicall libraries


  • I had to stop installing asterisk from ports collection and
    to compile it from source, because current asterisk port uses
    a codec-negociation path which is completely incompatible with
    all versions of chan_unicall (Unicall channel driver).


  • I also had to use Asterisk version 1.2.14 instead of current
    because current version also showed some incompatibilities with
    unicall/mfcr2.

Site

Changes
Index
Search

 

User

 

Log In
Register

 
 

Last Modified 5/29/08 9:25 AM