Using the Linksys SPA400 with Asterisk

For small- and medium-sized businesses, going all-VoIP is not an easy decision.  The Linksys SPA400 is a low-cost four FXO port baby-step solution on the path to VoIP. We explain how to get it working with Asterisk.

For small- and medium-sized businesses, going all-VoIP is not an easy decision.

Fortunately, the switch-over, which can result in substantial savings and add bold new capabilities to tired old office phone systems, can be done in baby-steps: Purchase an Internet Protocol (IP) based phone system, but keep the PSTN lines, for now.

It is indeed possible to integrate VoIP into an existing office analog system, keeping current phone services intact while routing costly toll calls out over IP. Until recently, though, the hardware needed for such integration was difficult to use and expensive.

There are two ways to route calls between VoIP and the PSTN: subscribe to an Internet Telephony Service Provider (ITSP) or keep the PSTN lines and purchase equipment to make the conversion.

Keeping the PSTN lines requires VoIP gateways to convert the PSTN signal to a VoIP signal.  For analog lines, these gateways need a Foreign Exchange Office (FXO) port.

Until recently, most reasonably priced VoIP gateways had only one or two FXO ports – enough ports for home use, but too few for small businesses and remote offices.

The average price for a four FXO port VoIP gateway was $400-$500, until Linksys released the SPA400.

The Linksys SPA400 is an attractive low-cost ($295) four FXO port solution that costs $100 less than its peers.

The official position from Linksys is that the SPA400 will only work with the Linksys SPA9000, but in this article, we explain how to configure the SPA400 to work with the Open Source PBX Asterisk.  We also have a related configuration for the CommuniGate Pro Internet Communication System.

This article covers the SPA400 with firmware version 1.0.0.3 and Asterisk version 1.2.7.1. The configuration for new product versions may differ, so check the Voxilla Forums for updated information.



{mospagebreak title=SPA400 – Setup-Basic Setup&toctitle=Introduction}

 Configuring the SPA400

Connect to the SPA400 via the Web interface.  The default username is Admin (case sensitive) and no password.

Setup->Basic Setup

  •  Go to the Basic Setup screen.
  • Setup the Fixed IP Address information for the SPA400.  Do not use Dynamic IP Addresses – the Asterisk server must find the SPA400 and register with it.

{mosimage}

  • Setup the SPA400 DNS and NTP information.
  • Click Save Settings.



{mospagebreak title=SPA400 – Setup-SPA9000 Interface}

 Configuring the SPA400

 Setup->SPA9000 Interface

  • Go to the SPA9000 Interface configuration page.
  • Change the User ID to spa400.
  • Leave the SPA9000 Address set to Discover Automatically.  For added security, once the SPA400 is working with the Asterisk server this value can be changed to match the server information.

{mosimage}

  • Click Save Settings.



{mospagebreak title=Asterisk – sip.conf Settings}

Configuring Asterisk

Connect to the Asterisk server.

sip.conf Settings

The SPA400 needs the account name to match the value specified in the SPA400 User ID configuration field.  The entry in sip.conf should look like the following:

[general]
register=spa400@192.168.1.109/spa400

Substitute spa400 for the value entered in the SPA400 User ID field and replace 192.168.1.109 with the actual IP address of the SPA400.

Then create a SIP entry for the SPA400. 

  • user: the SPA400 User ID field value
  • host: the IP address of the SPA400
  • context: the context that should handle inbound calls from the SPA400

It should look like the following:

[spa400]
type=friend
user=spa400
host=192.168.1.109
dtmfmode=rfc2833
canreinvite=no
context=from-trunk
insecure=very



{mospagebreak title=Asterisk – extensions.conf Settings}

Configuring Asterisk

extensions.conf Settings

Configure your dial-out routing to utilize the spa400.

A generic dial-out route (dial 9 to get a SPA400 FXO trunk) would look like:

[general]
DIAL_OUT = 9
DIALOUTIDS = 2/
OUTCID_2 =
OUTMAXCHAINS_2 = 4
OUTPREFIX_2 =
OUT_2 = SIP/spa400

Inbound routing is more complex, but could look something like this (forward all calls to extension 200):

[from-trunk]
include => from-pstn

[from-pstn]
include=> from-pstn-custom

[from-pstn-custom]
exten=>spa400,1,Goto(ext-local,200,1)

{mospagebreak title=Conclusion}

Conclusion

The configuration is now ready for testing.

Testing should include testing both inbound and outbound calls.  

If you need additional help with this configuration, help is available at the Voxilla Forum – Asterisk Users Group

 



Be Sociable, Share!