Setting Up PBX in a Flash, Part 4: Configuring a Linksys SPA3102

I’ve just posted a series of articles on selecting a VoIP PBX and setting it up under Microsoft Virtual Server. To read the series from the beginning, see Getting Into VoIP.

Setting up an Analog Terminal Adapter (ATA) for a VoIP system is normally something you do while configuring the PBX. However, since it is configured as a separate device using its own web interface, it seemed to warrant its own blog entry.

Getting Connected

Unless you plan to exclusively use SIP phones and VoIP providers for your VoIP installation, you need to find a way to connect to analog telephone lines. You need hardware that has “FXO” ports to connect to the phone company’s lines (called PSTN lines). You may also need hardware that has “FXS” ports to connect to your existing analog phones. (It’s amazing what an analog phone can do when connected to an Asterisk VoIP system–there are feature codes like *97 for almost any imaginable function.)

My initial Trixbox installation a couple years ago runs on a physical machine and uses a Digium PCI card to provide 2 FXO and 2 FXS ports. That’s been working pretty well, though it would probably benefit from some updated drivers .

This time, encouraged by 3CX‘s decision to rely exclusively on network-attached devices, I decided to buy some ATAs. In fact, this is the only option when running in a virtual environment–there is no way that I know of to plug PCI cards directly into a virtual machine.

At first I tested the Grandstream HandyTone HT503. This device provides one FXO and one FXS port and is very reasonably priced–under $50 each. Unfortunately, I was unable to get past some Caller ID issues with these devices (Caller ID is a new capability in this relatively new model), so I ultimately returned the units.

I then chose to use the Linksys by Cisco SPA3102 instead. This product also supplies one FXO and one FXS port. It’s been on the market for some time so it is hopefully fairly mature. You can buy them new for about $75; sometimes they are available for less on eBay.

Configuring the SPA-3102

Aside from some basic WAN and LAN setup which applies to the entire device, the SPA3102 is really treated as two devices when setting it up for use with a PBX. The “Line 1” settings are used to configure the FXS side, which is used to connect an analog telephone. The “PSTN Line” setting are used to configure the FXO side, which are used to connect to the phone company line. Either side may be disabled if you only need part of the functionality.

Since both sides of the SPA3102 share the same IP address, each side must have its own port. By default, the Line 1 setup uses port 5060, while the PSTN Line uses port 5061.

One thing that I discovered in my testing is that often I could use the same or a very similar setup for different PBXs that I tested. The primary entries below refer to the PBX in a Flash (PiaF) settings, but there are also notes in [brackets] pointing out some differences for 3CX and sipXecs. One difference is that under 3CX and PiaF, both internal phones (FXS devices) and external PSTN lines (FXO) register with the PBX. Under sipXecs, only endpoints, that is, only FXS devices register with the PBX.

Here are the SPA3102 settings that I changed from the default to get them to work with the various PBXs. Of course your settings may differ depending on your environment. I’m indebted to the 3CX SPA3102 configuration guide for pointing out most of the necessary changes:

Router tab

Wan Setup tab

Internet Connection Settings

– Connection Type:  DHCP  (use router to assign an IP address based on the device’s MAC address)

Optional Settings

– Primary NTP Server: (the Windows server on my network that provides NTP server service) 
– Remote Management

Remote Management

– Enable WAN Web Server:  Yes

Lan Setup tab

Networking Service:  Bridge (use external router)

Voice tab

SIP tab

RTP Parameters

– RTP Packet Size:  0.020 – added 1/21/09 – see comments

Regional tab

Ring and Call Waiting Tone Spec

– Ring Waveform:  Sinusoid (default is Trapezoid)
– Ring Frequency:  25 (default is 20) – 1/21/09:  now back to 20 – see comments
– Ring Voltage:  80 (default is 85) – 1/21/09:  now back to 85 – see comments


– Daylight Saving Time Rule:  start=3/8/7/02:0:0;end=11/1/7/02:0:0;save=1
  (should handle the new Daylight Saving rules; default was start=4/1/7;end=10/-1/7;save=1)

Line 1 tab

Network Settings

– Network Jitter Level:  Very High (was High) – added 7/6/09 for fax  – see 3CX article
– Jitter Buffer Adjustment:  Disabled (was Up and Down) – added 7/6/09 for fax  – see 3CX article

Proxy and Registration

– Proxy: (the IP address that the router assigns to mypbx.mydomain.local)

Subscriber Information

– Display Name:  Personal [SipX:  200 if using 3-digit extensions]
– User ID:  20 [SipX:  200 if using 3-digit extensions]
– Password:  (phone extension password)
– Use Auth ID:  no

Audio Configuration

– Echo Canc Enable:  No (was Yes) – added 7/6/09 for fax  – see 3CX article
– Fax Passthru Method:  ReINVITE (was NSE)- added 7/6/09 for fax – see 3CX article

PSTN Line tab

SIP Settings

– SIP Port:  5061 [3CX:  change the PSTN line in the 3CX web UI to use 5061, not 5060]

Proxy and Registration

– Proxy: (the IP address that the router assigns to mypbx.mydomain.local) [SipX:  leave blank]
– Register:  Yes [SipX:  No]
– Make Call Without Reg:  No [SipX:  Yes]
– Ans Call Without Reg:  No [SipX:  Yes?]

Subscriber Information

– Display Name:  Personal [SipX:  leave blank]
– User ID:  Personal [SipX:  leave blank]
– Password:  (trunk password) [SipX:  leave blank]

Dial Plans

– Dial Plan 8:  S0<:Personal> (dial trunk “Personal”)
  [SipX:  Dial Plan 8:  S0<:200@> (set to ring thru to ext. 200)]

PSTN-To-VoIP Gateway Setup

– PSTN Ring Thru Line 1:  No
– PSTN Caller Default DP:  8 (points to Dial Plan 8 above)

FXO Timer Values (Sec)

– PSTN Answer Delay:  5 (allow time for Caller ID and/or fax detection)

4 thoughts on “Setting Up PBX in a Flash, Part 4: Configuring a Linksys SPA3102

  1. Fred

    There are many guides for configuring the SPA-3102 out there and most of them manage to get something wrong. One thing I noticed here is that the Ring Frequency is wrong for the U.S.A. and Canada – while it probably won’t matter if you only use very modern phones, if you try to use an old Western Electric or similar phone it probably won’t ring until you change the ring frequency to 20. Also, the correct ring voltage is 90 volts – slightly lower voltages may work, but they aren’t Bellcore standard.

    Another thing to note – this is from the page “How to setup a Linksys SPA-3102 or Sipura SPA-3000 with FreePBX” on the site (which is the most comprehensive guide I’ve seen on the subject) –

    Check the RTP Packet Size!!!
    VERY IMPORTANT: Before you do anything else, go to the SIP tab. Look under RTP Parameters and check the RTP Packet Size. Linksys has set this to 0.030 by default, which is not correct for use on ulaw (G711u codec) connections. Change it to 0.020 instead (or 0.02 on older Sipura devices). If you don’t do this, you may experience strange problems with “choppiness” or random clicks on some calls but not others, and you may also experience problems when playing Asterisk sound files. By the way, this applies to all Linksys/Sipura adapters, not just the SPA-3000/3102.

    I can personally attest to the above, there was a very annoying clicking in the receiver until I changed this.

  2. Mark Berry

    Thanks Fred. It does seem incredibly complex to configure an ATA, especially compared to just plugging in an analog phone and having it work.

    Although my phones have been ringing okay, I will try Ring Frequency of 20. From some additional reading (;f=24;t=000576), I have the impression that CO line voltages are not always up to spec (90), so I’ll set Ring Voltage back to its Linksys default (85).

    A bigger concern is general voice quality, which has intermittently been pretty poor, not to mention that outbound faxing fails most of the time. I’m anxious to see if setting the RTP Packet Size to 0.020 helps with these issues. Here’s an additional article on RTP Packet Size:

  3. John Murray

    Incredible. I have been working on this for hours. However, with your post, I was able to spend 10 minutes configuring parameters and everything worked the first time!

    In my configuration, I am not using the ethernet port on the 3102. Rather, the WAN port is connected to my internal network. PIAF and my polycom 331 are both connected to the internal network. I have the bridging configured as you have and have used a static IP for the 3102.

    Thank you! I am now making outbound calls over the PSTN when they are local and outbound calls over VoIP when they are long distance.

    thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.