Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

miércoles, 25 de septiembre de 2013

Como interconectar 2 centrales Asterisk usando troncales T1

 

How to connect two Asterisk PBXs using a T1 Trunk

This webpage will discuss how to connect two Asterisk PBXs together using a T1 trunk. The T1 trunk will be configured as an ISDN PRI rate trunk.
Brief Talk about T1 trunking
A T1 trunk consists of 24 channels of 64 kbps of data operating at 1.544 Mbps. It is a serial connection over UTP and provides full duplex communications. The connectors are RJ45 connectors the same as Ethernet. The pinout is different and a crossover cable pinout can be found here. The assumption at this point is that your T1 card has been tested and appears to be functioning properly.
The data channels can be configured to pretty much anything you want it to be. You can combine the channels to create a channel with 384 kbps bandwidth or you can use only part of the 24 channels. If you use only part of the T1 available bandwidth, it is called fractional T1.
The control of the T1 channels can be in-band or out of band. If it is in-band, bits are robbed from the 64 kbps channel for signaling. The result is 56 kbps for data per channel but you have 24 channels available for data. This robbed bit signaling is not used too much anymore due to the lower bandwidth per channel.
Out of band signaling uses one complete channel for control. This means that 23 channels of 64 kbps are available for data and the 24th is used for signaling. Any channel can be used for control, it doesn't have to be the 24th.

The most common signaling method in North America is ISDN PRI. It has 23 data channels of 64 kbps called B (bearer) channels and one control channel called the D channel. This is the signaling method that will be used in configuring the PBXs for this website. To find out more about ISDN, visit my online book: Chapter 23: Integrated Services Digital Network (ISDN)
Connecting the PBXs together
In this example, we'll be connecting two PBXs together in a building and running a T1 cross-over cable between them. First we'll set down some rules:
  • PBX #1 will provide the master timing clock and PBX #2 will be a slave
  • Standard North America signaling will be used: extended superframe and b8zs signaling.
  • PBX #1 will simulate the network and provide dialtone
  • PBX #2 will be the customer premise equipment (CPE)
Configure the Linux kernel hardware drivers:
After physically cabling the two PBXs together, the next step is configure the Linux kernel hardware drivers:
  1. Configure PBX #1's /etc/zaptel.conf
    # Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0"
    span=1,0,0,esf,b8zs
    
    # Configuration for T1 trunk
    # channel 1-23 data channels
    bchan=1-23
    # channel 24 control
    dchan=24
    
    Basically, we made the first 23 channels to be data and channel 24 to be signaling. This configuration assumes that you only have one zaptel card installed. This page has the details for configuring /etc/zaptel for a T1 line
  2. Configure PBX #2's /etc/zaptel.conf
    # Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0"
    span=1,1,0,esf,b8zs
    
    # Configuration for T1 trunk
    # channel 1-23 data channels
    bchan=1-23
    # channel 24 control
    dchan=24
    
    The main difference is the second "1" in the "span=" line. This makes PBX #2's T1 card a slave to PBX #1's master timing clock.
Next is to configure the Asterisk interface to the T1 hardware for each PBX

 -


Configuring the Asterisk T1 ISDN PRI Interface

This webpage is a continuation of connecting two Asterisk PBXs together using a T1 ISDN PRI trunk. Next is to configure the Asterisk interface to the hardware for each PBX
  1. At PBX #1, if the file /etc/asterisk/zapata_custom.conf doesn't exist, create it and include it in the file /etc/asterisk/zapata.conf by adding the line:
            #include zapata_custom.conf
    
  2. Configure PBX #1's T1 channel by adding the following lines to zapata_custom.conf:
     context=from-pstn
     switchtype=national
     signalling = pri_net
     group = 2,24
     channel => 1-23
    
    • "context=from-pstn" tells asterisk how to find this configuration. "context=from-trunk" or "context=from-zaptel" would work also.
    • The line "signalling=pri_net" indicates that this card is simulating the service provider (network) and providing the master clock.
    • Normally if this was the only zaptel card installed, it would have "group=0". The "group=2" is so that the later webpage images match. In my setup, I have an FXS/FXO card and group 0 and 1 have already been used. The ,24 indicates which channel is being used for the D channel (control) and is optional.
  3. Restart the zaptel services at the Linux command line:
     root@pbx:~$ amportal stop  <= this stops asterisk
     root@pbx:~$ service zaptel restart <= you can guess what this does!
    
  4. Use zttool and ztcfg -vv at the Linux command line to test that the T1 line is configured properly.
    I found that it always indicates internally clocked even if externally clocked. In this example, the first 4 channels are from a TDM400P FXO/FXS card, channels 5-28 are from the T1 card.
  5. From the Asterisk CLI, type help. You should see the zap commands. If you do not see the zap commands, examine /var/log/asterisk/full to see what the zapata driver is doing. Often if /etc/zaptel or /etc/asterisk/zapata_custom.conf is misconfigured, useful error messages will show up.
  6. At PBX #2, if the file /etc/asterisk/zapata_custom.conf doesn't exist, create it and include it in the file /etc/asterisk/zapata.conf by adding the line:
            #include zapata_custom.conf
    
  7. Configure PBX #2's T1 channel by adding the following lines to zapata_custom.conf:
     context=from-pstn
     switchtype=national
     signalling = pri_cpe
     group = 2,24
     channel => 1-23
    
    • "context=from-pstn" tells asterisk how to find this configuration. "context=from-trunk" or "context=from-zaptel" would work also.
    • The line "signalling-pri_cpe" indicates that this card is simulating the Customer Premise Equipment (sometimes called the TE - terminal equippment) and receiving the clock.
  8. Restart the zaptel services at the Linux command line.
  9. Check the indicator LEDs on the T1 cards. They should change from Red to Green. And the yellow alarm should be cleared on the Linux command line.
  10. Use zttool and ztcfg -vv at the Linux command line to test that the T1 line is configured properly.
  11. From the Asterisk CLI, type help. You should see the zap commands. If you do not see the zap commands, examine /var/log/asterisk/full to see what the zapata driver is doing. Often if /etc/zaptel or /etc/asterisk/zapata_custom.conf is misconfigured, useful error messages will show up.
  12.  
  13. Next is to configure the T1 trunks and Outbound Routes in FreePBX
     This webpage is a continuation of both Configuring the Asterisk Zaptel T1 Interface and Configuring the Asterisk Dahdi T1 Interface. Next is to configure the T1 trunk and create an Outbound Routes in FreePBX.
    Configuring the T1 trunk
    For both PBX #1 and #2, from the FreePBX Admin menu, select trunks. Add Zaptel trunk and give it the Zap identifier of g2. This corresponds to the "group=2" line from /etc/asterisk/zapata_custom.conf that was configured earlier. That's all that needs to be done:

    Creating the Outbound Routes
    Creating the T1 trunk Outbound Routes are pretty straight forward. In this example:
  14. PBX #1 will dial 284xxxx to connect to PBX #2's extensions xxxx.
  15. PBX #2 will dial 240xxxx to connect to PBX #1's extensions xxxx.
Here's PBX #1's Outbound route configuration:
Here's PBX #2's Outbound Route configuration:
Test the Outbound Route Rules
All that's left is to dial out from one of the PBXs to the next using the new Outbound Routes.
  • From PBX #1 dial 284xxxx where xxxx is a known extension of PBX #2
  • From PBX #2 dial 240xxxx where xxxx is a known extension of PBX #1

d s

No hay comentarios:

Publicar un comentario