FAQ

    Installation /Compilation 

    1. I am using Ubuntu and am getting the following error when I try to use ./Setup install " ./Setup: 1041: Syntax error"
    2. How do I install wanpipe-driver on trixbox ?
    3. Why does Zaptel not compile on some Redhat, CentOS and trixbox systems?
    4. How do I install Wanpipe under Ubuntu Server 8.04 
    5. Wanpipe setup options

    Configuration

    1. What is proper timing configuration on Sangoma card when I am configuring my A102/A104/A108 with Telco, Channel Bank or/and traditional PBX ?
    2. How do I enable hardware DTMF support for Asterisk with my "d" model card ?
    3. How do I auto-start Zaptel after wanrouter start ( Wanpipe start up script ) ?
    4. Which PRI dial plan configuration works with Batelco Jordan with Siemens ESW switch type?
    5. How do I configure my T1/E1 card for fractional voice and data (in mix mode) ?
    6. Why do my FXS modules show up as FXO in Zaptel or FXO modules show up as FXS in Zaptel?
    7. How do I configure single port on  AFT series T1/E1 card in mixed Voice and data mode ( configuring single port for fractional voice and data ) ?
    8. What does "HARDHDLC" in zaptel.conf mean or why can't I make calls after upgrading to Zaptel-1.4.X and Wanpipe-3.2.X and re-using my old configs?
    9. How do I configure my Sangoma Hardware for a J1 line?
    10. How to have Asterisk stop when the Wanrouter stop script is ran?
    11. How do i configure MFC/R2 with Asterisk?
    12. How to configure the card for two b-channels transfer (TBCT) with Asterisk?
    13. How Do I Configure Redundent Systems On The Same T1/E1 Link?
    14. How do I configure a system to work with both a Sangoma card and a Digium card?

    Debuging 

    1. How do I perform physical layer (connection) debugging on AFT series cards ?
    2. How do I debug incoming and/or outgoing call issue on T1/E1 - PRI line ?
    3. I have an E1/PRI line, incoming calls are working but outgoing calls are not working what is wrong ?
    4. How do I debug echo issue with software echo cancellation ?
    5. How do I debug  DTMF recognition issue ?
    6. How to determine what port and channel number a call is using on an A500?
    7. How do I check if the telco is sending caller ID on a T1/E1 - PRI line?
    8. How do i stop my system from crashing on shutdown?
    9. Why am I unable to call out until I unplug and then plug in my analog lines?
    10. How can i stop "CT_C8_A clock behavior does not conform to the H.100 spec!" messages from printing in my system log?
    11. How do i fix "ZT_SPANCONFIG failed on span 1" or "zt_chanconfig failed channel 1"? 
    12. How do i fix "DAHDI_SPANCONFIG failed on span 1" or "dahdi_chanconfig failed channel 1"? 
    13. Why does my BT line have cross talk?
    14. How Do I Configure Clocking?
    15. Why can I not dial out? (Common Reasons This Will Occur)
    16. Libpri is reporting the error "MDL-ERROR (J) in state 7", how do I fix this?
    17. Why don't sip commands work in my asterisk CLI

     Checking Driver Version / Hardware Type 

    1. How do I check if the card has on board hardware echo cancellation and it's running?
    2. Does the card have PMC or Dallas/Maxim framer?
    3. How do I check the card firmware ?

    Telecommunication FAQ

    1. What is the difference between T1 and E1?
    2. What are the red, blue, and yellow alarms in a T1 system?
    3. What are the alarm indication signal (AIS), remote alarm indication (RAI), and distant multiframe alarm (DMA) in an E1 system?
    4. What are the differences between robbed-bit signaling (RBS), channel-associated signaling (CAS), and common-channel signaling (CCS)? 
    5. What is the difference between AMI, B8ZS, and HDB3?

    Q. Why does Zaptel not compile on some RedHat, CentOs and Trixbox Systems? 

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

    From julian - 2/22/07 5:27 PM [Delete]

    Ubuntu server 2.6.17-10

     I'm having problems running Setup.  It gives a syntax error :

    ./Setup: 1014: Syntax error: Bad substitution

     any ideas?

     FIX!!

     I needed to change the first line of the setup script to  #!/bin/bash and it worked. 


    Q. Checking for the Framer type on AFT T1/E1 card

    A.     You can configure a port for either T1 or E1.


    Do wanrouterstart and check your system log (/var/log/messages) right after wanrouterstart.
    If the card has PMC framer you will see following on the system log:

    wanpipe1: Global EC Clock Port = 1

    wanpipe1: AFT Data Mux Bit Map: 0x01234567

    wanpipe1: Configuring PMC COMET-QUAD T1 FE

    If the card has Maxim/Dallas Framer, you will see followingin the system log:

    wanpipe1: Global EC Clock Port = 1

    wanpipe1: Global E1 Front End configuration

    wanpipe1: AFT Data Mux Bit Map: 0x01234567

    wanpipe1: Configuring DSDS26521 E1 FE

    You can also visit our hardware-matrix


    Q. Which PRI dialplan configuration work with Batelco Jordan with Siemens ESW switch type?

        Following configuration works with Batelco Jordan
        pridialplan=unknown
        switchtype=euroisdn
       


     Q. I have an E1/PRI line, incoming calls are working but outgoing calls are not working, what is wrong?

    Most E1 lines require LibPRI/Asterisk to specify the type of number dialed.  In Zapata.conf try playing around with the following value (remember to add this option before the channels are defined):
    pridialplan= local                    (this value can also be unknown, private, national, and international)


    Q. I am using Ubuntu and am getting the following error when I try to use ./Setup install; "./Setup: 1014: Syntax error"?

    Ubuntu uses the Dash shell environment rather then a Bash style environment and the scripts need to be aware of this.  Open up the "Setup" script and change the first line from "#!/bin/sh" to "#!/bin/bash".  This will tell ubuntu to use the Bash shell rather then the default shell.

    Below is a list of some of the different syntax errors that indicate this issue: 

    -./Setup: 1293: Syntax error: "(" unexpected

    -./Setup: 1041: Syntax error: Bad substitution


    Q. Why do my FXS modules show up as FXO in Zaptel or FXO modules show up as FXS in Zaptel?

    An FXS module is used to connect a telephone/fax/modem/CPE device to a computer so it needs to emulate the signaling used by a telco; this signaling is called FXO (kewl start or loop start).  While an FXO module is the exact opposite, it is used to connect a computer to a telco line so it needs to emulate the signaling of a normal phone; this signaling is called FXS (kewl stat or loop start).  So it is perfectly normal and actually correct that the signaling used by Zaptel is always the opposite of what the module is called.  If you are still worried that you have purchased or received the wrong module you can check exactly what type of module you have by running the "wanrouter hwprobe verbose" command from the Wanpipe drivers which displays all the Sangoma cards installed and the location of any FXO or FXS modules.  If there are any problems contact techdesk@sangoma.com with a brief description of the problem.


     Q. What does "HARDHDLC" in zaptel.conf mean or why can't I make callsafter upgrading to Zaptel-1.4.X and Wanpipe-3.2.X and re-using my oldconfigs?

    As of Zaptel-1.4.X Digium has integrated the option for hardware HDLC framing into Zaptel so that it no longer needs to be patched.  As of Wanpipe-3.2.2 the driver install program will no longer patch Zaptel with our hardware HDLC patch, instead the configuration scripts "wancfg_zaptel" and "setup-sangoma" will now create zaptel.conf with the D-channel specified using "hardhdlc".  When zaptel.conf is parsed by Zaptel and it sees "hardhdlc=" Zaptel will NOT do HDLC framing on the D-channel stream, on the other hand if it sees "dhcan=" Zaptel will perform HDLC framing on the D-channel specified.

    If you have recently upgraded your version of Wanpipe to Wanpipe-3.2.2 or newer then you need to run "wancfg_zaptel" or "setup-sangoma" after the driver install to create updated configuration files.   If you are feeling brave then feel7. Start Asterisk and all the dahdi spans/channels for both cards should load and work free to simply change your zaptel.conf file manually:

    1. Open the file /etc/zaptel.conf with your favourite  text editor.
    2. Look for the line "dchan=24" or "dchan=16" and change it to "hardhdlc=24" or "hardhdlc=16".
    3. Save the file, exit the text editor, and run "ztcfg -vvv" to apply the new configuration.
    NOTE: If you are having problems making a call on a PRI line and you have both incoming and outgoing frames when you run the command "pri intense debug span X" in Asterisk then check the D-channel using Wanpipe: "wanpipemon -i wXg1 -c trd" (where X is the port number of the Sangoma card). If you only see incoming frames then both the hardware and Zaptel are doing HDLC framing on the D-channel, disable software HDLC framing by following the instructions above.

    How to determine what port and channel number a call is using on an A500?

    This depends on which driver version you are using, Wanpipe-3.3.6 or later Asterisk will tell you directly which port and channel is being used by which call, for Wanpipe-3.3.5 or earlier it is not as straight forward.

    For Wanpipe-3.3.6 or newer:

    Asterisk will display the following output for the show channels command:

     asterisk*CLI> show channels
    Channel                             Location                      State   Application(Data)
    WOOMERA/g2/5-88c1       200@from-internal:2   Up      Playback(demo-congrats)
    WOOMERA/g1/1                100@misc:2                Up      Echo()
    2 active channels
    2 active calls

    As you can see the woomera channel being used is specified by the following string "woomera/g1/1-XXXXXX".  The number after the "/" and before the "-" is the combined channel number the call is going through.  This number maps to the span number and channel using the following map:
    span 1 channel 1 = 1
    span 1 channel 2 = 2
    span 2 channel 1 = 3
    span 2 channel 2 = 4
    span 3 channel 1 = 5
    Now the span number in most cases is also the wanpipe number but if you want to be 100% sure or you are running any other Sangoma cards you will need to confirm which span belongs to which wanpipe.  In the /etc/wanpipe/wanpipeX.conf file you will find a value "TDMV_SPAN=Y" which is the span number attached to this wanpipe. 
    ....
    IGNORE_FRONT_END = NO
    TDMV_SPAN       = 1

    [w1g1]
    ACTIVE_CH       = ALL
    ....
    EXAMPLE: If wanpipe2.conf has a TDMV_SPAN=3 then the Asterisk channels the calls would go across are "woomera/g1/5" and "woomera/g1/6".

    For Wanpipe-3.3.5 or older:

    Coming Soon 


     How to have Asterisk stop when the Wanrouter stop script is ran?

    A relative unknown feature of the Wanpipe drivers is the pre-"wanrouter stop" stop script.  This is a file that can modified to run as a shell script (intelligent loops with variables) or to simply run Linux command prompt commands.  By default the file does not exist, there's nothing we need to stop with it but all you need to do to activate it is to create the file.

    1. Change directory to /etc/wanpipe/scripts using "cd /etc/wanpipe/scripts/".
    2. Create the file using the "touch" command, i.e.  "touch stop".
    3. Open the file using you favourite text editor and add anything you want the driver to do before it shuts itself down.
    Now a common problem with some installs (PBX in a FLASH) does not by default have an Asterisk stop script to be run on reboot/shutdown.  This is a problem because it can cause Zaptel to panic when the Wanpipe drivers don't shutdown because they are in use (a safety feature).  Use the "stop" script to easily force an Asterisk shutdown before the Wanpipe drivers stop.
    1. Run "vim /etc/wanpipe/scripts/stop" to open up the "stop" script for editing.
    2. Hit the "INSERT" key on your keyboard to put Vim into "insert" mode.
    3. Add the following command to safely stop Asterisk "asterisk -rx 'stop now' ".
    4. Hit the "ESC" key on keyboard to exit "insert" mode.
    5. Save and exit Vim by hitting ":wq".
    Do a test shutdown when you can control the system in case you still have a problem, if you continue to have problems please contact Sangoma support at "techdesk@sangoma.com"

    How do I install Wanpipe under Ubuntu Server 8.04

    The stock installation of Ubuntu Server 8.04 is missing some compiler tools needed for the install of Wanpipe (and Zaptel).  Please use the following commands to download the correct packages:
    apt-get -y install gcc
    apt-get -y install g++
    apt-get -y install make
    apt-get -y install libncurses5-dev
    apt-get -y install flex
    apt-get -y install bison
    apt-get -y install patch
    apt-get -y install linux-source
    apt-get -y install linux-headers-$(uname -r)
    In addition Ubuntu does not use the same shell as other distro's so you need to change our shell specification in the  "Setup" script.  After downloading and untarring the Wanpipe source files:
    -change directory into the wanpipe source files
    -open up the file "Setup" using your favorite text editor
    -change the first line that says "#! /bin/sh" to "#! /bin/bash"
    -save the file and run "./Setup install" to start the installation of the drivers

    How can i stop "CT_C8_A clock behavior does not conform to the H.100 spec!" messages from printing in my system log?

    If you are seeing multiple H.100 errors in your system log then the hardware echo canceler does not have a good clock source. On our more recent drivers 3.3.12 and up the first port that starts up will be the clocking source. So if your wanpipe1 is not connected then please configure your card to only start the first port that connects. If you have an older driver then the timing source is the first physical port on the card. So if you are not using the first physical port then please follow the steps below to set another port as a timing source.

    Please note that only one port can act as timing source for HWEC in a particular AFT102/104/108 card, in other words you can only set HWEC_CLCKSRC = YES for only one port for a card! 

    To change the clock simply edit your /etc/wanpipe/wanpipeX.conf file, x being the wanpipe number and then add the line "HWEC_CLKSRC = YES" as shown below. Next stop Asterisk and run "Wanrouter restart" to apply the changes and then start Asterisk up and the H.100 errors will be gone.

    TTL             = 255
    IGNORE_FRONT_END = NO
    TDMV_SPAN       = 1
    TDMV_DCHAN      = 24
    TDMV_HW_DTMF    = YES
    HWEC_CLKSRC     = YES

    To verify the change has taken effect check your system log (/var/log/messages) for the following output :

    wanpipe1: Configuring DS DS26521 T1 FE
    wanpipe1:    Port 1,B8ZS,ESF,0db
    wanpipe1:    Clk Normal:0, Channels: FFFFFFFF
    wanpipe1:    Rx Sensitivity Gain 36dB (default).
    wanpipe1: Front end successful
    wanpipe1: Front End Interface Ready 0x00000000
    wanpipe1: Register EC interface wanec1 (usage 1, max ec chans 32)!
    wanpipe1: Global EC Clock Port = 1
    wanpipe1: Configuring Device   :wanpipe1  FrmVr=34
    wanpipe1:    Global MTU     = 1500


    Why am I unable to call out until I unplug and then plug in my analog lines?

    Asterisk 1.6

    To fix this you just need to edit the file "drivers/dahdi/dahdi-base.c" in your Dahdi-Linux source. Once in this file find the line "chans[ch.chan]->rxhooksig = DAHDI_RXSIG_INITIAL;" and add a "//" in front of this line so it then reads "//  chans[ch.chan]->rxhooksig = DAHDI_RXSIG_INITIAL;". Once this is done then recompile dahdi-linux and this will resolve the issue. 

    Asterisk 1.4.22

    If you are using an A200 with Zaptel and Asterisk 1.4.22 then there is a known issue with outbound calls. The reason you are not able to call out is because Asterisk 1.4.22 has a new feature which detects if a analog line is plugged in or not, but this feature only works with Dahdi. So to fix the issue you can do one of the following.

    1) Downgrade to Asterisk 1.4.21 or earlier, you can find the Asterisk source at http://downloads.digium.com/pub/asterisk/releases/

    2) Upgrade to Dahdi which you can find instructions at http://wiki.sangoma.com/wanpipe-linux-asterisk-dahdi

    3) You can edit the Asterisk 1.4.22 source code; simply open the file "channels/chan_dahdi.c" in the asterisk source and make the changes below and recompile Asterisk.

    -----------------
    #ifdef DAHDI_CHECK_HOOKSTATE
                                            return 0;
    #else
                                            return 1;
    -----------------

    Change the "0" to a "1"

    -----------------
    #ifdef DAHDI_CHECK_HOOKSTATE
                                           & nbsp;return 1;
    #else
                                            return 1;
    -----------------


    How Do I Configure Redundent Systems On The Same T1/E1 Link?

    With our cards we have a feature called Tx Tri State and this will allow you to disable and enable the Tx on our cards on the fly. So once you have setup heart beat between the two boxes you can simply use this feature to enable the backup system if the main system goes down. For more information about how to disable and enabel this please go to http://wiki.sangoma.com/wanpipe-txtristate and this will have all the details you need. Remember the fail over setup is done with another 3rd party application such as heartbeat, this is just how to enable and disable our cards Tx. So you would need to build this into some sort of script that will run at the time of a fail over. 


    How do I configure a system to work with both a Sangoma card and a Digium card?

    The following will help you configure a system that contains both a Sangoma AFT card and a Digium card for Asterisk

    1. Run the script to configure your Sangoma card
     -> i.e wancfg_dahdi

    This command will create /etc/dahdi/system.conf and /etc/asterisk/chan_dahdi.conf for the Sangoma card

     2. Find out the run-level your system boots in and then open up that file

            -> vi /etc/inittab/        <------ your run level will be indicated after the line "id:"  (i.e. id:3:initdefault)
     ->cd /etc/rc<run-level>.d/   (i.e. cd /etc/rc3.d/)

    In here, we need to search for wanrouter and Dahdi, and to make sure that wanrouter starts up before Dahdi. 

     -> ls |grep dahdi     <---- The start order will be indicated by a number following S (i.e. S26dahdi)
            -> ls |grep wanrouter   <---- (i.e. S25wanrouter)

    As indicated by the above example, wanrouter does start prior to dahdi, since its number is lower.  If your results indicate the opposite, you can re-configure the start order by re-naming the file and change the numbers around

    If your search results do no populate anything for dahdi, that means you do not have a start script for it.  To create the start script, go into the source directory for dahdi and type: make config. Now the start scripts have been created and proceed again with the beginning of this step. 

    3. stop Asterisk; stop wanrouter; stop dahdi

    -> asterisk -rx "core stop now"
    ->wanrouter stop
     ->/etc/init.d/dahdi stop

    4. Now start wanrouter, followed by dahdi

    *Note: you will come to a point after "wanrouter start" that throws an error message indicating span configuration problem.  Disregard this message as this is the first span of the digium card, and therefore the Sangoma card does not know how to configure, which leads you to the next step (/etc/dahdi.system.conf)

    -> wanrouter start
     -> /etc/init.d/dahdi start

    At this stage, we have the Sangoma card loaded first into the dahdi spans by starting wanrouter, and then loaded the Digium card after by starting dahdi .  You can run cat /proc/dahdi/ in between to see that this exact process occurs. Since both cards are loaded as Dahdi spans, they are indistinguishable to dahdi and the above layers of the system

    5. Run dahdi_genconf

    This command will re-write /etc/dahdi/system.conf and will include both the Sangoma card and the Digium card, since they are all considered just dahdi spans now.  It is important to note that dahd_genconf uses the syntax "dchan=24" to define a D-channel, but the correct syntax for Sangoma hardware is "hardhdlc=24".  Make sure that you make this change before continuing.

    6. Re-write chan_dahdi.conf .  All that is needed to be done in this file is to append the Digium card configuration at the end.  Since the Sangoma card was loaded first, the configuration created in here by wancfg_dahdi (in step 1) are correct, and placing the Digium configs after makes sense.

    7. Start Asterisk and all the dahdi spans/channels for both cards should load and work


    How do i fix "ZT_SPANCONFIG failed on span 1" or "zt_chanconfig failed channel 1"? 

    • First run "wancfg_zaptel" or "setup-sangoma" on trixbox to insure your configuration is correct because this can be a configuration issue.
    • Second reason could be there is an error when wanpipe starts. To get the error simply open your /var/log/messages and it will be printed in there. If you need help finding the error or decoding it just simply send the entire /var/log/messages file right after the issue occurs to techdesk@sangoma.com. 
    • If there is no errors with the wanpipe start up then ZTDUMMY or another TDM card could be taking span 1. So to check this simply run "cat /proc/zaptel/1" and insure the output has WP in it to indicate it is wanpipe as shown below. Now if another TDM card is in the system then please go to "Sample Configuration of Sangoma card with another TDM Card" and follow the steps there.

    [root@localhost ~]# cat /proc/zaptel/1
    Span 1: WPT1/0 "wanpipe1 card 0" (MASTER) B8ZS/ESF
               1 WPT1/0/1
               2 WPT1/0/2
               3 WPT1/0/3
               4 WPT1/0/4


    If ZTDUMMY is loaded then you can simply insure asterisk is stopped by running " asterisk -rx "stop now" ", "wanrouter stop" and then run "/etc/init.d/zaptel stop". Once this is complete then run "ls /proc/zaptel" and insure there is no output and then run "wanrouter start", "ztcfg -vv" and "asterisk" and then test everything to insure it is working. To insure the zaptel start script does not run again just run "chmod -x /etc/init.d/zaptel" and this will disable the script but not remove it incase you need it in the future.


    How Do I Configure Clocking?

    Per Port Configuration

    Below is all the different scenarios that can occur for a single T1/E1/J1 link. Now remember there can NOT be no clock on a T1/E1/J1 link and there can not be two clocks. For a how to on configuring multiple ports go to http://wiki.sangoma.com/wanpipe-linux-asterisk-appendix#clockSync. Also note step 4 is the typical setup when connecting to the telco. 

     clocking-1.png

    The link in this scenario will NOT connect to the far end equipment because there has to be one clock on a T1/E1/J1 link.

    clocking-2.png

    The link in this scenario will connect to the far end equipment because there is a clock on the line.

    clocking-3.png

    The link in this scenario will connect to the far end equipment because there is a clock on the line. But the issue here will be that there is two different clocks on the line. This means both ends will be syncing from their own clock which will be slightly different. You may not notice an issue at first but over time the clocks will change a bit and you will have sound issues.

    clocking-4.png

    The link in this scenario will connect to the far end equipment because there is a clock on the line. This is also your typical setup for connecting to a telco.

    Per Card Configuration

    Each Sangoma card requires a single clock per card. The reason for this is it increases our efficiency because each port can be handled in a single interrupt rather a separate interrupt per card. So this single interrupt for each port approach allows us to run an A108 with out adding a great deal of load to the system.

    Now if the case where two clocks occur this can cause issues that will result in noise and faxing problems. Now you can get two clocks in two scenarios. The first is you have multiple telco's connected to one card; now in some cases this is not an issue if the telcos are providing you with the same clock. Often in North America the telco's all provide the same clock so normally it is not something to worry about. The second way it can occur is if you are providing clocking for a channel bank or a PBX; this is because you receive one clock from the telco and you need to provide another to channel bank/pbx. Below is how to correctly setup the card in that scenario.

    1) In the setup below there is one telco link and three channel bank/pbx links. Now in the /etc/wanpipe/wanpipe*.conf files for this senario to occur the clocking will be set as shown below. So this means port 2-4 the clock is provided from the clock on the card its self and port 1 gets it's clock from the telco; so this results in two different clocks. Now when using our configuration scripts this will occur because NORMAL clocking was selected for port 1 and ports 2-4 MASTER was selected but the clocking source was "Free run" rather then "Port 1".

    This Setup Is Wrong; Just For Example

    Port 1:     TE_CLOCK                        = NORMAL
                    TE_REF_CLOCK                    = 0

    Port 2-4:  TE_CLOCK                        = MASTER
                    TE_REF_CLOCK                    = 0

    wrong-clock-per-card.png

    2) In the setup below there is one telco link and three channel bank/pbx links. Now in the /etc/wanpipe/wanpipe*.conf files for this senario to occur the clocking will be set as shown below. So this means port 2-4 the clock is provided from the clock on port 1 which is the telco's clock; so this results in only a single clock. Now when using our configuration scripts this will occur because NORMAL clocking was selected for port 1 and ports 2-4 MASTER was selected but the clocking source was "Port 1" rather then "Free run". This scenario here is correct because there is only one clock as shown in the picture below and the fix in the configuration was "TE_REF_CLOCK =1" rather then "TE_REF_CLOCK =0" for ports 2-4.

    This Setup Is Correct

    Port 1:     TE_CLOCK                        = NORMAL
                    TE_REF_CLOCK                    = 0

    Port 2-4:  TE_CLOCK                        = MASTER
                    TE_REF_CLOCK                    = 1

    right-clock-per-card.png


    How do i fix "DAHDI_SPANCONFIG failed on span 1" or "dahdi_chanconfig failed channel 1"? 

    • First run "wancfg_dahdi" or "setup-sangoma" on trixbox to insure your configuration is correct because this can be a configuration issue.
    • Second reason could be there is an error when wanpipe starts. To get the error simply open your /var/log/messages and it will be printed in there. If you need help finding the error or decoding it just simply send the entire /var/log/messages file right after the issue occurs to techdesk@sangoma.com. 
    • If there is no errors with the wanpipe start up then DAHDIDUMMY or another TDM card could be taking span 1. So to check this simply run "cat /proc/dahdi/1" and insure the output has WP in it to indicate it is wanpipe as shown below. Now if another TDM card is in the system then please go to "Sample Configuration of Sangoma card with another TDM Card" and follow the steps there.

    [root@localhost ~]# cat /proc/dahdi/1
    Span 1: WPT1/0 "wanpipe1 card 0" (MASTER) B8ZS/ESF
               1 WPT1/0/1
               2 WPT1/0/2
               3 WPT1/0/3
               4 WPT1/0/4


    If DAHDIDUMMY is loaded then you can simply insure asterisk is stopped by running " asterisk -rx "stop now" ", "wanrouter stop" and then run "/etc/init.d/dahdi stop". Once this is complete then run "ls /proc/dahdi" and insure there is no output and then run "wanrouter start", "dahdi_cfg -vv" and "asterisk" and then test everything to insure it is working. To insure the dahdi start script does not run again just run "chmod -x /etc/init.d/dahdi" and this will disable the script but not remove it incase you need it in the future.


    Why does my BT line have cross talk?

    In some cases the BT to RJ11 connectors are not setup correctly so cross talk occurs. The best idea is to purchase a BT to RJ11 connector such as the one below which only gives you the two pins so you know it is done correctly. Now the one in the picture below is available at http://www.maplin.co.uk/. If you are still receiving cross talk after this then go to http://wiki.sangoma.com/SangomaTechSupport#analog and send all the information there into techdesk@sangoma.com.

    bt-rj11.png


    Why can I not dial out? (Common Reasons This Will Occur)

    The first thing to always check is the physical layer up to the d channel, once this is all done and everything looks good then you can proceed with the following suggestions. To check this please go to http://wiki.sangoma.com/wanpipe-linux-asterisk-debugging.

    1) The main reason you can not dial out is pridialplan needs to be set in your chan_dahdi.conf or zapata.conf located in /etc/asterisk/. This option is just as the description from voip-info.org says which is that some switches just simply need you to set this; so try every option and insure to restart Asterisk each time you change it.

    PRI/BRI

    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.
       pridialplan=local

    2) The next reason is Caller ID, some telcos need you to send a certain CID when you make a call. Now some telcos only need part of the number sent to them; maybe the last four digits or without the area code. Now try this option even if the telco assures you that you don't need it because in some cases we have had the telco says they don't need it and they really do.

    3) The last reason that could possibly cause calling issues is the switch type; below is the all the possible switch types along with a description from voip-info.org.Note this is set in your /etc/asterisk/chan_dahdi.conf or /etc/asterisk/zapata.conf.

    switchtype: Sets the type of PRI switch being used. Default: national. Acceptable values are:

    -> national: National ISDN type2 (common in the US)
    -> ni1: National ISDN type 1
    -> dms100: Nortel DMS100
    -> 4ess: AT&T 4ESS
    -> 5ess: Lucent 5ESS
    -> euroisdn: EuroISDN
    -> qsig: Minimalistic protocol to build a "network" with two or more PBX of different vendors!

    4) If the issue is still occuring please go to http://wiki.sangoma.com/wanpipe-linux-asterisk-debugging and send us all the details in step 9 for PRI and step 8 for BRI. Also note outbound calls not working when the d channel is up is typically not a Sangoma issue or a Telco issue, it is rather that we need to configure our side to match the telco settings. The default settings from our configurator works almost all the time, but sometimes the telco needs additional parameters to be sent to them(as you can see from the previous steps). So it is just a matter of matching their settings and this is why the trace is needed to insure the telco is rejecting the call, if they are rejecting the call then we take the trace to the telco and ask them why they are. They will have a look and be able to tell us what needs to be changed on our side.


    Libpri is reporting the error "MDL-ERROR (J) in state 7", how do I fix this? 

    On the latest version of libpri 1.4.11.3 customers have reported on some links there to be the error shown below. Once they have switched back to version 1.4.10.2 this has resolved their issues completely. So it is not clear at which version the issues began but 1.4.10.2 does resolve this issue. Also in future versions of libpri their developers should have this resolved.

    Download Libpri 1.4.10.2 from --> http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.2.tar.gz

    --------

    [Aug 10 11:44:29] ERROR[27519] chan_dahdi.c: MDL-ERROR (J) in state 7
    [Aug 10 11:44:29] ERROR[27519] chan_dahdi.c: Don't know what to do with RR in state 5
    [Aug 10 11:44:29] ERROR[27519] chan_dahdi.c: Don't know what to do with RR in state 5
    [Aug 10 11:53:25] ERROR[27519] chan_dahdi.c: !!!!!!!!!!!! Should have only transmitted 0 frames!
    [Aug 10 11:53:25] ERROR[27519] chan_dahdi.c: N(R) 56 not within ack window! Bad Bad Bad!
    [Aug 10 11:53:25] ERROR[27519] chan_dahdi.c: PTP MDL can't handle error of type J


    How do I check if the telco is sending caller ID on a T1/E1 - PRI line? 

    On a PRI line the caller ID comes into Asterisk through the Q931 signaling. So in Asterisk you can enable debugging which will show you the Q931 messages coming in and out of the system.

    To do this follow the steps below:

    1) Go into the Asterisk CLI using the command "asterisk -r" 

    2) Then run the command "pri intense debug span X" (X being the span number)

    3) Place a call into the system which should have caller ID on it, then run the command "pri no debug span X" (X being the span number) and hangup the call. 

    4) Then look up in the output for the SETUP message, below is a sample of what it should look like. Now the "Calling Number" is the caller ID that you are looking for, so below the CID number is "098765432", also you can see the CID name is "Sangoma09876". Next you can even see the "Called Number" which is the number the external phone has dialed, in this case you can see it is "555".

    < Protocol Discriminator: Q.931 (8)  len=54
    < Call Ref: len= 2 (reference 2/0x2) (Originator)
    < Message type: SETUP (5)
    < [04 03 80 90 a2]
    < Bearer Capability (len= 5) [ Ext: 1  Q.931 Std: 0  Info transfer capability: Speech (0)
    <                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
    <                                User information layer 1: u-Law (34)
    < [18 03 a1 83 88]
    < Channel ID (len= 5) [ Ext: 1  IntID: Implicit  PRI  Spare: 0  Preferred  Dchan: 0
    <                        ChanSel: Reserved
    <                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
    <                       Ext: 1  Channel: 8 ]
    < [1e 02 80 83]
    < Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: User (0)
    <                               Ext: 1  Progress Description: Calling equipment is non-ISDN. (3) ]
    < [28 0d b1 53 61 6e 67 6f 6d 61 30 39 38 37 36]
    < Display (len=13) Charset: 31 [ Sangoma09876 ]
    < [6c 0c 21 80 30 39 38 37 36 35 34 33 32 31]
    < Calling Number (len=14) [ Ext: 0  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
    <                           Presentation: Presentation permitted, user number not screened (0)  '0987654321' ]
    < [70 04 a1 35 35 35]
    < Called Number (len= 6) [ Ext: 1  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)  '555' ] 

    5) If you do see the CID then start configuring your dial plan to receive it. If you need help with this then please click here to go to the VOIP-info's page on caller ID. If you do not see the CID then contact your telco and tell them you are looking at the SETUP message that they are sending and there is no CID.

    Also please note that there is no configuration in our drivers for caller ID, this is because the signaling is all done by Zaptel/Libpri/Aserisk.


    How do I configure the card for 2 B-channels transfer (TBCT) with Asterisk?

    If incoming calls are bridged on the same PRI line, there is no need for Asterisk to keep this call up. When TBCT feature is enabled, Asterisk releases two b-channels and remote end switch take care of the calls.

    This feature is only supported with DMS 100 and 5ESS switch type (with Asterisk/LibPRI/Zaptel version 1.4).

    To enable this feature, customer needs to set the following two parameters in /etc/asterisk/zapata.conf

    facilityenable = yes

    transfer = yes


     Why don't sip commands work in my asterisk CLI

    Verify the chan_sip module exists in the modules directory (/usr/lib/asterisk/modules)

    If chan_sip does not exist, this means chan_sip did not compile during asterisk compilation. 

    In the source directory of asterisk, type:
    -> make menuconfig

    If you see XXX beside chan_sip (under Channel Drivers), this means you are missing chan_sip dependency:
    -> install openssl (i.e. yum install openssl)
    -> recompile Asterisk
    -> verify sip commands work in asterisk