Asterisk@Home Handbook Wiki Chapter 5

Business PBX Solutions
Provider Solution Details
Bicom VoIP Become an ITSP Now!
  • Become a serious competitor in VoIP Immediately
  • FULL Consultancy, Installation, Training & Support
  • Sell Hosted IP PBXs, Biz Lines, Call Centre
  • Turnkey Provisioning at your data center
Details
3CX Software PBX for Windows
  • Windows Software Solution
  • Easy to Install and Manage
  • Auto Configures Phones & Trunks
  • Android, iOS, Windows & Mac clients
Details
VoIP Hardware Solutions
Provider Solution Details
VoIP Hardware Zycoo UC Solutions
  • Modular Design IP PBX for SMB
  • Remote office Centralized Management solution
  • 3rd party app integration, Enterprise Billing, Android & iOS client
Details
Yeastar Communications Solutions
  • Cost-effective IP-PBX Solution for SMB
  • FXS, FXO, GSM, BRI and PRI VoIP Gateways
  • Rich features and reliable performance
Details
Asterisk@Home Handbook Wiki




Chapter 5 PSTN interface cards

There are many types of PSTN interface cards. These can include a single FXO card to allow 1 home telephone line to be connected to Asterisk, or a T1 card that allows a digital trunk to be connected to Asterisk. All of these cards allow you to make calls directly on the Public Switch Telephone Network without having to use a VOIP phone service provider.

PSTN cards can also be used to connect a PSTN (Non VOIP) phone to Asterisk. These can include a single FXS card to allow 1 home telephone to be connected to Asterisk, or a T1 card that allows a channel bank with 24 phones or a tie line to a PBX to be connected to Asterisk.


5.1 FXO Cards/Devices

These cards allow you to connect a POTS (plain Old Telephone System) line to your Asterisk@Home box.


5.1.1 Digium Wildcard X100P OEM FXO PCI Card

These voice modems are available on e-bay for about $10.00 They are not made by Digium and are of low quality. Having said this they can work very well in many situations. If your phone line is well balanced they will work well. If it’s not you can get some bad echoes. We recommend them only for testing not for a production system.

To configure these cards for use with Asterisk@Home first use the zaptel card auto-config utility to set up the zaptel driver.

Type genzaptelconf -s -d from the command line (if the card was in the system when you installed aah this already done)

Next go into the AMP web interface and create a trunk.

There is already a trunk called ZAP/g0 edit this


Enter the phone number for you pots line in the Caller ID field
Enter 1 for Maximum channels
Set a dial rule if you want for this trunk
Select an outbound dial prefix to select this trunk when dialing

Set the Zap Identifier to 1 (the default is g0)


This trunk is now configured
you must add a route for incoming calls or asterisk will not answer this line

click on incoming calls in amp and set up an incoming route.

to make outbound calls you will need an outbound route. set one up in AMP

Hardware Conflicts

This card is especially sensistive to hardware conflicts. I had a problem where I was unable to make outbound or inbound calls and would hear static on the POTS line when asterisk tried to play its error message. I got errors like: "Everyone is busy/congested at this time", "ZT_CHANCONFIG failed on channel 1: No such device or address", and "wcfxo: probe of 0000:00:09.0 failed with error -5". I moved the PCI card from slot 1 to slot 2 and now everything works out-of-the-box. One symptom was that the card was listed in lspci (as a Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface) but wcfxo had no interrupt assigned in /proc/interrupts. If one wanted to add an automated check for this problem in the installation or a debug tool, that might be a good criterion.

5.2 FXS Cards/Devices

These cards/devices allow you to connect an Analog phone to your Asterisk@Home box.

5.3 FXO/FXS Combo Cards/Devices

These cards/devices allow you to connect a POTS (plain Old Telephone System) line and an Analog telephone to your Asterisk@Home box.

5.3.1 Linksys/Sipura SPA-3000 FXO/FXS Device

Contributed by: Casey

If you find this info. helpful, consider dropping a $1 donation in my PayPal virtual tin-can. Thanks!

If it is in-stock at buy.com, you can get it for less than $70 with free shipping. Sipura was bought by Linksys (Cisco bought Linksys, but retained the Linksys name). This device can be used as a stand-alone item with a third-party VoIP provider, or you can use it with Asterisk@Home. When used with Asterisk@Home, it can be used as a TRUNK to connect to the PSTN via its FXO interface, and can also act as an EXTENSION to connect an ANALOG telephone via its FXS interface (aka ATA - Analog Telephone Adapter).

Assumptions/Prerequisites/Tested with:
1. The Asterisk server and the SPA-3000 are public IP addresses, or on the same private network (no NAT is involved).
2. Asterisk@Home version 2.8 installed.
3. Sipura SPA-3000 with the 3.1.10(GWd) firmware installed, and reset to factory defaults (to reset the SPA-3000 to factory defaults, dial: ****73738#1 FYI 73738 spells RESET on a phone keypad).

Names and Numbering Conventions used in this example:
333.333.333.333 the Asterisk@Home server's IP address
444.444.444.444 the Sipura SPA-3000 devices's IP address
Username111 any username you want, as long as it's unique (example: SipuraPSTN)
Password111 any password you want to go with Username111
Username222 a different username than Username111 (example: 200)
Password222 any password you want to go with Username222
Password333 any password you want to use for the SPA-3000 user web configuration pages
Password444 any password you want to use for the SPA-3000 admin web configuration pages

Username111/Password111 are going to be used when setting up the TRUNK. Username222/Password222 are going to be used when setting up the EXTENSION. I'd recommend for Username222 you use a number you'd like for the extention (example: "200").

The following instructions have ***NO SECURITY*** features enabled. The SPA-3000's factory defaults will allow anyone who can access the IP address of the device to dial out using the PSTN. Unauthorized users could make any and many calls to long-distance, international and 900 numbers.

The device has three distinct functions. To make configuration as straigt-forward as possible, we're going to address each function as a separate task. (And, as it turns out, things also increase in complexity as we proceed. To save your sanity, it's highly recommended you troubleshoot any issues at the end of each task, before proceeding on to the next task.)

5.3.1.1 SPA-3000 FXO as a PSTN-To-VoIP Gateway (Inbound Trunk)


This is the first of four tasks. Some of the settings below vary depending on if you have (pay your local phone company for) Caller ID on your PSTN line. Those variables are mentioned when and where applicable.

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the PSTN Line tab
3. Scroll down to Proxy and Registration
4. Set Proxy: 333.333.333.333
5. Scroll down to Subscriber Information
6. Set User ID: Username111
7. Set Password: Password111
8. Scroll down to Dial Plans
9. Set Dial Plan 2: (S0<:333.333.333.333>)
10. Scroll down to PSTN-To-VoIP Gateway Setup
11. Set PSTN CID for VoIP CID: yes (with PSTN Caller ID) / no (without PSTN Caller ID)
12. Set PSTN Caller Default DP: 2
13. Scroll down to FXO Timer Values (sec)
14. Set PSTN Answer Delay: 3 (with PSTN Caller ID) / 0 (without PSTN Caller ID)

Within Asterisk@Home:
1. Access the FreePBX Setup page.
2. Click Trunks
3. Click Add Trunk
4. Click Add SIP Trunk
5. Scroll down to Outgoing Settings
6. Set Trunk Name: Username111
7. Delete the prefilled Peer Details:, and replace them with:
canreinvite=no
context=from-pstn
host=dynamic
nat=no
port=5061
secret=Password111
type=peer

8. Scroll down to Incoming Settings
9. Delete the prefilled User Details:, just leave it blank.
10. Scroll down to the bottom of the page and click Submit Changes
11. Click the You have made changes - when finished, click here to APPLY them at the top of the page.

Before proceeding to configuring the SPA-3000 as an outbound trunk and analog telephone adapter, make certain it's accepting incoming calls using the configuration above. Troubleshooting any problems at this point will make your life easier. Remember to configure Inbound Routes from within the FreePBX interface. Without an inbound route configured, A@H won't know what to do with the call the SPA-3000 is trying to send to it!

5.3.1.2 SPA-3000 FXO as a VoIP-To-PSTN Gateway (Outbound Trunk)


This is the second of four tasks. Now that you've got the SPA-3000 routing incoming PSTN calls to Asterisk, it's time to change direction and allow Asterisk to route calls out the SPA-3000. Actually, the SPA-3000 will allow outbound calls without any additional configuration, if it's running factory defaults with just the changes made in the first task. Asterisk can send calls to the SPA-3000, and it will send them out the PSTN.

In reality, at this point any SIP device can send calls to the SPA-3000 and it will route them out the PSTN. Not the most secure setup, is it? After paying for someone else's international and 900 calls that they conveniently routed through your SPA-3000 PSTN connection, you might want to consider restricting just who can use it. Here's how:

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the PSTN Line tab
3. Scroll down to VoIP-To-PSTN Gateway Setup
4. Set VoIP Caller Auth Method: HTTP Digest
5. Scroll down to VoIP Users and Passwords (HTTP Authentication)
6. Set VoIP User 1 Auth ID: Username111
7. Set VoIP User 1 Password: Password111

Within Asterisk@Home:
No changes are needed. The settings used in the previous task are sufficient.

The SPA-3000 still isn't completely secure against abuse by other SIP devices and users. We cover the final settings in the fourth task.

Before proceeding to configuring the SPA-3000 as an analog telephone adapter, make certain it's sending outgoing calls using the configuration above. Troubleshooting any problems at this point will still make your life easier. Remember to configure Outbound Routes from within the FreePBX interface. Without an outbound route configured, A@H won't know when to send an outgoing call to the SPA-3000!

5.3.1.3 SPA-3000 FXS as an Analog Telephone Adapter (Asterisk Extension)


This is the third of four tasks. Using the SPA-3000 for an EXTENSION is a process that is totally separate from using it as a TRUNK. In fact, the device handles the Line 1 settings as a one VoIP account, and the PSTN Line settings as a totally separate VoIP account. Now you know why we needed two Usernames/Passwords! So, if you only want to use it as a TRUNK, skip this task and go to task four. Or, if you only want to use it as an EXTENSION, skip tasks one and two, and just complete tasks three and four.

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the Line 1 tab
3. Scroll down to Proxy and Registeration
4. Set Proxy: 333.333.333.333
5. Scroll down to Subscriber Information
6. Set User ID: Username222
7. Set Password: Password222
8. Scroll down to Dial Plan
9. Set Dial Plan: (xx.)

Within Asterisk@Home:
1. Access the FreePBX Setup page.
2. Click Extensions
3. Click Add Extension
4. Click Add SIP Extension
5. Scroll down to Add Extension
6. Set Extension Number: Username222
7. Scroll down to Device Options
8. Set secret Password222
9. Scroll down to the bottom of the page and click Submit Changes
10. Click the You have made changes - when finished, click here to APPLY them at the top of the page.

Remember, the SPA-3000 can be used with third-party VoIP providers. Imagine for a moment that you are a large VoIP provider, with hundreds of thousands of customers. Depending on your design philisophy, you might want the customer's equipment to do a lot of the processing when it comes to common tasks, instead of querying your server each time. If a dialplan could be stored locally on the device, then when a customer dialed a number, the device could determine if it was valid, before passing it to your server.

This pre-processing would potentially reduce a lot of traffic from the device to your server, meaning you could service more customers per server. This is exactly how the SPA-3000 is designed to work. If you leave the default Line 1 tab's Dial Plan in place, the SPA-3000 will attempt to determine if the number is valid, before passing it to Asterisk. If the number doesn't match the dialplan stored in the SPA-3000, the SPA-3000 will reject it, without ever checking with Asterisk. That's why we've changed it, as we want the SPA-3000 to pass it to Asterisk without much adieu.

This pre-processing by the SPA-3000 is most noticable when using vertical service codes (for example: *61 or *65). Instead of bothering your Asterisk server to determine if the code is valid, the SPA-3000 will try to figure it out by itself. Knowing this may save you from hours of wondering why *61 will work, but *65 won't. Tinkering with the Line 1 tab's Supplementary Service Subscriptions settings, and the Regional tab's Vertical Service Activiation Codes settings are beyond the scope of this handbook entry. But, at least now you're aware of what's happening.

5.3.1.4 SPA-3000 Securing the Web Interface


This is the fourth of four tasks. In the previous tasks, we've setup usernames/passwords for our device. The largest issue with the SPA-3000 is the potential for unauthorized users to place long-distance, international, and 900 calls out through the PSTN. While we've configured the device to use usernames/passwords, they're really not much good at the moment. Why? Because any unauthorized user could simply access the SPA-3000's web interface, just like you, and either determine what your usernames/passwords settings are, or even more simply, they could reset them to something THEY want.

The final step, therefore, is to secure the SPA-3000 web interface with a password.

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the System tab
3. Scroll down to System Configuration
4. Set User Password: Password333
5. Set Admin Passwd: Password444

Enjoy!

5.3.2 Digium TDM400P FXO/FXS Card

This card has 4 module ports that can be loaded with FXS or FXO modules. You can auto config this card just like the X100P.
Channel 1 is the top RJ-45 on the back of the TDM400P card.
Note: On some cards with only two active ports the lower two ports may be the active ones. You can check before you install the cards by noting the position of the small daughter cards adjacent to each port. Otherwise you can check after installation by noting which LED's are active on back of the card.

Start by installing the card into a free PCI slot.
Make certain that you connect a power cable into the card.
FXO and FXS cards require power in order to power the telephone line or extension.
The TDM400P range of cards use the standard 4 pin harddrive power connector, if you don't have a free power connector you can always buy the equivalent of a double adaptor.
Once installed close the box up and plug a telephone line (or extension) into each port of the card (I'm not certain this is actually required).
Note: the TDM400P range of cards ALL have four ports on the back, however depending on which model you bought not all ports may be usable. For instance if you purchased a two port FXO card then only the top two ports are usable.

Close the PC up and turn the power on.
Note: the LED's adjacent to each port will not come on util the the device has been properly configured.

You can check that your Operating System recognized the card by running the following command:
lspci

The TDM cards are recognized as: (don't ask me why)
Network controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface

Note: The easiest way to install a TDM400P card is to install it before installing Asterisk@Home.

If you installed the cards after installing Asterisk@home you may have to do some additional work:
The two errors I recieved are (during boot):
loading Zaptel framework: FATAL: Module zaptel not found.
Missing /dev/zap/ctl

The following actions overcame the problem.

1. edit /etc/udev/rules.d/50-udev.rules
2. add the following lines to the bottom of the file (first check that they don't exists elsewhere)
  1. Section for zaptel device
KERNEL="zapctl", NAME="zap/ctl"
KERNEL="zaptimer", NAME="zap/timer"
KERNEL="zapchannel", NAME="zap/channel"
KERNEL="zappseudo", NAME="zap/pseudo"
KERNEL="zap[0-9]*", NAME="zap/%n"

3. reboot
4. execute the following command: rebuild_zaptel
5. genzaptelconf

Asterisk should now be up and running. Check that the TDM card has been recongnized by running the following from the Asterisk command prompt:
zap show channels

You should see something simliar to :
Chan Extension Context Language MusicOnHold
pseudo from-internal en
1 from-internal en
2 from-internal en

You can find some of the details describing part of the above problem here:
Details on fixing the problem with a messing /dev/zap/ctl can be found here.


Next check that each card is running on its own IRQ. Asterisk is quite sensitive to IRQ response times so sharing an IRQ just isn't going to work.
You can check what IRQ each TDM card is operating on by running:
cat /proc/interrupts

TDM cards show up as 'wctdm'. If the card is on the same line as any other device then you will need to reconfigure your systems IRQ or see HINT below.


You can also refer to http://www.asteriskguru.com/tutorials/wildcard_tdm400p.html for a good article on getting the TDM400P range of cards operating.


To configure these cards for use with Asterisk@Home first use the zaptel card auto-config utility to set up the zaptel driver.

Type genzaptelconf -s -d from the command line (if the card was in the system when you installed aah this is already done). Check out what the config has with:
Note: -s -d arn't supported in Asterisk 1.2. Just running genzaptelconf appears to be sufficent.
ztcfg -vv

HINT: If you cannot see the TDM400 card's resources you must make sure it has its own UNSHARED IRQ (interrupt). It must not share an IRQ with any other device or onboard resource. There may be a way in your BIOS to change IRQs. Using a different PCI slot can also resolve this issue.

Next, using config edit, look in the zapata-auto.conf file you will see a list of all your channels. Set up the trunks as trunks and the extensions as extensions in AMP.

For example if your zapata-auto.conf file looks like this

Span 1
WCTDM/0 "Wildcard TDM400P REV E/F Board 1"
signalling=fxo_ks
Note
this is an extension. Create a ZAP extension in AMP for Channel 1
channel => 1

signalling=fxs_ks
Note
this is a trunk. Create a ZAP trunk in AMP for Channel 2
context=from-pstn
channel => 2


then add a zap extension for channel 1 and a zap trunk for channel 2

you may have to reboot your system to get everything going.


you must add a route for incoming calls or asterisk will not answer your trunk

click on incoming calls in amp and set up an incoming route.

to make outbound calls you will need an outbound route. Set one up in AMP.





5.4 T1/PRI Cards

Setup for Digium T100P and a PRI

login to the CLI as root

[root@asterisk1 /]# cd /etc 
[root@asterisk1 etc]# nano -w zaptel.conf 

Add these lines to /etc/zaptel.conf 

span=1,1,0,esf,b8zs 
bchan=1-23 # set this to 1-15,17-31 for E1 
dchan=24 # set this to 16 for E1

Add # to front of fxsks=1 so it looks like this: 

span=1,1,0,esf,b8zs 
bchan=1-23 # set this to 1-15,17-31 for E1 
dchan=24 # set this to 16 for E1 

#fxsks=1 
loadzone = us 
defaultzone=us 

Control-X then Y to save zaptel.conf 

Log into Asterisk@home using a browser http://-asterisk-ip-adress/admin 
Then click on Maintenance 
Then click on Config Edit 
Then click on zapata.conf 

Comment out with ; to signalling=fxs_ks: 

;signalling=fxs_ks 

Then copy just below it: 

signalling=pri_cpe ; pri_cpe = PRI slave ; pri_net = PRI master 
switchtype=national 

Then add this callerid=asreceived under ;usedistinctiveringdetection=yes 

Change echocancelwhenbridged=yes 

Change echotraining=400 ; Asterisk trains to the beginning of the call, number is in milliseconds 

at the end of the file copy and past:

channel => 1-23 ; Set this to 1-15,17-31 for E1 

Click Update and Click Re-Read Config 

Go back to SSH root 

[root@asterisk1 etc]# modprobe wct1xxp 
[root@asterisk1 etc]# ztcfg -vv 

Do a shutdown and restart the system

[root@asterisk1 etc]# shutdown -r now 


You just need to login via web and make your setup.


5.5 ISDN Cards

Integrated Services Digital Network (ISDN) is an international standard that defines a worldwide, completely digital switched telephone network.

There are many different ISDN cards and there is two main types of ISDN and they are BRI and PRI.

ISDN Basic Rate Interface, or BRI. On a single pair of ordinary phone wires, BRI offers two "bearer" channels at a 64kbps or 56kbps transmission rate and one "data" channel at 16kbps. This configuration is often referred to as 2B+D. "B" is the channel that transports, in this case, the voice traffic and the "D" channel is used for signalling.

There is also ISDN Primary Rate Interface or PRI. There is mainly two types of PRI, American PRI and European PRI. An American PRI offers 23 "B" channels and one "D" channel. In Europe and Asia, this service offers 30 "B" channels and one "D" channel.


5.5.1 ISDN BRI Cards

There is one main difference between card types, passive cards and active cards and how do you tell the difference ? The active card has its own cpu that offload the PC's cpu and therefore they are expensive. There are also BRI cards with multiple ports.


5.5.1.1 ISDN BRI Cards with HFC chipset




5.5.1.2 ISDN BRI Cards without HFC chipset


5.5.1.2.1 AVM Active Cards

b1
http://www.avm.de/en/index.php3?Produkte/Server-Produkte/B1_PCI/index.js.html
A single port active card. I had some problems getting it working with AAH 2.8 and wrote up some notes at http://aussievoip.com.au/wiki/index.php?page=freePBX-AVMb1 SimonHobson, May06

5.5.2 ISDN PRI Cards

5.5.2.1 ISDN PRI Cards, Digium

5.5.2.2 ISDN PRI Cards, Sangoma

Sangoma, a Canadian based company, create T1 cards in the 1,2,4,8 port flavors. For all PCI/PCI-X cards, I strongly recommend getting the A10xd models as they incorporate an Onboard Hardware Echo Cancellation 1024 taps/128ms per channel. When getting a card you have a choice of PCI or PCI-X. These cards fully support Asterisk and their support lines definitely help you get your cards up and running. These cards are a good starting point for your starter system IF you need T1/PRI PSTN access.


5.6 Channel banks

5.6.1 Zhone Channel Banks


5.6.2 Mediatrix Analog Series

1124 - 24-port FXS VoIP Access Device
This unit is great for MTU/MDU/Hotel installations as this would be located in the phone room and you would not need all those ATA devices (Linksys SPA ATAs) It allows you to save time and space for those large projects.
More information available here for this product.

If anyone has configured such a device for Trixbox/Asterisk, please post your sample configs here.


5.7 Digital Gateways/SIP Trunking

5.7.1 Mediatrix Digital Series

Mediatrix 3500 Series is a multi-function device combining VoIP IAD & Gateway. It applies to SIP trunking and PSTN access for local VoIP equipments solutions.

The 3531 Supports 1 T1, the 3532 handles 2 T1s
The 3631 Supports 1 E1, the 3632 handles 2 E1s

Security features: VPN, SNMPv3, SSH, HTTPS. Hardware ready and capable to support SRTP and SIP over TLS.

More information available here

If anyone configured this device for Trixbox/Asterisk, could you post a sample config here.


5.8 Tips and trick for ZAP Trunks

5.8.1 Outgoing ZAP calls missing first dialed digit


Sometimes Asterisk Dials before the Dial tone is ready. This causes the first digit to be lost and the call to fail. Usually you get a message from the phone company telling you to "dial 1 before the number"

To fix this add a "w+" to the dialing prefix in the Zap trunk this forces hardware to wait a half-second (for each "w" you put) for the dial tone before dialing digits.

Asterisk@Home Handbook Wiki




Chapter 5 PSTN interface cards

There are many types of PSTN interface cards. These can include a single FXO card to allow 1 home telephone line to be connected to Asterisk, or a T1 card that allows a digital trunk to be connected to Asterisk. All of these cards allow you to make calls directly on the Public Switch Telephone Network without having to use a VOIP phone service provider.

PSTN cards can also be used to connect a PSTN (Non VOIP) phone to Asterisk. These can include a single FXS card to allow 1 home telephone to be connected to Asterisk, or a T1 card that allows a channel bank with 24 phones or a tie line to a PBX to be connected to Asterisk.


5.1 FXO Cards/Devices

These cards allow you to connect a POTS (plain Old Telephone System) line to your Asterisk@Home box.


5.1.1 Digium Wildcard X100P OEM FXO PCI Card

These voice modems are available on e-bay for about $10.00 They are not made by Digium and are of low quality. Having said this they can work very well in many situations. If your phone line is well balanced they will work well. If it’s not you can get some bad echoes. We recommend them only for testing not for a production system.

To configure these cards for use with Asterisk@Home first use the zaptel card auto-config utility to set up the zaptel driver.

Type genzaptelconf -s -d from the command line (if the card was in the system when you installed aah this already done)

Next go into the AMP web interface and create a trunk.

There is already a trunk called ZAP/g0 edit this


Enter the phone number for you pots line in the Caller ID field
Enter 1 for Maximum channels
Set a dial rule if you want for this trunk
Select an outbound dial prefix to select this trunk when dialing

Set the Zap Identifier to 1 (the default is g0)


This trunk is now configured
you must add a route for incoming calls or asterisk will not answer this line

click on incoming calls in amp and set up an incoming route.

to make outbound calls you will need an outbound route. set one up in AMP

Hardware Conflicts

This card is especially sensistive to hardware conflicts. I had a problem where I was unable to make outbound or inbound calls and would hear static on the POTS line when asterisk tried to play its error message. I got errors like: "Everyone is busy/congested at this time", "ZT_CHANCONFIG failed on channel 1: No such device or address", and "wcfxo: probe of 0000:00:09.0 failed with error -5". I moved the PCI card from slot 1 to slot 2 and now everything works out-of-the-box. One symptom was that the card was listed in lspci (as a Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface) but wcfxo had no interrupt assigned in /proc/interrupts. If one wanted to add an automated check for this problem in the installation or a debug tool, that might be a good criterion.

5.2 FXS Cards/Devices

These cards/devices allow you to connect an Analog phone to your Asterisk@Home box.

5.3 FXO/FXS Combo Cards/Devices

These cards/devices allow you to connect a POTS (plain Old Telephone System) line and an Analog telephone to your Asterisk@Home box.

5.3.1 Linksys/Sipura SPA-3000 FXO/FXS Device

Contributed by: Casey

If you find this info. helpful, consider dropping a $1 donation in my PayPal virtual tin-can. Thanks!

If it is in-stock at buy.com, you can get it for less than $70 with free shipping. Sipura was bought by Linksys (Cisco bought Linksys, but retained the Linksys name). This device can be used as a stand-alone item with a third-party VoIP provider, or you can use it with Asterisk@Home. When used with Asterisk@Home, it can be used as a TRUNK to connect to the PSTN via its FXO interface, and can also act as an EXTENSION to connect an ANALOG telephone via its FXS interface (aka ATA - Analog Telephone Adapter).

Assumptions/Prerequisites/Tested with:
1. The Asterisk server and the SPA-3000 are public IP addresses, or on the same private network (no NAT is involved).
2. Asterisk@Home version 2.8 installed.
3. Sipura SPA-3000 with the 3.1.10(GWd) firmware installed, and reset to factory defaults (to reset the SPA-3000 to factory defaults, dial: ****73738#1 FYI 73738 spells RESET on a phone keypad).

Names and Numbering Conventions used in this example:
333.333.333.333 the Asterisk@Home server's IP address
444.444.444.444 the Sipura SPA-3000 devices's IP address
Username111 any username you want, as long as it's unique (example: SipuraPSTN)
Password111 any password you want to go with Username111
Username222 a different username than Username111 (example: 200)
Password222 any password you want to go with Username222
Password333 any password you want to use for the SPA-3000 user web configuration pages
Password444 any password you want to use for the SPA-3000 admin web configuration pages

Username111/Password111 are going to be used when setting up the TRUNK. Username222/Password222 are going to be used when setting up the EXTENSION. I'd recommend for Username222 you use a number you'd like for the extention (example: "200").

The following instructions have ***NO SECURITY*** features enabled. The SPA-3000's factory defaults will allow anyone who can access the IP address of the device to dial out using the PSTN. Unauthorized users could make any and many calls to long-distance, international and 900 numbers.

The device has three distinct functions. To make configuration as straigt-forward as possible, we're going to address each function as a separate task. (And, as it turns out, things also increase in complexity as we proceed. To save your sanity, it's highly recommended you troubleshoot any issues at the end of each task, before proceeding on to the next task.)

5.3.1.1 SPA-3000 FXO as a PSTN-To-VoIP Gateway (Inbound Trunk)


This is the first of four tasks. Some of the settings below vary depending on if you have (pay your local phone company for) Caller ID on your PSTN line. Those variables are mentioned when and where applicable.

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the PSTN Line tab
3. Scroll down to Proxy and Registration
4. Set Proxy: 333.333.333.333
5. Scroll down to Subscriber Information
6. Set User ID: Username111
7. Set Password: Password111
8. Scroll down to Dial Plans
9. Set Dial Plan 2: (S0<:333.333.333.333>)
10. Scroll down to PSTN-To-VoIP Gateway Setup
11. Set PSTN CID for VoIP CID: yes (with PSTN Caller ID) / no (without PSTN Caller ID)
12. Set PSTN Caller Default DP: 2
13. Scroll down to FXO Timer Values (sec)
14. Set PSTN Answer Delay: 3 (with PSTN Caller ID) / 0 (without PSTN Caller ID)

Within Asterisk@Home:
1. Access the FreePBX Setup page.
2. Click Trunks
3. Click Add Trunk
4. Click Add SIP Trunk
5. Scroll down to Outgoing Settings
6. Set Trunk Name: Username111
7. Delete the prefilled Peer Details:, and replace them with:
canreinvite=no
context=from-pstn
host=dynamic
nat=no
port=5061
secret=Password111
type=peer

8. Scroll down to Incoming Settings
9. Delete the prefilled User Details:, just leave it blank.
10. Scroll down to the bottom of the page and click Submit Changes
11. Click the You have made changes - when finished, click here to APPLY them at the top of the page.

Before proceeding to configuring the SPA-3000 as an outbound trunk and analog telephone adapter, make certain it's accepting incoming calls using the configuration above. Troubleshooting any problems at this point will make your life easier. Remember to configure Inbound Routes from within the FreePBX interface. Without an inbound route configured, A@H won't know what to do with the call the SPA-3000 is trying to send to it!

5.3.1.2 SPA-3000 FXO as a VoIP-To-PSTN Gateway (Outbound Trunk)


This is the second of four tasks. Now that you've got the SPA-3000 routing incoming PSTN calls to Asterisk, it's time to change direction and allow Asterisk to route calls out the SPA-3000. Actually, the SPA-3000 will allow outbound calls without any additional configuration, if it's running factory defaults with just the changes made in the first task. Asterisk can send calls to the SPA-3000, and it will send them out the PSTN.

In reality, at this point any SIP device can send calls to the SPA-3000 and it will route them out the PSTN. Not the most secure setup, is it? After paying for someone else's international and 900 calls that they conveniently routed through your SPA-3000 PSTN connection, you might want to consider restricting just who can use it. Here's how:

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the PSTN Line tab
3. Scroll down to VoIP-To-PSTN Gateway Setup
4. Set VoIP Caller Auth Method: HTTP Digest
5. Scroll down to VoIP Users and Passwords (HTTP Authentication)
6. Set VoIP User 1 Auth ID: Username111
7. Set VoIP User 1 Password: Password111

Within Asterisk@Home:
No changes are needed. The settings used in the previous task are sufficient.

The SPA-3000 still isn't completely secure against abuse by other SIP devices and users. We cover the final settings in the fourth task.

Before proceeding to configuring the SPA-3000 as an analog telephone adapter, make certain it's sending outgoing calls using the configuration above. Troubleshooting any problems at this point will still make your life easier. Remember to configure Outbound Routes from within the FreePBX interface. Without an outbound route configured, A@H won't know when to send an outgoing call to the SPA-3000!

5.3.1.3 SPA-3000 FXS as an Analog Telephone Adapter (Asterisk Extension)


This is the third of four tasks. Using the SPA-3000 for an EXTENSION is a process that is totally separate from using it as a TRUNK. In fact, the device handles the Line 1 settings as a one VoIP account, and the PSTN Line settings as a totally separate VoIP account. Now you know why we needed two Usernames/Passwords! So, if you only want to use it as a TRUNK, skip this task and go to task four. Or, if you only want to use it as an EXTENSION, skip tasks one and two, and just complete tasks three and four.

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the Line 1 tab
3. Scroll down to Proxy and Registeration
4. Set Proxy: 333.333.333.333
5. Scroll down to Subscriber Information
6. Set User ID: Username222
7. Set Password: Password222
8. Scroll down to Dial Plan
9. Set Dial Plan: (xx.)

Within Asterisk@Home:
1. Access the FreePBX Setup page.
2. Click Extensions
3. Click Add Extension
4. Click Add SIP Extension
5. Scroll down to Add Extension
6. Set Extension Number: Username222
7. Scroll down to Device Options
8. Set secret Password222
9. Scroll down to the bottom of the page and click Submit Changes
10. Click the You have made changes - when finished, click here to APPLY them at the top of the page.

Remember, the SPA-3000 can be used with third-party VoIP providers. Imagine for a moment that you are a large VoIP provider, with hundreds of thousands of customers. Depending on your design philisophy, you might want the customer's equipment to do a lot of the processing when it comes to common tasks, instead of querying your server each time. If a dialplan could be stored locally on the device, then when a customer dialed a number, the device could determine if it was valid, before passing it to your server.

This pre-processing would potentially reduce a lot of traffic from the device to your server, meaning you could service more customers per server. This is exactly how the SPA-3000 is designed to work. If you leave the default Line 1 tab's Dial Plan in place, the SPA-3000 will attempt to determine if the number is valid, before passing it to Asterisk. If the number doesn't match the dialplan stored in the SPA-3000, the SPA-3000 will reject it, without ever checking with Asterisk. That's why we've changed it, as we want the SPA-3000 to pass it to Asterisk without much adieu.

This pre-processing by the SPA-3000 is most noticable when using vertical service codes (for example: *61 or *65). Instead of bothering your Asterisk server to determine if the code is valid, the SPA-3000 will try to figure it out by itself. Knowing this may save you from hours of wondering why *61 will work, but *65 won't. Tinkering with the Line 1 tab's Supplementary Service Subscriptions settings, and the Regional tab's Vertical Service Activiation Codes settings are beyond the scope of this handbook entry. But, at least now you're aware of what's happening.

5.3.1.4 SPA-3000 Securing the Web Interface


This is the fourth of four tasks. In the previous tasks, we've setup usernames/passwords for our device. The largest issue with the SPA-3000 is the potential for unauthorized users to place long-distance, international, and 900 calls out through the PSTN. While we've configured the device to use usernames/passwords, they're really not much good at the moment. Why? Because any unauthorized user could simply access the SPA-3000's web interface, just like you, and either determine what your usernames/passwords settings are, or even more simply, they could reset them to something THEY want.

The final step, therefore, is to secure the SPA-3000 web interface with a password.

On the SPA-3000:
1. Access the Sipura SPA-3000's Advanced Admin page at http://444.444.444.444/admin/advanced
2. Click on the System tab
3. Scroll down to System Configuration
4. Set User Password: Password333
5. Set Admin Passwd: Password444

Enjoy!

5.3.2 Digium TDM400P FXO/FXS Card

This card has 4 module ports that can be loaded with FXS or FXO modules. You can auto config this card just like the X100P.
Channel 1 is the top RJ-45 on the back of the TDM400P card.
Note: On some cards with only two active ports the lower two ports may be the active ones. You can check before you install the cards by noting the position of the small daughter cards adjacent to each port. Otherwise you can check after installation by noting which LED's are active on back of the card.

Start by installing the card into a free PCI slot.
Make certain that you connect a power cable into the card.
FXO and FXS cards require power in order to power the telephone line or extension.
The TDM400P range of cards use the standard 4 pin harddrive power connector, if you don't have a free power connector you can always buy the equivalent of a double adaptor.
Once installed close the box up and plug a telephone line (or extension) into each port of the card (I'm not certain this is actually required).
Note: the TDM400P range of cards ALL have four ports on the back, however depending on which model you bought not all ports may be usable. For instance if you purchased a two port FXO card then only the top two ports are usable.

Close the PC up and turn the power on.
Note: the LED's adjacent to each port will not come on util the the device has been properly configured.

You can check that your Operating System recognized the card by running the following command:
lspci

The TDM cards are recognized as: (don't ask me why)
Network controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface

Note: The easiest way to install a TDM400P card is to install it before installing Asterisk@Home.

If you installed the cards after installing Asterisk@home you may have to do some additional work:
The two errors I recieved are (during boot):
loading Zaptel framework: FATAL: Module zaptel not found.
Missing /dev/zap/ctl

The following actions overcame the problem.

1. edit /etc/udev/rules.d/50-udev.rules
2. add the following lines to the bottom of the file (first check that they don't exists elsewhere)
  1. Section for zaptel device
KERNEL="zapctl", NAME="zap/ctl"
KERNEL="zaptimer", NAME="zap/timer"
KERNEL="zapchannel", NAME="zap/channel"
KERNEL="zappseudo", NAME="zap/pseudo"
KERNEL="zap[0-9]*", NAME="zap/%n"

3. reboot
4. execute the following command: rebuild_zaptel
5. genzaptelconf

Asterisk should now be up and running. Check that the TDM card has been recongnized by running the following from the Asterisk command prompt:
zap show channels

You should see something simliar to :
Chan Extension Context Language MusicOnHold
pseudo from-internal en
1 from-internal en
2 from-internal en

You can find some of the details describing part of the above problem here:
Details on fixing the problem with a messing /dev/zap/ctl can be found here.


Next check that each card is running on its own IRQ. Asterisk is quite sensitive to IRQ response times so sharing an IRQ just isn't going to work.
You can check what IRQ each TDM card is operating on by running:
cat /proc/interrupts

TDM cards show up as 'wctdm'. If the card is on the same line as any other device then you will need to reconfigure your systems IRQ or see HINT below.


You can also refer to http://www.asteriskguru.com/tutorials/wildcard_tdm400p.html for a good article on getting the TDM400P range of cards operating.


To configure these cards for use with Asterisk@Home first use the zaptel card auto-config utility to set up the zaptel driver.

Type genzaptelconf -s -d from the command line (if the card was in the system when you installed aah this is already done). Check out what the config has with:
Note: -s -d arn't supported in Asterisk 1.2. Just running genzaptelconf appears to be sufficent.
ztcfg -vv

HINT: If you cannot see the TDM400 card's resources you must make sure it has its own UNSHARED IRQ (interrupt). It must not share an IRQ with any other device or onboard resource. There may be a way in your BIOS to change IRQs. Using a different PCI slot can also resolve this issue.

Next, using config edit, look in the zapata-auto.conf file you will see a list of all your channels. Set up the trunks as trunks and the extensions as extensions in AMP.

For example if your zapata-auto.conf file looks like this

Span 1
WCTDM/0 "Wildcard TDM400P REV E/F Board 1"
signalling=fxo_ks
Note
this is an extension. Create a ZAP extension in AMP for Channel 1
channel => 1

signalling=fxs_ks
Note
this is a trunk. Create a ZAP trunk in AMP for Channel 2
context=from-pstn
channel => 2


then add a zap extension for channel 1 and a zap trunk for channel 2

you may have to reboot your system to get everything going.


you must add a route for incoming calls or asterisk will not answer your trunk

click on incoming calls in amp and set up an incoming route.

to make outbound calls you will need an outbound route. Set one up in AMP.





5.4 T1/PRI Cards

Setup for Digium T100P and a PRI

login to the CLI as root

[root@asterisk1 /]# cd /etc 
[root@asterisk1 etc]# nano -w zaptel.conf 

Add these lines to /etc/zaptel.conf 

span=1,1,0,esf,b8zs 
bchan=1-23 # set this to 1-15,17-31 for E1 
dchan=24 # set this to 16 for E1

Add # to front of fxsks=1 so it looks like this: 

span=1,1,0,esf,b8zs 
bchan=1-23 # set this to 1-15,17-31 for E1 
dchan=24 # set this to 16 for E1 

#fxsks=1 
loadzone = us 
defaultzone=us 

Control-X then Y to save zaptel.conf 

Log into Asterisk@home using a browser http://-asterisk-ip-adress/admin 
Then click on Maintenance 
Then click on Config Edit 
Then click on zapata.conf 

Comment out with ; to signalling=fxs_ks: 

;signalling=fxs_ks 

Then copy just below it: 

signalling=pri_cpe ; pri_cpe = PRI slave ; pri_net = PRI master 
switchtype=national 

Then add this callerid=asreceived under ;usedistinctiveringdetection=yes 

Change echocancelwhenbridged=yes 

Change echotraining=400 ; Asterisk trains to the beginning of the call, number is in milliseconds 

at the end of the file copy and past:

channel => 1-23 ; Set this to 1-15,17-31 for E1 

Click Update and Click Re-Read Config 

Go back to SSH root 

[root@asterisk1 etc]# modprobe wct1xxp 
[root@asterisk1 etc]# ztcfg -vv 

Do a shutdown and restart the system

[root@asterisk1 etc]# shutdown -r now 


You just need to login via web and make your setup.


5.5 ISDN Cards

Integrated Services Digital Network (ISDN) is an international standard that defines a worldwide, completely digital switched telephone network.

There are many different ISDN cards and there is two main types of ISDN and they are BRI and PRI.

ISDN Basic Rate Interface, or BRI. On a single pair of ordinary phone wires, BRI offers two "bearer" channels at a 64kbps or 56kbps transmission rate and one "data" channel at 16kbps. This configuration is often referred to as 2B+D. "B" is the channel that transports, in this case, the voice traffic and the "D" channel is used for signalling.

There is also ISDN Primary Rate Interface or PRI. There is mainly two types of PRI, American PRI and European PRI. An American PRI offers 23 "B" channels and one "D" channel. In Europe and Asia, this service offers 30 "B" channels and one "D" channel.


5.5.1 ISDN BRI Cards

There is one main difference between card types, passive cards and active cards and how do you tell the difference ? The active card has its own cpu that offload the PC's cpu and therefore they are expensive. There are also BRI cards with multiple ports.


5.5.1.1 ISDN BRI Cards with HFC chipset




5.5.1.2 ISDN BRI Cards without HFC chipset


5.5.1.2.1 AVM Active Cards

b1
http://www.avm.de/en/index.php3?Produkte/Server-Produkte/B1_PCI/index.js.html
A single port active card. I had some problems getting it working with AAH 2.8 and wrote up some notes at http://aussievoip.com.au/wiki/index.php?page=freePBX-AVMb1 SimonHobson, May06

5.5.2 ISDN PRI Cards

5.5.2.1 ISDN PRI Cards, Digium

5.5.2.2 ISDN PRI Cards, Sangoma

Sangoma, a Canadian based company, create T1 cards in the 1,2,4,8 port flavors. For all PCI/PCI-X cards, I strongly recommend getting the A10xd models as they incorporate an Onboard Hardware Echo Cancellation 1024 taps/128ms per channel. When getting a card you have a choice of PCI or PCI-X. These cards fully support Asterisk and their support lines definitely help you get your cards up and running. These cards are a good starting point for your starter system IF you need T1/PRI PSTN access.


5.6 Channel banks

5.6.1 Zhone Channel Banks


5.6.2 Mediatrix Analog Series

1124 - 24-port FXS VoIP Access Device
This unit is great for MTU/MDU/Hotel installations as this would be located in the phone room and you would not need all those ATA devices (Linksys SPA ATAs) It allows you to save time and space for those large projects.
More information available here for this product.

If anyone has configured such a device for Trixbox/Asterisk, please post your sample configs here.


5.7 Digital Gateways/SIP Trunking

5.7.1 Mediatrix Digital Series

Mediatrix 3500 Series is a multi-function device combining VoIP IAD & Gateway. It applies to SIP trunking and PSTN access for local VoIP equipments solutions.

The 3531 Supports 1 T1, the 3532 handles 2 T1s
The 3631 Supports 1 E1, the 3632 handles 2 E1s

Security features: VPN, SNMPv3, SSH, HTTPS. Hardware ready and capable to support SRTP and SIP over TLS.

More information available here

If anyone configured this device for Trixbox/Asterisk, could you post a sample config here.


5.8 Tips and trick for ZAP Trunks

5.8.1 Outgoing ZAP calls missing first dialed digit


Sometimes Asterisk Dials before the Dial tone is ready. This causes the first digit to be lost and the call to fail. Usually you get a message from the phone company telling you to "dial 1 before the number"

To fix this add a "w+" to the dialing prefix in the Zap trunk this forces hardware to wait a half-second (for each "w" you put) for the dial tone before dialing digits.

Created by: GinelLipan, Last modification: Tue 11 of Sep, 2012 (00:45 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+